> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nano-gpt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> List available models. The default response is intentionally minimal for OpenAI compatibility; use `detailed=true` for capabilities, supported service tiers, pricing, and paused TEE entries marked with `available: false`. Exclude entries with `available: false` when choosing a model; active entries may omit the field.

> [!NOTE]
>
> These examples use the direct API host, `https://api.nano-gpt.com`. It has no IPv6 address, so clients with only IPv6 should use `https://nano-gpt.com` with the same paths. See [API Hosts](https://docs.nano-gpt.com/api-reference/miscellaneous/api-hosts.md).

## Overview

The `/api/v1/models` endpoint provides a list of available text generation models. Detailed responses also include capabilities, supported service tiers, pricing, and paused TEE entries with explicit availability metadata.

The default response deliberately stays close to OpenAI's minimal Models API shape. Enhanced fields such as `supported_service_tiers` are returned only when you add `?detailed=true`.

For non-text model catalogs, use the dedicated catalog endpoints:

* [Image models](https://docs.nano-gpt.com/api-reference/endpoint/image-models.md)
* [Video models](https://docs.nano-gpt.com/api-reference/endpoint/video-models.md)
* [Audio models](https://docs.nano-gpt.com/api-reference/endpoint/audio-models.md)
* [Embedding models](https://docs.nano-gpt.com/api-reference/endpoint/embedding-models.md)
* [Decision models](https://docs.nano-gpt.com/api-reference/endpoint/decisions.md#models): `GET /api/v1/decision-models`

Decision models answer typed questions through the [Decisions API](https://docs.nano-gpt.com/api-reference/endpoint/decisions.md) and reject plain chat requests, so the text model lists leave them out unless you ask for them with `output_modalities`.

For API-only distillation metadata and filtering, see [Distillation Policy](https://docs.nano-gpt.com/api-reference/miscellaneous/distillation-policy.md).

## Notable Model IDs (Examples)

Model availability changes frequently. Use `GET /api/v1/models` as the authoritative source of callable IDs.
Examples below include canonical IDs and public moving aliases; legacy compatibility aliases are intentionally omitted.

* **OpenAI**: `openai/gpt-6.1-sol`, `openai/gpt-6.2-sol`, `openai/gpt-6.2-astra`, `openai/gpt-latest`
* **Anthropic**: `anthropic/claude-opus-5.5`, `anthropic/claude-sonnet-5.5`, `anthropic/claude-fable-5.2`
* **Google Gemini**: `google/gemini-flash-latest`, `google/gemini-3.8-flash`, `google/gemini-3.1-pro-preview`
* **SpaceXAI Grok**: `x-ai/grok-4.7`, `x-ai/grok-latest`
* **Moonshot Kimi**: `moonshotai/kimi-k3.1-pro`, `moonshotai/kimi-k3`, `moonshotai/kimi-latest`
* **Z.AI GLM**: `z-ai/glm-5.3`, `z-ai/glm-5.3:thinking`, `z-ai/glm-5.3-flash`
* **Xiaomi MiMo**: `xiaomi/mimo-v2.6-pro`
* **DeepSeek**: `deepseek/deepseek-v4.1-flash-1017`, `deepseek/deepseek-v4-flash-latest`, `deepseek/deepseek-latest`
* **MiniMax**: `minimax/minimax-m3.1-flash`, `minimax/minimax-m3`, `minimax/minimax-latest`
* **Qwen**: `qwen/qwen4-max`, `qwen/qwen3.8-max`, `qwen/qwen3-coder-next`

### GPT 6.2 Astra and Sol

Choose `openai/gpt-6.2-astra` or `openai/gpt-6.2-sol` explicitly to use GPT-6.2.
Both support text and image input, function tools, structured output, and reasoning
levels `low`, `medium`, `high`, `xhigh`, and `max`. They are pay-as-you-go models
and are not included in subscriptions.

The `openai/gpt-6.2-astra-pro` and `openai/gpt-6.2-sol-pro` IDs enable Pro
reasoning mode on the corresponding base model. Per-token rates stay the same,
but additional model work can increase token usage, total cost, and latency.

NanoGPT supports Standard processing, function tools, and
[native web search](https://docs.nano-gpt.com/api-reference/endpoint/chat-completion.md#native-search) for
these models. Native search requires a supported OpenAI Responses route and can
be requested through Chat Completions or the [Responses API](https://docs.nano-gpt.com/api-reference/endpoint/responses.md#web-search-tool).
Other hosted tools, multi-agent requests, background mode, and zero data retention
are not currently supported. Check the [live catalog](https://api.nano-gpt.com/api/v1/models?detailed=true)
for current limits, prices, and supported Batch endpoints before switching an integration.

`openai/gpt-sol-latest` still resolves to `openai/gpt-6.1-sol`, and
`openai/gpt-astra-latest` still resolves to `openai/gpt-6-astra`. The general chat
default and this site's examples continue to use GPT-6.1 Sol.

### Qwen 4 Max

Qwen 4 Max is available as `qwen/qwen4-max` or `qwen/qwen4-max:thinking`.
Both are pay-as-you-go only and are not included in subscriptions. Check the
[live model catalog](https://api.nano-gpt.com/api/v1/models?detailed=true) for current pricing, capabilities and limits.

### Claude Fable Latest

`anthropic/claude-fable-latest` currently resolves to `anthropic/claude-fable-5.2`.
Choose a version-specific ID, such as `anthropic/claude-fable-5.1` or
`anthropic/claude-fable-5.2`, to keep your model selection fixed when the alias moves.

### GPT Terra Latest

`openai/gpt-terra-latest` follows GPT-6.1 Terra. It supports text and image input,
tools, structured output, a 1,050,000-token context window, and up to 128,000 output
tokens. Reasoning levels are `none`, `low`, `medium`, `high`, `xhigh`, and `max`;
NanoGPT defaults to `medium`. Batch requests with tools must use `/v1/responses`;
Chat Completions batches do not support tools for this model.

Standard pricing is $1/M input, $5/M output, $0.05/M cached input, and $1.25/M
cache writes. Requests above 272,000 input tokens use higher long-context rates.
It is a paid model; use the [live model pricing and privacy metadata](https://api.nano-gpt.com/api/models/openai%2Fgpt-6.1-terra/providers)
for the current route details.

For Pro reasoning mode, choose `openai/gpt-6.1-terra-pro` explicitly. It uses the
same base model and per-token rates, but performs more model work, increasing token
usage, cost, and latency. The Latest alias continues to select standard Terra by default.
Choose `openai/gpt-5.6-terra` or `openai/gpt-5.6-terra-pro` explicitly to retain
those models and their behavior.
The general chat default and the examples on this site remain GPT-6.1 Sol.

### DeepSeek Flash Latest

`deepseek/deepseek-v4-flash-latest` follows the current recommended Flash snapshot,
DeepSeek V4.1 Flash 1017. Append `:thinking` to enable reasoning by default; the
base alias defaults to non-thinking. Both remain included in subscriptions.

The current snapshot accepts text and images, with a shared 1,048,576-token context
window and up to 393,216 output tokens within the remaining context. JSON object
output is supported, and JSON Schema output is available on eligible routes. Zero
data retention is also available on eligible routes. Output limits and supported reasoning
levels depend on the selected route, so the model-wide maximum is not available
on every provider.

Auto prices follow the current eligible routes and can differ from the snapshot's
peak/off-peak schedule. Read `pricing` and `effective_pricing` in
`/api/v1/models?detailed=true` for the current Auto tariff, or the model's
[provider pricing](https://api.nano-gpt.com/api/models/deepseek%2Fdeepseek-v4-flash-latest/providers)
for Auto prices by privacy mode and provider-specific prices. Selecting a provider
can change the price, including any applicable schedule and provider-selection markup.
For a fixed checkpoint and the older price/capability contract, select
`deepseek/deepseek-v4-flash-0731` explicitly instead of the moving alias.

### Kimi Latest and K3.1 Pro

`moonshotai/kimi-latest` follows the newest recommended Kimi model, currently
`moonshotai/kimi-k3.1-pro`. The faster, more expensive
`moonshotai/kimi-k3.1-pro-highspeed` remains a separate selection. Choose
`moonshotai/kimi-k3` explicitly to retain the K3 checkpoint and its pricing.

K3.1 Pro supports text, image and video input, tool calling, structured output,
and a shared 1,048,576-token context window. Output limits depend on the route
and remaining context. Thinking is always enabled with `low`, `high`, or `max`
effort; NanoGPT defaults to `max`. Hiding reasoning does not disable thinking or
its token usage. Start a new conversation when switching from K3 to K3.1 Pro.

K3.1 Pro and Kimi Latest currently cost $1.40 per million input tokens, $7 per
million output tokens, and $0.14 per million cached-input tokens in Auto. Cache
writes cost $1.40/M for five minutes or \$2.80/M for one hour. Explicit provider
selection can change these rates. K3 Auto prices also vary by route; check current
pricing before switching. K3.1 Pro does not support the Batch API
and is excluded from subscriber discounts. It does not inherit K3-specific
discounts, and neither model is included in subscriptions. Keep explicit K3
for integrations that need its batch support. Availability, privacy options and route limits can differ;
check `/api/v1/models?detailed=true` and the
[provider endpoint](https://api.nano-gpt.com/api/models/moonshotai%2Fkimi-latest/providers)
on your chosen API host for current information.

### MiniMax Latest and M3.1 Flash

`minimax/minimax-latest` currently resolves to MiniMax M3 Thinking. This
compatibility alias retains M3's request format and structured-output support;
it does not automatically select MiniMax M3.1 Flash. Plain `minimax/minimax-m3`
only thinks when a request [asks for it](https://docs.nano-gpt.com/api-reference/miscellaneous/extended-thinking.md#turn-reasoning-on).
Reasoning isn't guaranteed on MiniMax M3 Thinking. When MiniMax is the provider, such as with
`provider: { "only": ["minimax"] }`, M3's thinking is adaptive, so the model can answer
without any, and MiniMax has no setting to force it.

For the newer model, select `minimax/minimax-m3.1-flash` explicitly. It is included
in subscriptions and supports text, image, and video input, tool calling, a
shared 1,000,000-token context window, and up to 524,288 output tokens within the
remaining context. Thinking is always enabled; `reasoning_effort` accepts `low`,
`medium`, `high`, `xhigh`, and `max`, with `max` as the default. Reasoning tokens
count toward the output limit. Hiding reasoning with `reasoning.exclude` does
not disable thinking or its token usage.

M3.1 Flash uses a fixed `temperature` of `1` and `top_p` of `0.95`. Custom
values have no effect; omit these parameters from requests.

M3.1 Flash currently does not support `response_format` JSON modes, forced
`tool_choice`, or disabling thinking. Keep an explicit M3 model for integrations
that need these controls. Use the detailed model catalog for current prices and
the [provider endpoint](https://api.nano-gpt.com/api/models/minimax%2Fminimax-m3.1-flash/providers)
for route-specific limits and privacy information.

## Compatibility

Responses mirror OpenAI's Models API shape. All models endpoints return:

```json theme={null}
{
  "object": "list",
  "data": [ { /* model */ }, ... ]
}
```

Each model minimally includes:

```json theme={null}
{
  "id": "openai/gpt-6.1-sol",
  "object": "model",
  "created": 1736966400,
  "owned_by": "openai"
}
```

## Features

* **Basic Mode**: Standard OpenAI-compatible model listing. Capability and service-tier metadata is omitted.
* **Detailed Mode**: Enhanced information with capabilities, supported service tiers, pricing, model descriptions, and paused TEE entries marked unavailable.

## Provider Selection Discovery

Provider selection support, public provider IDs, and provider-specific prices are discovered via `GET /api/models/:canonicalId/providers`. Its `Per1kTokens` fields are USD per 1,000 tokens and include selection markup; `provider.max_price` uses USD per 1 million tokens. See [Provider Selection](https://docs.nano-gpt.com/api-reference/miscellaneous/provider-selection.md#discover-providers-and-pricing) for details.

## Query Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `detailed` | boolean | `false` | Returns detailed model information including capabilities, supported service tiers, and pricing |
| `sort` | string | none | Values: `favorites`, `mostused`. Reorders the returned model list. Sorting only affects models that would already be visible to the caller. It does not add or hide models. |
| `output_modalities` | string | none | `decisions` lists only decision models; `text,decisions` lists chat models and decision models together. Without it, decision models are left out. Also accepted by the subscription, paid and personalized lists. |

When `detailed=true`, additional fields may be included per model:

* `name` — display name
* `description` — short model description
* `context_length` — total context window shared by input and generated output (if known)
* `max_output_tokens` — max output tokens (if known)
* `capabilities` — feature flags (see below)
* `supported_service_tiers` — alternate `service_tier` values accepted by the model (`flex`, `fast`, and/or the legacy `priority` alias); an empty array means only the default tier is available
* `pricing.prompt` and `pricing.completion` — current per-million-token prices in USD
* `pricing.cacheReadInputPer1kTokens`, `pricing.cacheWriteInputPer1kTokens` and `pricing.cacheWriteInputPer1kTokens1h` — cache read, 5-minute cache write and 1-hour cache write prices in USD per 1,000 tokens, when the model has them (see [Pricing Object Structure](#pricing-object-structure))
* `pricing.firstContextThresholdTokens`, `pricing.highContextThresholdTokens` and the prices above them — for models whose prices rise with prompt length (see [Long-Context Pricing](#long-context-pricing))
* `pricing.unit` — `per_million_tokens`, the unit of `prompt` and `completion`
* `icon_url` — small icon representing the provider
* `cost_estimate` — internal rollup used in UI for cost hints (for example `"$"`, `"$$"`, or an object)
* `category` — optional category tag (for example `"Uncensored"`)
* `distillationPolicy` — optional policy metadata indicating whether model outputs may be used for distillation or output-based training under NanoGPT's recorded model-license rules

### Choosing callable models

The ordinary `GET /api/v1/models` list omits TEE models paused for enclave
verification. With `?detailed=true`, those entries remain visible for inspection:

```json theme={null}
{
  "id": "TEE/glm-5.1",
  "available": false,
  "status": "paused",
  "unavailable_reason": "tee_verification",
  "providers": []
}
```

This is an excerpt of a paused entry, not an available model recommendation.
Exclude entries whose `available` field is `false` before choosing a model:

```bash theme={null}
curl -s "https://api.nano-gpt.com/api/v1/models?detailed=true" \
  | jq '.data[] | select(.available != false) | .id'
```

These fields are optional. Do not require `available: true`: ordinary active
entries can omit the field. Availability can change after discovery. Requests
blocked by the TEE verification check return `503` with code
`tee_verification_unavailable`; choose another available TEE model. See
[TEE Verification](https://docs.nano-gpt.com/api-reference/tee-verification.md#model-availability).

### Discovering service-tier support

Service-tier availability is model-specific. To discover it programmatically, request the detailed model list and inspect each model's `supported_service_tiers` array:

```bash theme={null}
curl -s "https://api.nano-gpt.com/api/v1/models?detailed=true" \
  | jq '.data[] | select(.available != false) | select(.supported_service_tiers | length > 0) | {id, supported_service_tiers}'
```

For example:

```json theme={null}
{
  "id": "openai/gpt-6.1-sol",
  "supported_service_tiers": ["flex", "fast", "priority"]
}
```

* `flex` requests lower-cost, variable-capacity processing.
* `fast` is the preferred public spelling for higher-priority OpenAI processing.
* `priority` remains accepted as a legacy alias and may still be the provider-native name on compatible non-OpenAI routes.
* An empty array means the model supports only the default service tier.

The basic `GET /api/v1/models` response intentionally omits this field for OpenAI compatibility. The [Models page](https://nano-gpt.com/models) also displays service-tier badges for visual discovery. Provider-specific availability can differ when you explicitly force a route; see [Provider Selection](https://docs.nano-gpt.com/api-reference/miscellaneous/provider-selection.md).

### Discovering video-capable models

For multimodal input, call `GET /api/v1/models?detailed=true`, exclude entries with `available: false`, and select a model whose catalog entry advertises video input. Catalog fields are additive, so inspect both the architecture modalities and capability flags when present:

```json theme={null}
{
  "id": "google/gemini-3.1-flash-lite",
  "architecture": { "input_modalities": ["text", "image", "video"] },
  "capabilities": { "video_input": true }
}
```

An explicitly selected model without video capability is rejected before provider dispatch and billing. Automatic fallback keeps only routes that preserve the requested video input. See [Video Input](https://docs.nano-gpt.com/api-reference/miscellaneous/video-input.md) for the endpoint content shapes and source rules.

### Sorting model lists

`GET /api/v1/models` supports `sort=favorites` and `sort=mostused`.

When `sort` is present, NanoGPT returns the same model list the caller would normally receive, but reordered by the selected ranking. Sorting only affects models that would already be visible to the caller. It does not add or hide models.

* `sort=favorites`: Orders models by the authenticated account's recent model usage.
* `sort=mostused`: Orders models by global completed model usage.
* Unused or unranked models remain in the response after ranked models, in the normal catalog order.
* `sort=favorites` requires a valid API key to personalize the order. If no valid API key is provided, it falls back to normal ordering.
* `sort=mostused` does not require authentication.
* Invalid `sort` values are ignored.
* Can be combined with `detailed=true`.

Examples:

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/v1/models?sort=favorites"
```

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?sort=mostused"
```

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/v1/models?detailed=true&sort=favorites"
```

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?detailed=true&sort=mostused"
```

### `capabilities` (detailed mode)

Common capability flags:

| Field | Type | Description |
| - | - | - |
| `vision` | boolean | Supports image inputs |
| `reasoning` | boolean | Supports extended thinking/reasoning |
| `tool_calling` | boolean | Supports function/tool calling |
| `parallel_tool_calls` | boolean | Supports multiple tool calls in parallel |
| `structured_output` | boolean | Supports structured/JSON output modes |
| `pdf_upload` | boolean | Supports PDF/document inputs |
| `video_input` | boolean | Supports video inputs for text or multimodal understanding |

## Authentication

Authentication is optional but enables user-specific pricing in detailed mode:

| Header | Format | Required | Description |
| - | - | - | - |
| `Authorization` | `Bearer {api_key}` | Optional | API key for user-specific pricing |
| `x-api-key` | `{api_key}` | Optional | Alternative API key header |

Notes:

* Invalid or missing API keys still return a list of models. We simply omit user-specific pricing considerations in `detailed=true` mode.
* With a valid key, the canonical `/api/v1/models` may apply your account’s subscription visibility preference (see Endpoint Variants).

## Response Formats

### Basic Response (Default)

Standard OpenAI-compatible format without pricing information:

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "openai/gpt-6.1-sol",
      "object": "model",
      "created": 1790640000,
      "owned_by": "openai"
    },
    {
      "id": "anthropic/claude-opus-5.5",
      "object": "model", 
      "created": 1790035200,
      "owned_by": "anthropic"
    }
  ]
}
```

### Detailed Response

Enhanced format with model descriptions, context lengths, and pricing:

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "openai/gpt-6.1-sol",
      "object": "model",
      "created": 1790640000,
      "owned_by": "openai",
      "name": "GPT 6.1 Sol",
      "description": "GPT-6.1 Sol delivers near-Astra performance at a lower cost for complex coding, computer use, and professional work. It supports text and image input, tool calling, structured outputs, and reasoning from low through max.",
      "context_length": 1050000,
      "max_output_tokens": 128000,
      "supported_service_tiers": [
        "flex",
        "fast",
        "priority"
      ],
      "capabilities": {
        "vision": true,
        "video_input": false,
        "audio_input": false,
        "reasoning": true,
        "tool_calling": true,
        "parallel_tool_calls": false,
        "structured_output": true,
        "pdf_upload": true,
        "batch_api": true
      },
      "pricing": {
        "prompt": 2,
        "completion": 10,
        "cacheReadInputPer1kTokens": 0.0001,
        "cacheWriteInputPer1kTokens": 0.0025,
        "currency": "USD",
        "unit": "per_million_tokens"
      }
    },
    {
      "id": "anthropic/claude-opus-5.5",
      "object": "model",
      "created": 1790035200,
      "owned_by": "anthropic",
      "name": "Claude Opus 5.5",
      "description": "Claude Opus 5.5 is Anthropic's flagship model for agentic coding, computer use, complex knowledge work, and long-running tasks, with improved efficiency and more natural communication.",
      "context_length": 1000000,
      "max_output_tokens": 128000,
      "supported_service_tiers": [],
      "capabilities": {
        "vision": true,
        "video_input": false,
        "audio_input": false,
        "reasoning": true,
        "tool_calling": true,
        "parallel_tool_calls": false,
        "structured_output": true,
        "pdf_upload": true,
        "batch_api": true
      },
      "pricing": {
        "prompt": 4,
        "completion": 20,
        "cacheReadInputPer1kTokens": 0.0002,
        "cacheWriteInputPer1kTokens": 0.005,
        "cacheWriteInputPer1kTokens1h": 0.008,
        "currency": "USD",
        "unit": "per_million_tokens"
      }
    }
  ]
}
```

## Field Descriptions

### Basic Fields (Always Present)

| Field | Type | Description |
| - | - | - |
| `id` | string | Unique model identifier |
| `object` | string | Always "model" for OpenAI compatibility |
| `created` | number | Unix timestamp of response creation |
| `owned_by` | string | Model provider (openai, anthropic, meta, google, etc.) |

### Enhanced Fields (Detailed Mode Only)

| Field | Type | Description |
| - | - | - |
| `available` | boolean | Optional. `false` when a retained TEE entry is paused; active entries may omit this field. |
| `status` | string | Optional. `paused` for a retained TEE entry that cannot currently serve requests. |
| `unavailable_reason` | string | Optional. `tee_verification` when enclave verification prevents availability. |
| `providers` | string\[] | Optional public provider IDs. Empty for a paused TEE entry. Use the provider endpoint for route details. |
| `name` | string | Human-readable model name |
| `description` | string | Detailed model description |
| `context_length` | number or null | Total context window shared by input and generated output (null if not available) |
| `max_output_tokens` | number | Maximum output tokens (null if not available) |
| `capabilities` | object | Feature flags (e.g., `vision: boolean`) |
| `supported_service_tiers` | string\[] | Alternate service tiers accepted by the model. An empty array means only the default tier is available. |
| `pricing` | object | Pricing information object |
| `icon_url` | string | Path/URL for a small provider icon |
| `cost_estimate` | string or object | Internal hints (for example `"$"` / `"$$"` or `{ cheap: true }`) |
| `category` | string | Optional category (e.g., `"Uncensored"`) |
| `distillationPolicy` | object | Optional API-only distillation metadata. See [Distillation Policy](https://docs.nano-gpt.com/api-reference/miscellaneous/distillation-policy.md). |

### Pricing Object Structure

| Field | Type | Description |
| - | - | - |
| `prompt` | number | Cost per million input tokens in USD |
| `completion` | number | Cost per million output tokens in USD |
| `cacheReadInputPer1kTokens` | number | Optional. Cost per 1,000 cached input tokens read, in USD |
| `cacheWriteInputPer1kTokens` | number | Optional. Cost per 1,000 input tokens written to the prompt cache with the default 5-minute lifetime, in USD |
| `cacheWriteInputPer1kTokens1h` | number | Optional. Cost per 1,000 input tokens written to the prompt cache with a 1-hour lifetime (`ttl: "1h"`, see [Prompt Caching](https://docs.nano-gpt.com/api-reference/miscellaneous/prompt-caching.md)), in USD |
| `currency` | string | Always "USD" |
| `unit` | string | Always "per\_million\_tokens". Applies to `prompt` and `completion` only |

Fields ending in `Per1kTokens` are USD per 1,000 tokens. Multiply them by 1,000 for the per-million price shown on the [pricing page](https://nano-gpt.com/api-pricing): Claude Opus 5.5's `cacheWriteInputPer1kTokens1h` of `0.008` is \$8.00 per million tokens. Cache prices are left out for models with no cache pricing. These are base-context prices; models whose prices rise with prompt length also list [long-context tiers](#long-context-pricing).

### Request-Priced Tools

Two Kagi tools in the text catalog are not billed by input and output tokens. Their `pricing.note` says how they are billed. The prices in the extra fields below are USD per request. A request that Kagi answers from its cache is free.

| Field | Type | Description |
| - | - | - |
| `note` | string | Optional. `per_request` for a flat price per request, `capped_input` for input tokens billed up to a cap |
| `request` | number | With `per_request`: USD per uncached request. `fastgpt` costs `0.015` |
| `cached_request` | number | USD for a request answered from the cache. Always `0` |
| `max_billable_prompt_tokens` | number | With `capped_input`: input tokens beyond this are not billed. `universal-summarizer` bills `prompt` ($30 per million) on at most 10,000 tokens, so at most $0.30 per uncached request with the default engine |
| `muriel_request` | number | With `capped_input`: USD per uncached request with the Muriel engine, instead of the token price. `universal-summarizer` costs `1` |

For these tools `completion` is `0` (or absent) and `unit` still describes only `prompt` and `completion`.

### Long-Context Pricing

Some models charge more once a prompt passes a threshold. A request whose prompt is longer than the threshold is billed entirely at that tier's prices: every input, cached and output token, not only the tokens past the threshold. Prompt length counts all input tokens, cached ones included. A model lists up to two tiers, and each tier lists every price that applies in it, including any that equal the base price.

| Field | Type | Description |
| - | - | - |
| `firstContextThresholdTokens` | number | Optional. Prompts longer than this many tokens are billed at the `AboveFirstThreshold` prices |
| `inputPer1kTokensAboveFirstThreshold`, `outputPer1kTokensAboveFirstThreshold` | number | Input and output prices above the first threshold, in USD per 1,000 tokens |
| `cacheReadInputPer1kTokensAboveFirstThreshold`, `cacheWriteInputPer1kTokensAboveFirstThreshold`, `cacheWriteInputPer1kTokens1hAboveFirstThreshold` | number | Cache read, 5-minute cache write and 1-hour cache write prices above the first threshold, in USD per 1,000 tokens, when the model has those cache prices |
| `highContextThresholdTokens` | number | Optional. Prompts longer than this many tokens are billed at the `Above200k` prices. Despite the field names, the threshold is not always 200,000 |
| `highContextThresholdCountsOutputTokens` | boolean | Optional. `true` when input plus output tokens count toward `highContextThresholdTokens`. No current model sets it: Grok 4.3 and Grok Build count the prompt alone, like every other model |
| `inputPer1kTokensAbove200k`, `outputPer1kTokensAbove200k` | number | Input and output prices above the high threshold, in USD per 1,000 tokens |
| `cacheReadInputPer1kTokensAbove200k`, `cacheWriteInputPer1kTokensAbove200k`, `cacheWriteInputPer1kTokens1hAbove200k` | number | Cache read, 5-minute cache write and 1-hour cache write prices above the high threshold, in USD per 1,000 tokens, when the model has those cache prices |

Claude Haiku 5.5, for example, costs more once a prompt passes 100,000 tokens. A 1-hour cache write costs `0.0002` ($0.20 per million tokens) up to that point and `0.001` ($1.00 per million tokens) beyond it:

```json theme={null}
"pricing": {
  "prompt": 0.1,
  "completion": 0.5,
  "cacheReadInputPer1kTokens": 0.00001,
  "cacheWriteInputPer1kTokens": 0.000125,
  "cacheWriteInputPer1kTokens1h": 0.0002,
  "firstContextThresholdTokens": 100000,
  "inputPer1kTokensAboveFirstThreshold": 0.0005,
  "outputPer1kTokensAboveFirstThreshold": 0.0025,
  "cacheReadInputPer1kTokensAboveFirstThreshold": 0.00005,
  "cacheWriteInputPer1kTokensAboveFirstThreshold": 0.000625,
  "cacheWriteInputPer1kTokens1hAboveFirstThreshold": 0.001,
  "currency": "USD",
  "unit": "per_million_tokens"
}
```

### Distillation Policy

Where available, text model records include a `distillationPolicy` object with `status`, `label`, `basis`, `sourceUrl`, and `note`. This indicates whether model outputs may be used for model training, fine-tuning, distillation, or similar model-improvement workflows under NanoGPT's recorded interpretation of model licenses and provider terms.

```json theme={null}
{
  "distillationPolicy": {
    "status": "allowed",
    "label": "License permits distillation",
    "basis": "permissive-open-weights",
    "sourceUrl": "https://example.com/license-or-terms",
    "note": "Short explanation of the policy signal."
  }
}
```

Use the explore endpoints when you need to filter for distillation-allowed text models:

```http theme={null}
GET /api/explore/text-models?distillation=allowed
```

```http theme={null}
GET /api/explore/search?type=text&q=qwen&distillation=allowed
```

The filter applies only to text models. Responses include `meta.distillation: "allowed"` when the filter is used and `meta.distillation: "all"` otherwise.

Provider route policy can differ from model-level policy. Use `GET /api/models/:canonicalId/providers` and inspect each provider row's `distillationPolicy` before relying on a specific route for distillation.

This metadata is informational and is not legal advice. Provider terms and model licenses can change, and licenses may impose attribution, naming, acceptable-use, or derivative-model restrictions even when distillation is allowed.

## Usage Examples

### Basic Request

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models"
```

### Detailed Request

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?detailed=true"
```

### Sort by Favorites

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/v1/models?sort=favorites"
```

### Sort by Most Used

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?sort=mostused"
```

### Detailed and Sorted

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/v1/models?detailed=true&sort=favorites"
```

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?detailed=true&sort=mostused"
```

### Detailed with Authentication

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?detailed=true" \
  -H "Authorization: Bearer your_api_key_here"
```

### Alternative API Key Header

```bash theme={null}
curl "https://api.nano-gpt.com/api/v1/models?detailed=true" \
  -H "x-api-key: your_api_key_here"
```

## Endpoint Variants

In addition to the canonical `/api/v1/models`, two filtered variants are available:

### 1) GET /api/v1/models (canonical)

* Returns all visible text models (excludes internal free/helper selector models except `auto-model*`).
* If your account has an active subscription and you have not enabled “Also show paid models”, the list is automatically restricted to only subscription-included models.
* If you enable “Also show paid models” in settings, it returns the full set again.

Examples:

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  https://api.nano-gpt.com/api/v1/models
```

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/v1/models?detailed=true"
```

### 2) GET /api/subscription/v1/models (subscription-only)

* Always returns only models included in the NanoGPT subscription (equivalent to our `isTextEligible(modelId)` filter).
* Ignores the user’s “Also show paid models” preference; it is always subscription-only.
* Supports `?detailed=true` and API key–aware pricing metadata.

Examples:

```bash theme={null}
curl https://api.nano-gpt.com/api/subscription/v1/models
```

```bash theme={null}
curl -H "x-api-key: $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/subscription/v1/models?detailed=true"
```

### 3) GET /api/paid/v1/models (paid/extras)

* Returns only models that are NOT part of the subscription (paid/premium/extras).
* Supports `?detailed=true` and API key–aware pricing metadata.

Examples:

```bash theme={null}
curl https://api.nano-gpt.com/api/paid/v1/models
```

```bash theme={null}
curl -H "Authorization: Bearer $NANOGPT_API_KEY" \
  "https://api.nano-gpt.com/api/paid/v1/models?detailed=true"
```

### Choosing the Right Endpoint

* Use `/api/subscription/v1/models` for curated lists guaranteed to be subscription-included (e.g., sub-only integrations).
* Use `/api/paid/v1/models` to focus on paid or premium models.
* Use `/api/v1/models` for the canonical list and let the account’s “Also show paid models” preference decide visibility.

## Errors and Limits

* These endpoints typically return `200` with a list. If an invalid API key is provided, the list still returns and simply omits user-specific pricing considerations in `detailed=true` mode.
* Standard CORS and rate limiting apply. In overload scenarios you may receive `429` with:

```json theme={null}
{ "code": "rate_limited", "message": "Rate limit exceeded" }
```

## Backwards Compatibility

* Default response format unchanged
* All existing fields preserved
* New fields are additive only
* No breaking changes to existing integrations

## Related Endpoints

* [Image models](https://docs.nano-gpt.com/api-reference/endpoint/image-models.md) - List image model capabilities and supported parameters
* [Video models](https://docs.nano-gpt.com/api-reference/endpoint/video-models.md) - List video model capabilities and supported parameters
* [Audio models](https://docs.nano-gpt.com/api-reference/endpoint/audio-models.md) - List text-to-speech and speech-to-text models
* [Embedding models](https://docs.nano-gpt.com/api-reference/endpoint/embedding-models.md) - List embedding model dimensions, token limits, and pricing
* [/api/v1/embeddings](https://docs.nano-gpt.com/api-reference/endpoint/embeddings.md) - Create embeddings using the available embedding models
* [Provider Selection](https://docs.nano-gpt.com/api-reference/miscellaneous/provider-selection.md) - Discover model providers and set provider preferences
* `/api/subscription/v1/models` - Subscription-included text models
* `/api/paid/v1/models` - Paid or premium text models

## Notes

* Scope: These endpoints list text-chat models. For image, video, audio, embedding and decision catalogs, use the dedicated model catalog pages linked above.
* Fields are subject to change as new capabilities or providers are added. We aim to remain OpenAI-API compatible for basic consumers (`id`/`object`/`created`/`owned_by`).


## OpenAPI

````yaml GET /v1/models
openapi: 3.1.0
info:
  title: NanoGPT API
  description: >-
    API documentation for the NanoGPT language, image, video, speech-to-text,
    and text-to-speech generation services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.nano-gpt.com/api
    description: Direct API host
  - url: https://nano-gpt.com/api
    description: Website host, for IPv6-only clients and the routes that name it
security: []
paths:
  /v1/models:
    get:
      description: >-
        List available models. The default response is intentionally minimal for
        OpenAI compatibility; use `detailed=true` for capabilities, supported
        service tiers, pricing, and paused TEE entries marked with `available:
        false`. Exclude entries with `available: false` when choosing a model;
        active entries may omit the field.
      parameters:
        - name: detailed
          in: query
          description: >-
            Returns detailed model information including capabilities,
            `supported_service_tiers`, and pricing. Inspect
            `supported_service_tiers` to discover whether a model accepts
            `flex`, `fast`, or the legacy `priority` alias; an empty array means
            only the default tier is available. Detailed mode also retains
            paused TEE entries with available=false, status=paused,
            unavailable_reason=tee_verification and providers=[]. Exclude them
            when selecting a model.
          required: false
          schema:
            type: boolean
            default: false
        - name: sort
          in: query
          description: >-
            Reorders the returned model list without adding or hiding models.
            `favorites` orders by the authenticated account's recent model usage
            and requires a valid API key; without one it falls back to normal
            ordering. `mostused` orders by global completed model usage and does
            not require authentication. Unused or unranked models remain after
            ranked models in normal catalog order. Invalid values are ignored.
          required: false
          schema:
            type: string
            enum:
              - favorites
              - mostused
            example: favorites
        - name: output_modalities
          in: query
          description: >-
            Decision models are left out of this list by default because they
            reject plain chat requests. `decisions` lists only decision models;
            `text,decisions` lists chat models and decision models together.
          required: false
          schema:
            type: string
            example: decisions
      responses:
        '200':
          description: >-
            Model list; detailed mode also includes paused TEE entries marked
            unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    ModelsResponse:
      type: object
      properties:
        object:
          type: string
          description: Type of object, always 'list' for the models response
          default: list
        data:
          type: array
          description: >-
            Model list. Detailed mode retains paused TEE entries marked
            unavailable; basic mode omits them.
          items:
            type: object
            example:
              id: openai/gpt-6.1-sol
              object: model
              created: 1790640000
              owned_by: openai
              name: GPT 6.1 Sol
              description: >-
                GPT-6.1 Sol supports complex coding and professional work with
                text and image input.
              context_length: 1050000
              max_output_tokens: 128000
              pricing:
                prompt: 2
                completion: 10
                currency: USD
                unit: per_million_tokens
            properties:
              id:
                type: string
                description: Unique identifier for the model
                example: openai/gpt-6.1-sol
              object:
                type: string
                description: Type of object, always 'model'
                default: model
              created:
                type: integer
                description: Unix timestamp when the model was created
              owned_by:
                type: string
                description: Organization that owns the model
                example: openai
              available:
                type: boolean
                description: >-
                  Optional detailed-mode availability flag. False for a retained
                  paused TEE entry. Active entries may omit the field; do not
                  require true when selecting models.
                example: false
              status:
                type: string
                description: >-
                  Optional detailed-mode availability status. Paused TEE entries
                  use paused.
                example: paused
              unavailable_reason:
                type: string
                description: >-
                  Optional detailed-mode reason for unavailability.
                  tee_verification means enclave verification prevents the model
                  from serving requests.
                example: tee_verification
              providers:
                type: array
                description: >-
                  Optional public provider IDs in detailed mode. Paused TEE
                  entries return an empty array. Use GET
                  /api/models/:canonicalId/providers for route details.
                items:
                  type: string
              name:
                type: string
                description: Human-readable model name (detailed mode only)
                example: GPT 6.1 Sol
              description:
                type: string
                description: Detailed model description (detailed mode only)
                example: >-
                  GPT-6.1 Sol supports complex coding and professional work with
                  text and image input.
              context_length:
                type:
                  - integer
                  - 'null'
                description: >-
                  Total context window shared by input and generated output
                  (detailed mode only, null if not available)
                example: 1050000
              max_output_tokens:
                type:
                  - integer
                  - 'null'
                description: >-
                  Maximum generated output tokens (detailed mode only, null if
                  no serving-route limit is known)
                example: 128000
              capabilities:
                type: object
                description: >-
                  Model capability flags such as vision, reasoning, tool
                  calling, structured output, PDF upload, video input, and Batch
                  API support (detailed mode only)
                additionalProperties:
                  type: boolean
              supported_service_tiers:
                type: array
                description: >-
                  Alternate service tiers accepted by the model (detailed mode
                  only). Fast is the preferred public spelling for
                  higher-priority OpenAI processing; priority remains accepted
                  as a legacy alias. An empty array means only the default
                  service tier is available.
                items:
                  type: string
                  enum:
                    - flex
                    - fast
                    - priority
                uniqueItems: true
                example:
                  - flex
                  - fast
                  - priority
              pricing:
                type: object
                description: Pricing information object (detailed mode only)
                properties:
                  prompt:
                    type: number
                    description: Cost per million input tokens in USD
                    example: 2
                  completion:
                    type: number
                    description: Cost per million output tokens in USD
                    example: 10
                  cacheReadInputPer1kTokens:
                    type: number
                    description: >-
                      Cost per 1,000 cached input tokens read, in USD. Omitted
                      when the model has no cache-read price
                    example: 0.0001
                  cacheWriteInputPer1kTokens:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with the default 5-minute lifetime, in USD. Omitted when
                      the model has no cache-write price
                    example: 0.0025
                  cacheWriteInputPer1kTokens1h:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with a 1-hour lifetime, in USD. Omitted when the model has
                      no 1-hour cache-write price
                    example: 0.004
                  firstContextThresholdTokens:
                    type: number
                    description: >-
                      Prompts longer than this many tokens (cached ones
                      included) are billed entirely at the AboveFirstThreshold
                      prices. Omitted when the model has no first tier
                    example: 100000
                  inputPer1kTokensAboveFirstThreshold:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens above the first threshold, in
                      USD
                  outputPer1kTokensAboveFirstThreshold:
                    type: number
                    description: >-
                      Cost per 1,000 output tokens above the first threshold, in
                      USD
                  cacheReadInputPer1kTokensAboveFirstThreshold:
                    type: number
                    description: >-
                      Cost per 1,000 cached input tokens read above the first
                      threshold, in USD
                  cacheWriteInputPer1kTokensAboveFirstThreshold:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with the default 5-minute lifetime above the first
                      threshold, in USD
                  cacheWriteInputPer1kTokens1hAboveFirstThreshold:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with a 1-hour lifetime above the first threshold, in USD
                  highContextThresholdTokens:
                    type: number
                    description: >-
                      Prompts longer than this many tokens (cached ones
                      included) are billed entirely at the Above200k prices; the
                      threshold is not always 200,000. Omitted when the model
                      has no high tier
                    example: 200000
                  highContextThresholdCountsOutputTokens:
                    type: boolean
                    description: >-
                      True when input plus output tokens count toward
                      highContextThresholdTokens
                  inputPer1kTokensAbove200k:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens above the high threshold, in
                      USD
                  outputPer1kTokensAbove200k:
                    type: number
                    description: >-
                      Cost per 1,000 output tokens above the high threshold, in
                      USD
                  cacheReadInputPer1kTokensAbove200k:
                    type: number
                    description: >-
                      Cost per 1,000 cached input tokens read above the high
                      threshold, in USD
                  cacheWriteInputPer1kTokensAbove200k:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with the default 5-minute lifetime above the high
                      threshold, in USD
                  cacheWriteInputPer1kTokens1hAbove200k:
                    type: number
                    description: >-
                      Cost per 1,000 input tokens written to the prompt cache
                      with a 1-hour lifetime above the high threshold, in USD
                  currency:
                    type: string
                    description: Always 'USD'
                    default: USD
                  unit:
                    type: string
                    description: >-
                      Always 'per_million_tokens'. Applies to prompt and
                      completion; fields ending in Per1kTokens are per 1,000
                      tokens
                    default: per_million_tokens
              distillationPolicy:
                $ref: '#/components/schemas/DistillationPolicy'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    DistillationPolicy:
      type: object
      description: >-
        API-only policy metadata indicating whether model or provider-route
        outputs may be used for model training, fine-tuning, distillation, or
        similar model-improvement workflows under NanoGPT's recorded
        model-license and provider-terms rules.
      properties:
        status:
          type: string
          description: Whether distillation is allowed under the current recorded rule set.
          enum:
            - allowed
            - disallowed
            - unknown
          example: allowed
        label:
          type: string
          description: Human-readable policy summary.
          example: License permits distillation
        basis:
          type: string
          description: Rule basis used to derive the policy status.
          enum:
            - deepseek-api-terms
            - permissive-open-weights
            - provider-output-use-terms
            - provider-output-use-restriction
            - closed-provider-restriction
            - provider-terms-unknown
          example: permissive-open-weights
        sourceUrl:
          type: string
          description: >-
            License or provider terms URL used as the policy source, when
            recorded.
          format: uri
          example: https://example.com/license-or-terms
        note:
          type: string
          description: Short explanation and caveats for the policy signal.
          example: Short explanation of the policy signal.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.