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: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. OpenCodelimit.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’smax_output_tokens, so input + output stays within the model’s total context wall. For example GLM-5.2 advertisescontext_length: 850000andmax_output_tokens: 128000(≈ 1M total).max_output_tokens— the maximum completion tokens the model supports per response.
Pricing
pricing.prompt— the model’s per-token price for input (prompt) tokens, as a USD string. Multiply by theusage.prompt_tokenscount returned by/v1/chat/completionsto get the input cost for a request.pricing.completion— the model’s per-token price for output (completion) tokens, as a USD string. Multiply byusage.completion_tokensfor the output cost.
/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).