Skip to main content

GET /v1/models

Returns the list of models the authenticated key is allowed to use. Used by Cursor’s “Verify” button, Cline, and most clients at startup. Response shape:
Filtered automatically by key model restrictions.

Context metadata

  • context_length — the model’s maximum input context window in tokens (OpenRouter-style field). Use it to configure your client’s context window setting (e.g. OpenCode limit.context, Cline “Context Window Size”) so the client doesn’t fall back to a small default and compact conversations early. This is the safe input budget — it already accounts for the model’s max_output_tokens, so input + output stays within the model’s total context wall. For example GLM-5.2 advertises context_length: 850000 and max_output_tokens: 128000 (≈ 1M total).
  • max_output_tokens — the maximum completion tokens the model supports per response.
Either field may be absent for models where the value is not published.

Pricing

  • pricing.prompt — the model’s per-token price for input (prompt) tokens, as a USD string. Multiply by the usage.prompt_tokens count returned by /v1/chat/completions to get the input cost for a request.
  • pricing.completion — the model’s per-token price for output (completion) tokens, as a USD string. Multiply by usage.completion_tokens for the output cost.
These are the same per-token rates the billing system applies when a request falls outside your plan’s included quota (e.g. credit-balance usage), so analytics dashboards that pull token counts from chat completions and the advertised price from /v1/models can compute accurate cost-per-turn and usage graphs. Prices are expressed per-token (not per-million) as a string to match the OpenRouter shape; "0" indicates a free model or a model priced per-image instead of per-token (see architecture.modality for image models).