| import "../shared/index.tsp"; |
|
|
| namespace Features; |
|
|
| |
| |
| |
| @friendlyName("BillingFeatureUnitCostType") |
| enum FeatureUnitCostType { |
| Llm: "llm", |
| Manual: "manual", |
| } |
|
|
| |
| |
| |
| @friendlyName("BillingFeatureManualUnitCost") |
| model FeatureManualUnitCost { |
| |
| |
| |
| type: FeatureUnitCostType.Manual; |
|
|
| |
| |
| |
| amount: Shared.Numeric; |
| } |
|
|
| |
| |
| |
| @friendlyName("BillingFeatureLLMTokenType") |
| enum FeatureLlmTokenType { |
| Input: "input", |
| Output: "output", |
| CacheRead: "cache_read", |
| CacheWrite: "cache_write", |
| Reasoning: "reasoning", |
|
|
| |
| Request: "request", |
|
|
| |
| Response: "response", |
| } |
|
|
| |
| |
| |
| |
| |
| #suppress "@openmeter/api-spec-aip/repeated-prefix-grouping" "token_type and token_type_property are distinct API fields, not a groupable prefix" |
| @friendlyName("BillingFeatureLLMUnitCost") |
| model FeatureLlmUnitCost { |
| |
| |
| |
| type: FeatureUnitCostType.Llm; |
|
|
| |
| |
| |
| |
| @summary("Provider property") |
| provider_property?: string; |
|
|
| |
| |
| |
| |
| @summary("Provider") |
| provider?: string; |
|
|
| |
| |
| |
| |
| @summary("Model property") |
| model_property?: string; |
|
|
| |
| |
| |
| |
| @summary("Model") |
| `model`?: string; |
|
|
| |
| |
| |
| |
| @summary("Token type property") |
| token_type_property?: string; |
|
|
| |
| |
| |
| |
| |
| @summary("Token type") |
| token_type?: FeatureLlmTokenType; |
|
|
| |
| |
| |
| |
| |
| @summary("Resolved pricing") |
| @visibility(Lifecycle.Read) |
| pricing?: FeatureLlmUnitCostPricing; |
| } |
|
|
| |
| |
| |
| #suppress "@openmeter/api-spec-aip/repeated-prefix-grouping" "cache_read and cache_write are distinct pricing dimensions" |
| @friendlyName("BillingFeatureLLMUnitCostPricing") |
| model FeatureLlmUnitCostPricing { |
| |
| |
| |
| @summary("Input per token") |
| input_per_token: Shared.Numeric; |
|
|
| |
| |
| |
| @summary("Output per token") |
| output_per_token: Shared.Numeric; |
|
|
| |
| |
| |
| @summary("Cache read per token") |
| cache_read_per_token?: Shared.Numeric; |
|
|
| |
| |
| |
| @summary("Reasoning per token") |
| reasoning_per_token?: Shared.Numeric; |
|
|
| |
| |
| |
| @summary("Cache write per token") |
| cache_write_per_token?: Shared.Numeric; |
| } |
|
|
| |
| |
| |
| |
| @friendlyName("BillingFeatureUnitCost") |
| @discriminated(#{ envelope: "none", discriminatorPropertyName: "type" }) |
| union FeatureUnitCost { |
| @summary("Manual unit cost") |
| manual: FeatureManualUnitCost, |
|
|
| @summary("LLM unit cost") |
| llm: FeatureLlmUnitCost, |
| } |
|
|