# Models

## Model id

A model id in the API is the model id of the site catalog: `claude-sonnet-5-5`, `gpt-6.2-astra`, `gemini-4-carbon`, `nanobanana`, `seedance`. The `model` field of an answer repeats what you sent.

Media models can have modes: versions and variants of one model at different prices. Pass the mode in `mode` or after a colon:

```json
{"model": "seedance", "mode": "seedance-2-5"}
```

```json
{"model": "seedance:seedance-2-5"}
```

Without `mode` the default mode is used. The modes of a model and the price of each are in `GET /v1/models/{id}`.

Text models are called only through `POST /v1/chat/completions`, media only through `POST /v1/generations`. A text model sent to `/v1/generations` gets `400 use_chat_endpoint`.

## Catalog

`GET /v1/models` without parameters returns text models in the OpenAI shape, the way Open WebUI, LibreChat and SDKs read it:

```bash
curl https://api.unitool.ai/v1/models -H "Authorization: Bearer $UNITOOL_API_KEY"
```

```json
{
  "object": "list",
  "data": [
    {
      "id": "claude-sonnet-5-5",
      "object": "model",
      "created": 0,
      "owned_by": "anthropic",
      "name": "Claude Sonnet 5.5",
      "type": "chat",
      "context_length": 200000,
      "max_output_tokens": 64000,
      "capabilities": { "vision": true, "files": true, "tools": true, "reasoning": true, "temperature": true },
      "pricing": { "unit": "tokens_per_1m", "input": "300", "cached_input": "30", "cache_write_1h": "600", "output": "1500" }
    }
  ]
}
```

The numbers in the example are made up; real prices are in the tables below and in the API answer.

- Media models: `GET /v1/models?type=image`, `video`, `audio` or `all` (together with text models). A media entry in the list has its modes and `pricing.from`, the price of the cheapest mode on its example.
- `GET /v1/models/{id}`: one model. For media: the modes, the `input_schema` of each mode (JSON Schema 2020-12), a ready example request and the price make-up. The same schemas are collected in `GET /v1/openapi.json`.
- The answer is cached for 60 seconds and comes with an `ETag`. Send `If-None-Match` and an unchanged catalog answers `304`.
- Optional fields: `description`, `tags`, `featured: true` (a recommended model), `deprecation` (the model is leaving, below).
- List order: featured first, then the showcase order, then by id.
- `capabilities.web_search: true`: the model can [search the web](/developers/chat-completions#web-search).
- New catalog models appear in the API on their own; new text models show in `/v1/models` within a minute of being added.

## Retiring models

A model leaving the API gets a `deprecation` field:

```json
"deprecation": { "deprecated_at": "2026-12-01T00:00:00Z", "sunset_at": "2027-01-15T00:00:00Z", "replacement": "claude-sonnet-5-5" }
```

While the model still works, every call to it (`/v1/chat/completions`, `POST /v1/generations`, `/v1/quotes`, `GET /v1/models/{id}`) carries these headers:

```http
Deprecation: @1796083200
Sunset: Fri, 15 Jan 2027 00:00:00 GMT
Link: <https://unitool.ai/developers/models/claude-sonnet-5-5>; rel="successor-version"
```

`replacement` may be `null`: the model has no replacement, and then there is no `Link` header. After `sunset_at` the model drops out of the list and a call gets [`410 model_retired`](/developers/errors#model_retired) with `details.replacement` and `details.sunset_at`. Watch for the `Sunset` header in your logs and move to `replacement` ahead of time.

## Prices

Prices are in balance tokens per 1M model tokens: `input`, `cached_input` (input read from the cache), `cache_write_5m` and `cache_write_1h` (cache writes), `output` (reasoning counts as output). The `long_context` block applies when the input is longer than `threshold_tokens`: then the whole request is priced at its rates.

Prices change immediately, without notice. A request is priced at the rate in force when it was admitted. How this becomes a charge is explained in [Billing](/developers/billing).
