# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json imports: commons: ./commons.yml pagination: ./utils/pagination.yml service: auth: true base-path: /api/public endpoints: create: method: POST docs: Create a model path: /models request: CreateModelRequest response: commons.Model list: method: GET docs: Get all models path: /models request: name: GetModelsRequest query-parameters: page: type: optional docs: page number, starts at 1 limit: type: optional docs: limit of items per page response: PaginatedModels get: method: GET docs: Get a model path: /models/{id} path-parameters: id: string response: commons.Model delete: method: DELETE docs: Delete a model. Cannot delete models managed by Langfuse. You can create your own definition with the same modelName to override the definition though. path: /models/{id} path-parameters: id: string types: PaginatedModels: properties: data: list meta: pagination.MetaResponse CreateModelRequest: properties: modelName: docs: "Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime unit: docs: Unit used by this model. type: optional inputPrice: docs: Deprecated. Use 'pricingTiers' instead. Price (USD) per input unit. Creates a default tier if pricingTiers not provided. type: optional outputPrice: docs: Deprecated. Use 'pricingTiers' instead. Price (USD) per output unit. Creates a default tier if pricingTiers not provided. type: optional totalPrice: docs: Deprecated. Use 'pricingTiers' instead. Price (USD) per total units. Cannot be set if input or output price is set. Creates a default tier if pricingTiers not provided. type: optional pricingTiers: docs: | Optional. Array of pricing tiers for this model. Use pricing tiers for all models - both those with threshold-based pricing variations and those with simple flat pricing: - For models with standard flat pricing: Create a single default tier with your prices (e.g., one tier with isDefault=true, priority=0, conditions=[], and your standard prices) - For models with threshold-based pricing: Create a default tier plus additional conditional tiers (e.g., default tier for standard usage + high-volume tier for usage above certain thresholds) Requirements: - Cannot be provided with flat prices (inputPrice/outputPrice/totalPrice) - use one approach or the other - Must include exactly one default tier with isDefault=true, priority=0, and conditions=[] - All tier names and priorities must be unique within the model - Each tier must define at least one price If omitted, you must provide flat prices instead (inputPrice/outputPrice/totalPrice), which will automatically create a single default tier named "Standard". type: optional> tokenizerId: docs: Optional. Tokenizer to be applied to observations which match to this model. See docs for more details. type: optional tokenizerConfig: docs: Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details. type: optional