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

# Models

> One API for hundreds of models

Explore and browse every model available through ZnapAI.

## `GET /v1/models`

Lists every model your API key can access.

<CodeGroup>
  ```shellscript cURL theme={null}
  curl --location 'https://api.znapai.com/v1/models' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'
  ```
</CodeGroup>

```json Response theme={null}
{
  "data": [
    {
      "id": "gpt-image-2",
      "canonical_slug": "gpt-image-2",
      "name": "gpt-image-2",
      "created": 1677610602,
      "description": "",
      "context_window": null,
      "max_tokens": null,
      "mode": "image_generation",
      "architecture": {
        "modality": "text+image+file->image",
        "input_modalities": ["text", "image", "file"],
        "output_modalities": ["image"]
      },
      "links": {},
      "capabilities": {
        "supports_vision": true,
        "supports_pdf_input": true
      },
      "pricing": {
        "prompt": "0.0000025",
        "completion": "0.000005",
        "image": "0.000004",
        "image_output": "0.000015",
        "input_cache_read": "0.000000625"
      }
    },
    {
      "id": "gemini-3.1-flash-lite",
      "canonical_slug": "gemini-3.1-flash-lite",
      "name": "gemini-3.1-flash-lite",
      "created": 1677610602,
      "description": "",
      "context_window": 1048576,
      "max_tokens": 65536,
      "mode": "chat",
      "architecture": {
        "modality": "text+image+audio+file->text",
        "input_modalities": ["text", "image", "audio", "file"],
        "output_modalities": ["text"]
      },
      "links": {},
      "capabilities": {
        "supports_system_messages": true,
        "supports_response_schema": true,
        "supports_vision": true,
        "supports_function_calling": true,
        "supports_tool_choice": true,
        "supports_prompt_caching": true,
        "supports_audio_input": true,
        "supports_audio_output": false,
        "supports_pdf_input": true,
        "supports_native_streaming": true,
        "supports_web_search": true,
        "supports_url_context": true,
        "supports_reasoning": true
      },
      "pricing": {
        "prompt": "0.00000025",
        "completion": "0.0000015",
        "audio": "0.0000005",
        "internal_reasoning": "0.0000015",
        "input_cache_read": "0.000000025",
        "web_search": "0.014"
      }
    }
    /* ...remaining models */
  ],
  "total_count": 61,
  "links": {
    "next": null
  }
}
```

## Query Parameters

The Models API supports query parameters to filter the list of models returned.

### `mode`

Filter models by what they're used for — a comma-separated list.

| Value                 | Description                                   |
| --------------------- | --------------------------------------------- |
| `chat`                | Text and multimodal chat/completion models    |
| `image_generation`    | Models that generate images                   |
| `video_generation`    | Models that generate video                    |
| `embedding`           | Embedding models                              |
| `rerank`              | Reranking models                              |
| `responses`           | Models served through the Responses API       |
| `realtime`            | Realtime (low-latency voice/streaming) models |
| `audio_speech`        | Text-to-speech models                         |
| `audio_transcription` | Speech-to-text models                         |

<CodeGroup>
  ```shellscript cURL theme={null}
  curl --location 'https://api.znapai.com/v1/models?mode=video_generation' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'
  ```
</CodeGroup>

```json Response theme={null}
{
  "data": [
    {
      "id": "veo-3.1-generate-preview",
      "canonical_slug": "veo-3.1-generate-preview",
      "name": "veo-3.1-generate-preview",
      "created": 1677610602,
      "description": "",
      "context_window": 1024,
      "max_tokens": null,
      "mode": "video_generation",
      "architecture": {
        "modality": "text->video",
        "input_modalities": ["text"],
        "output_modalities": ["video"]
      },
      "links": {},
      "pricing": {
        "prompt": null,
        "completion": null,
        "request": null,
        "image": null,
        "image_output": null,
        "audio": null,
        "audio_output": null,
        "internal_reasoning": null,
        "input_cache_read": null,
        "input_cache_write": null,
        "input_cache_write_1h": null,
        "web_search": null
      }
    },
    {
      "id": "veo-3.1-fast-generate-preview",
      "canonical_slug": "veo-3.1-fast-generate-preview",
      "name": "veo-3.1-fast-generate-preview",
      "created": 1677610602,
      "description": "",
      "context_window": 1024,
      "max_tokens": null,
      "mode": "video_generation",
      "architecture": {
        "modality": "text->video",
        "input_modalities": ["text"],
        "output_modalities": ["video"]
      },
      "links": {},
      "pricing": {
        "prompt": null,
        "completion": null,
        "request": null,
        "image": null,
        "image_output": null,
        "audio": null,
        "audio_output": null,
        "internal_reasoning": null,
        "input_cache_read": null,
        "input_cache_write": null,
        "input_cache_write_1h": null,
        "web_search": null
      }
    }
    /* ...remaining video models */
  ],
  "total_count": 6,
  "links": {
    "next": null
  }
}
```

### `output_modalities`

Filter models by their output capabilities. Accepts a comma-separated list of modalities.

| Value        | Description                      |
| ------------ | -------------------------------- |
| `text`       | Models that produce text output  |
| `image`      | Models that generate images      |
| `audio`      | Models that produce audio output |
| `embeddings` | Embedding models                 |
| `video`      | Models that generate video       |

Examples:

<CodeGroup>
  ```shellscript cURL theme={null}
  # All models (default)
  curl --location 'https://api.znapai.com/v1/models' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'

  # Image generation models only
  curl --location 'https://api.znapai.com/v1/models?output_modalities=image' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'

  # Text and image models
  curl --location 'https://api.znapai.com/v1/models?output_modalities=text,image' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'
  ```
</CodeGroup>

```json Response theme={null}
{
  "data": [
    {
      "id": "gpt-image-2",
      "canonical_slug": "gpt-image-2",
      "name": "gpt-image-2",
      "created": 1677610602,
      "description": "",
      "context_window": null,
      "max_tokens": null,
      "mode": "image_generation",
      "architecture": {
        "modality": "text+image+file->image",
        "input_modalities": ["text", "image", "file"],
        "output_modalities": ["image"]
      },
      "links": {},
      "capabilities": {
        "supports_vision": true,
        "supports_pdf_input": true
      },
      "pricing": {
        "prompt": "0.0000025",
        "completion": "0.000005",
        "image": "0.000004",
        "image_output": "0.000015",
        "input_cache_read": "0.000000625"
      }
    },
    {
      "id": "gpt-5.2",
      "canonical_slug": "gpt-5.2",
      "name": "gpt-5.2",
      "created": 1677610602,
      "description": "",
      "context_window": 272000,
      "max_tokens": 128000,
      "mode": "chat",
      "architecture": {
        "modality": "text+image->text+image",
        "input_modalities": ["text", "image"],
        "output_modalities": ["text", "image"]
      },
      "links": {},
      "capabilities": {
        "supports_system_messages": true,
        "supports_response_schema": true,
        "supports_vision": true,
        "supports_function_calling": true
        /* ...remaining capabilities */
      },
      "pricing": {
        "prompt": "0.0000021",
        "completion": "0.0000084",
        "input_cache_read": "0.00000021"
      }
    }
    /* ...remaining image-output models */
  ],
  "total_count": 5,
  "links": {
    "next": null
  }
}
```

### Model Object Schema

Each model in the `data` array contains the following fields:

| Field            | Type                        | Description                                                                                                                     |
| ---------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `id`             | `string`                    | The model name you pass in API requests (e.g. `"gemini-3.1-flash-lite"`)                                                        |
| `canonical_slug` | `string`                    | Always identical to `id` on ZnapAI                                                                                              |
| `name`           | `string`                    | Human-readable display name                                                                                                     |
| `created`        | `number`                    | Unix timestamp of when the model was added                                                                                      |
| `description`    | `string`                    | A short description of the model, when available                                                                                |
| `context_window` | `number \| null`            | Maximum number of input tokens the model accepts                                                                                |
| `max_tokens`     | `number \| null`            | Maximum number of output tokens the model can generate                                                                          |
| `mode`           | `string \| null`            | What the model is used for — `chat`, `image_generation`, `video_generation`, `embedding`, `rerank`, `audio_transcription`, etc. |
| `architecture`   | `Architecture`              | Object describing the model's input/output modalities                                                                           |
| `links`          | `object`                    | Reserved for future use                                                                                                         |
| `capabilities`   | `Capabilities \| undefined` | The model's supported features (omitted if none are known)                                                                      |
| `pricing`        | `Pricing \| undefined`      | What you pay to use the model, in USD per token (omitted if pricing isn't available) — see [Pricing](#pricing)                  |

### Architecture Object

```typescript theme={null}
{
  "modality": string,           // e.g. "text+image->text"
  "input_modalities": string[], // e.g. ["text", "image"]
  "output_modalities": string[] // e.g. ["text"]
}
```

* **`input_modalities`** — the types of input the model accepts (text, image, audio, file).
* **`output_modalities`** — the types of output the model can produce.

### Capabilities Object

The model's supported features, when known — things like `supports_vision`,
`supports_function_calling`, `supports_reasoning`, and, for reasoning models, which
reasoning effort levels they support (`supports_none_reasoning_effort`,
`supports_xhigh_reasoning_effort`, etc.). Omitted entirely if no capability data is
available for a model.

## Pricing

`pricing` shows what you actually pay to use the model — already reflecting any
discounts, in USD per token (or per request, for models like rerank).

### Fields

All values are USD amounts per token, formatted as **strings**:

| Field                  | Description                                                                     |
| ---------------------- | ------------------------------------------------------------------------------- |
| `prompt`               | Cost per input (prompt) token                                                   |
| `completion`           | Cost per output (completion) token                                              |
| `request`              | Flat cost per request (used by models like rerank instead of per-token pricing) |
| `image`                | Cost per input image token                                                      |
| `image_output`         | Cost per output image token                                                     |
| `audio`                | Cost per input audio token                                                      |
| `audio_output`         | Cost per output audio token                                                     |
| `internal_reasoning`   | Cost per reasoning token                                                        |
| `input_cache_read`     | Cost per cached input token that's read                                         |
| `input_cache_write`    | Cost per cached input token that's written                                      |
| `input_cache_write_1h` | Cost per cached input token written with a 1-hour cache lifetime                |
| `web_search`           | Cost per web search performed                                                   |

Fields only appear when they're relevant to a model — for example, image-output models
show `image_output`, audio-capable models show `audio`/`audio_output`, and text-only
models show neither. For most models, `pricing` is omitted entirely if pricing isn't
available.

### Video and rerank models

For video generation and rerank models, `pricing` always appears, with `null` for any
field that doesn't apply — since these models are often priced in ways (e.g. per-second
video) that don't fit the standard per-token fields above.

### `overrides` (long-context pricing)

Some models charge more once a request passes a certain prompt length. When that
applies, `overrides` lists the higher rates and the token threshold they kick in at:

```json theme={null}
"overrides": [
  { "min_prompt_tokens": 128000, "prompt": "...", "completion": "..." },
  { "min_prompt_tokens": 200000, "prompt": "...", "completion": "...", "input_cache_read": "...", "input_cache_write": "..." }
]
```

Omitted entirely for models without long-context pricing.

### Example response

```json theme={null}
{
  "id": "gemini-3.1-flash-lite",
  "canonical_slug": "gemini-3.1-flash-lite",
  "name": "gemini-3.1-flash-lite",
  "created": 1677610602,
  "description": "",
  "context_window": 1048576,
  "max_tokens": 65536,
  "mode": "chat",
  "architecture": {
    "modality": "text+image+audio+file->text",
    "input_modalities": ["text", "image", "audio", "file"],
    "output_modalities": ["text"]
  },
  "links": {},
  "capabilities": {
    "supports_system_messages": true,
    "supports_response_schema": true,
    "supports_vision": true,
    "supports_function_calling": true,
    "supports_tool_choice": true,
    "supports_prompt_caching": true,
    "supports_audio_input": true,
    "supports_audio_output": false,
    "supports_pdf_input": true,
    "supports_native_streaming": true,
    "supports_web_search": true,
    "supports_url_context": true,
    "supports_reasoning": true
  },
  "pricing": {
    "prompt": "0.00000025",
    "completion": "0.0000015",
    "audio": "0.0000005",
    "internal_reasoning": "0.0000015",
    "input_cache_read": "0.000000025",
    "web_search": "0.014"
  }
}
```

A video-generation model, for comparison — note `capabilities` is omitted entirely when
no capability data is available for it, while `pricing` still appears with `null`
fields:

```json theme={null}
{
  "id": "veo-3.1-generate-preview",
  "canonical_slug": "veo-3.1-generate-preview",
  "name": "veo-3.1-generate-preview",
  "created": 1677610602,
  "description": "",
  "context_window": 1024,
  "max_tokens": null,
  "mode": "video_generation",
  "architecture": {
    "modality": "text->video",
    "input_modalities": ["text"],
    "output_modalities": ["video"]
  },
  "links": {},
  "pricing": {
    "prompt": null,
    "completion": null,
    "request": null,
    "image": null,
    "image_output": null,
    "audio": null,
    "audio_output": null,
    "internal_reasoning": null,
    "input_cache_read": null,
    "input_cache_write": null,
    "input_cache_write_1h": null,
    "web_search": null
  }
}
```

## `GET /models` (OpenAI format)

Dropping the `v1` prefix returns a lighter, OpenAI-compatible model list — just the
`id`, `object`, `created`, and `owned_by` fields, matching the shape returned by
OpenAI's own `/models` endpoint. Use this if you're pointing an existing OpenAI SDK
or tool at ZnapAI and just need the standard model list.

<CodeGroup>
  ```shellscript cURL theme={null}
  curl --location 'https://api.znapai.com/models' \
  --header 'Authorization: Bearer $ZnapAI_API_KEY'
  ```
</CodeGroup>

```json Response theme={null}
{
  "data": [
    {
      "id": "gpt-image-2",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
    },
    {
      "id": "gemini-3.1-flash-lite",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
    },
    {
      "id": "veo-3.1-generate-preview",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
    }
    /* ...remaining models */
  ]
}
```
