> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/api-reference/models.md).

# Models

## List Models

> List all available models.\
> \
> Returns models auto-discovered from configured providers, enriched with\
> pricing data from the model\_pricing table when available, and with each\
> model's token limits: the context window from the live models.dev catalog,\
> or from the pricing snapshot where it has none, and the output limit from the\
> live catalog alone. A limit neither knows is null. Models that only exist in the pricing\
> table are also included for backward compatibility.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"ModelListResponse":{"description":"OpenAI-compatible model list response.","properties":{"data":{"items":{"$ref":"#/components/schemas/ModelObject"},"title":"Data","type":"array"},"object":{"default":"list","title":"Object","type":"string"}},"required":["data"],"title":"ModelListResponse","type":"object"},"ModelObject":{"description":"OpenAI-compatible model object.","properties":{"architecture":{"anyOf":[{"$ref":"#/components/schemas/ModelArchitecture"},{"type":"null"}]},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"created":{"title":"Created","type":"integer"},"deployment_managed":{"default":false,"title":"Deployment Managed","type":"boolean"},"id":{"title":"Id","type":"string"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"object":{"default":"model","title":"Object","type":"string"},"owned_by":{"title":"Owned By","type":"string"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingInfo"},{"type":"null"}]},"pricing_source":{"default":"none","title":"Pricing Source","type":"string"},"supported_parameters":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Parameters"}},"required":["id","created","owned_by"],"title":"ModelObject","type":"object"},"ModelArchitecture":{"description":"What a model reads and writes, in OpenRouter's ``architecture`` shape.","properties":{"input_modalities":{"items":{"type":"string"},"title":"Input Modalities","type":"array"},"output_modalities":{"items":{"type":"string"},"title":"Output Modalities","type":"array"}},"title":"ModelArchitecture","type":"object"},"ModelPricingInfo":{"description":"Pricing information for a model.","properties":{"cache_read_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Read Price Per Million"},"cache_write_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Write Price Per Million"},"input_price_per_million":{"title":"Input Price Per Million","type":"number"},"output_price_per_million":{"title":"Output Price Per Million","type":"number"},"pricing_tiers":{"items":{"anyOf":[{"$ref":"#/components/schemas/PricingTier"},{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"integer"}]},"type":"object"}]},"title":"Pricing Tiers","type":"array"},"unit":{"default":"tokens","title":"Unit","type":"string"}},"required":["input_price_per_million","output_price_per_million"],"title":"ModelPricingInfo","type":"object"},"PricingTier":{"description":"Whole-request price cliff selected by total billable input tokens.","properties":{"cache_read_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Cache Read Price Per Million"},"cache_write_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Cache Write Price Per Million"},"input_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Input Price Per Million"},"min_input_tokens":{"exclusiveMinimum":0,"title":"Min Input Tokens","type":"integer"},"output_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Output Price Per Million"}},"required":["min_input_tokens"],"title":"PricingTier","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/models":{"get":{"description":"List all available models.\n\nReturns models auto-discovered from configured providers, enriched with\npricing data from the model_pricing table when available, and with each\nmodel's token limits: the context window from the live models.dev catalog,\nor from the pricing snapshot where it has none, and the output limit from the\nlive catalog alone. A limit neither knows is null. Models that only exist in the pricing\ntable are also included for backward compatibility.","operationId":"models-list_models","parameters":[{"description":"Filter models by provider name","in":"query","name":"provider","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter models by provider name","title":"Provider"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelListResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"List Models","tags":["models"]}}}}
```

## List Discoverable Models

> List every model the configured provider credentials can reach.\
> \
> Operator-facing counterpart to GET /api/v1/models, which serves a curated catalog\
> to API callers. This reports each provider separately and keeps its error, so\
> a provider with a bad key is distinguishable from one with no models. It is\
> operator-gated because a provider error message describes the gateway's own\
> configuration.\
> \
> Covers the configured provider instances and every hosted provider switched\
> on, whatever organization it is restricted to. A hosted provider that a\
> configured instance of the same name shadows is not listed.\
> \
> Answers from the discovery cache, which a background refresher keeps warm, so\
> the call does not wait on a slow or unreachable provider. Each provider\
> carries the \`\`checked\_at\`\` its result was produced at; a null one has not been\
> dialed yet. Pass \`\`refresh=true\`\` to force a live re-dial of every provider.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"DiscoverableModelsResponse":{"description":"Per-provider discovery results for operator model selection.","properties":{"providers":{"items":{"$ref":"#/components/schemas/DiscoverableProvider"},"title":"Providers","type":"array"}},"required":["providers"],"title":"DiscoverableModelsResponse","type":"object"},"DiscoverableProvider":{"description":"One provider instance's discovery result.","properties":{"checked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When this instance was last dialed, ISO 8601. Null when it has not been checked yet, which is what the first read after a restart sees while the background refresh runs.","title":"Checked At"},"discovery_unsupported":{"default":false,"description":"True when discovery failed only because this backend serves no model-listing endpoint. The provider may still handle requests for models declared in config.","title":"Discovery Unsupported","type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why discovery failed. Null when `ok` is true.","title":"Error"},"models":{"items":{"$ref":"#/components/schemas/DiscoverableModel"},"title":"Models","type":"array"},"ok":{"description":"False when this instance could not be queried.","title":"Ok","type":"boolean"},"provider":{"title":"Provider","type":"string"}},"required":["provider","ok","models"],"title":"DiscoverableProvider","type":"object"},"DiscoverableModel":{"description":"A model one provider instance reports as available.","properties":{"id":{"description":"Bare model id as the provider reports it.","title":"Id","type":"string"},"key":{"description":"Selector to send as `model`, in `instance:model` form.","title":"Key","type":"string"}},"required":["id","key"],"title":"DiscoverableModel","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/models/discoverable":{"get":{"description":"List every model the configured provider credentials can reach.\n\nOperator-facing counterpart to GET /api/v1/models, which serves a curated catalog\nto API callers. This reports each provider separately and keeps its error, so\na provider with a bad key is distinguishable from one with no models. It is\noperator-gated because a provider error message describes the gateway's own\nconfiguration.\n\nCovers the configured provider instances and every hosted provider switched\non, whatever organization it is restricted to. A hosted provider that a\nconfigured instance of the same name shadows is not listed.\n\nAnswers from the discovery cache, which a background refresher keeps warm, so\nthe call does not wait on a slow or unreachable provider. Each provider\ncarries the ``checked_at`` its result was produced at; a null one has not been\ndialed yet. Pass ``refresh=true`` to force a live re-dial of every provider.","operationId":"models-list_discoverable_models","parameters":[{"description":"Re-dial every provider instead of answering from the discovery cache.","in":"query","name":"refresh","required":false,"schema":{"default":false,"description":"Re-dial every provider instead of answering from the discovery cache.","title":"Refresh","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverableModelsResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"List Discoverable Models","tags":["models"]}}}}
```

## List Model Metadata

> Per-model metadata for the dashboard's detail view, from models.dev.\
> \
> Covers every model models.dev lists under a configured provider, keyed by the\
> \`\`instance:model\`\` selector the dashboard uses. \`\`available\`\` is false when\
> enrichment is disabled (\`\`models\_dev\_metadata\`\`) or models.dev could not be\
> reached; the response is then empty and the UI falls back to bundled data.\
> Operator-gated: it describes the gateway's configured providers.\
> \
> Answers from the cached catalog, kept warm by a background refresher, so the\
> dashboard never waits on the models.dev fetch timeout.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"ModelMetadataResponse":{"description":"models.dev metadata keyed by ``provider:model``.","properties":{"available":{"description":"False when metadata could not be loaded (enrichment disabled or models.dev unreachable).","title":"Available","type":"boolean"},"models":{"additionalProperties":{"$ref":"#/components/schemas/ModelMetadata"},"title":"Models","type":"object"},"source":{"default":"models.dev","title":"Source","type":"string"}},"required":["available"],"title":"ModelMetadataResponse","type":"object"},"ModelMetadata":{"description":"models.dev metadata for one model, for the dashboard's detail view.","properties":{"attachment":{"default":false,"title":"Attachment","type":"boolean"},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"cost_input":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Input"},"cost_output":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Output"},"deprecated":{"default":false,"title":"Deprecated","type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"family":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family"},"input_modalities":{"items":{"type":"string"},"title":"Input Modalities","type":"array"},"knowledge_cutoff":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Cutoff"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Updated"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"open_weights":{"default":false,"title":"Open Weights","type":"boolean"},"output_modalities":{"items":{"type":"string"},"title":"Output Modalities","type":"array"},"reasoning":{"default":false,"title":"Reasoning","type":"boolean"},"release_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Release Date"},"structured_output":{"default":false,"title":"Structured Output","type":"boolean"},"temperature":{"default":false,"title":"Temperature","type":"boolean"},"tool_call":{"default":false,"title":"Tool Call","type":"boolean"}},"title":"ModelMetadata","type":"object"}}},"paths":{"/api/v1/models/metadata":{"get":{"description":"Per-model metadata for the dashboard's detail view, from models.dev.\n\nCovers every model models.dev lists under a configured provider, keyed by the\n``instance:model`` selector the dashboard uses. ``available`` is false when\nenrichment is disabled (``models_dev_metadata``) or models.dev could not be\nreached; the response is then empty and the UI falls back to bundled data.\nOperator-gated: it describes the gateway's configured providers.\n\nAnswers from the cached catalog, kept warm by a background refresher, so the\ndashboard never waits on the models.dev fetch timeout.","operationId":"models-list_model_metadata","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetadataResponse"}}},"description":"Successful Response"}},"summary":"List Model Metadata","tags":["models"]}}}}
```

## Get Model

> Get details for a specific model.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"ModelObject":{"description":"OpenAI-compatible model object.","properties":{"architecture":{"anyOf":[{"$ref":"#/components/schemas/ModelArchitecture"},{"type":"null"}]},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"created":{"title":"Created","type":"integer"},"deployment_managed":{"default":false,"title":"Deployment Managed","type":"boolean"},"id":{"title":"Id","type":"string"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"object":{"default":"model","title":"Object","type":"string"},"owned_by":{"title":"Owned By","type":"string"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingInfo"},{"type":"null"}]},"pricing_source":{"default":"none","title":"Pricing Source","type":"string"},"supported_parameters":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Parameters"}},"required":["id","created","owned_by"],"title":"ModelObject","type":"object"},"ModelArchitecture":{"description":"What a model reads and writes, in OpenRouter's ``architecture`` shape.","properties":{"input_modalities":{"items":{"type":"string"},"title":"Input Modalities","type":"array"},"output_modalities":{"items":{"type":"string"},"title":"Output Modalities","type":"array"}},"title":"ModelArchitecture","type":"object"},"ModelPricingInfo":{"description":"Pricing information for a model.","properties":{"cache_read_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Read Price Per Million"},"cache_write_price_per_million":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Write Price Per Million"},"input_price_per_million":{"title":"Input Price Per Million","type":"number"},"output_price_per_million":{"title":"Output Price Per Million","type":"number"},"pricing_tiers":{"items":{"anyOf":[{"$ref":"#/components/schemas/PricingTier"},{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"integer"}]},"type":"object"}]},"title":"Pricing Tiers","type":"array"},"unit":{"default":"tokens","title":"Unit","type":"string"}},"required":["input_price_per_million","output_price_per_million"],"title":"ModelPricingInfo","type":"object"},"PricingTier":{"description":"Whole-request price cliff selected by total billable input tokens.","properties":{"cache_read_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Cache Read Price Per Million"},"cache_write_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Cache Write Price Per Million"},"input_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Input Price Per Million"},"min_input_tokens":{"exclusiveMinimum":0,"title":"Min Input Tokens","type":"integer"},"output_price_per_million":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Output Price Per Million"}},"required":["min_input_tokens"],"title":"PricingTier","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/models/{model_id}":{"get":{"description":"Get details for a specific model.","operationId":"models-get_model","parameters":[{"in":"path","name":"model_id","required":true,"schema":{"title":"Model Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelObject"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Get Model","tags":["models"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/api-reference/models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
