# Deprecated models

Source: [Deprecated models](<https://docs.gptunnel.ru/en/getting-started/deprecated-models/>)

<a id="_top"></a>
Providers periodically retire models. A retired model stops serving requests on its retirement date.

For some models, GPTunneL assigns a **replacement model** in advance. After the retirement date, GPTunneL automatically routes requests to the replacement so the existing integration keeps working.

 <a id="how-to-know-about-the-withdrawal"></a>
 
<a id="check-for-an-upcoming-model-retirement"></a>
## Check for an upcoming model retirement

The model catalogs report retirement status for each model. Use [`/v1/models`](<https://docs.gptunnel.ru/en/api/models/>) for language models and either `/v1/media/models` or [`/api/v2/media/models`](<https://docs.gptunnel.ru/en/creative-lab/models/>) for media models.

### Model retirement fields

| Parameter | Type | Description |
| --- | --- | --- |
| `deprecated` | `boolean` | true once the retirement date has arrived. Requests use the replacement model or return HTTP 410. While false, the model serves requests as usual. |
| `deprecated_at` | `string \| null` | Retirement date and time in ISO 8601. A future date announces a scheduled retirement. null means the model is not marked for retirement. |
| `deprecation_redirect_to` | `string \| null` | ID of the model that serves requests after the retirement date. If null, requests return HTTP 410 after the retirement date. |

This historical example shows a catalog entry before the retirement date.

```json
{
  "id": "claude-4.5-haiku",
  "object": "model",
  "title": "Claude Haiku-4.5",
  "deprecated": false,
  "deprecated_at": "2026-08-27T08:22:18.305Z",
  "deprecation_redirect_to": "claude-4.6-sonnet"
}
```

> **Tip: Check the retirement date in advance**
>
> Check the catalog regularly for a non-null `deprecated_at`. This field can announce an upcoming retirement while the original model still serves requests. A replacement keeps the integration working during migration. Providers can retire replacement models too.

 <a id="what-happens-after-the-date-of-withdrawal"></a>
 
<a id="after-the-retirement-date"></a>
## After the retirement date

If GPTunneL has assigned a replacement, it routes the request to that model. A successful request returns HTTP `200`. The response headers identify the replacement.

### Response headers

| Parameter | Type | Description |
| --- | --- | --- |
| `Deprecation` | `string` | Always true for a response that used a replacement model. |
| `Sunset` | `string` | Retirement date of the requested model in HTTP-date format. |
| `Warning` | `string` | Warning code 299 and a message identifying the requested model, the model that served the request and the model used for billing. |
| `x-model-requested` | `string` | ID of the requested model. |
| `x-model-served` | `string` | The ID of the model on which the request was actually executed. |

A successful Chat Completions request for `grom-16k` returned these headers.

```http
HTTP/1.1 200 OK
Deprecation: true
Sunset: Wed, 02 Sep 2026 11:49:00 GMT
Warning: 299 - "Model 'grom-16k' was deprecated by the provider and the request was served by 'grom-1.5-pro'. Billing follows the requested model 'grom-16k'. Update your integration to call 'grom-1.5-pro' directly."
x-model-requested: grom-16k
x-model-served: grom-1.5-pro
```

The response body includes a `warnings` array. The replacement warning has the code `DEPRECATED_MODEL`.

```json
{
  "warnings": [
    {
      "code": "DEPRECATED_MODEL",
      "message": "Model 'grom-16k' was deprecated by the provider and the request was served by 'grom-1.5-pro'. Billing follows the requested model 'grom-16k'. Update your integration to call 'grom-1.5-pro' directly."
    }
  ]
}
```

The warning message matches the `Warning` header. Use the warning’s `code` in application logic because the message text can change. The `warnings` array can contain multiple warnings.

The response field `model` contains the model ID you requested, so existing checks that compare the request and response IDs keep working. Read the `x-model-served` header to identify the model that handled the request.

For streaming responses, `warnings` appears **only in the first chunk**. Every chunk’s `model` field contains the requested model ID.

<a id="where-to-look-for-a-model-replacement-warning"></a>
### Where to look for a model replacement warning

| Response format | Where to look |
| --- | --- |
| Standard JSON response | Response headers and the `warnings` array |
| Streaming response | Response headers and `warnings` in the first event |
| OpenAI-compatible transcription | Response headers only. The provider response body is passed through unchanged and can be plain text or SRT |
| Creative Lab API v2 task creation | Response headers and `warnings` in the body |
| Task lookup (`GET /media/tasks/:id`, `GET /api/v2/media/tasks/:id`, `GET /v1/lab/result`) and Creative Lab API v2 webhooks | The warning is available in the task creation response. Save its `warnings` and `x-model-served` when creating the task |

Task lookups and Creative Lab API v2 webhooks report the requested ID in `model`. To know which model ran the task, use `x-model-served` from the task creation response.

> **Caution: Billing follows the requested model**
>
> The charge uses the **requested model’s price and discounts**. The requested model also appears in your spending history.
>
>
>
> API key limits and organization restrictions apply to the model that actually served the request.

If the retired model has no replacement, the request returns HTTP `410 Gone`. The response format depends on the API.

<a id="tab-panel-0-0"></a>
**OpenAI-compatible**

For `/v1/chat/completions`, `/v1/embeddings` and OpenAI-compatible transcription mode:

```json
{
  "error": {
    "message": "Model 'gpt-5-codex' is deprecated. See compatible alternatives.",
    "type": "model_deprecated",
    "code": "model_deprecated",
    "param": "model",
    "replacements": []
  }
}
```

In this Chat Completions response for `gpt-5-codex`, `error.replacements` was empty. If you receive an empty array, choose an available model from the [catalog](<https://docs.gptunnel.ru/en/api/models/>).

<a id="tab-panel-0-1"></a>
**Claude-compatible**

For `/v1/messages`:

```json
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Model 'claude-3.7-sonnet' is deprecated. See compatible alternatives."
  }
}
```

<a id="tab-panel-0-2"></a>
**Creative Lab and Transcription**

For `/v1/media/create` and asynchronous `/v1/audio/transcriptions`, the response body contains `code: 15`.

```json
{
  "code": 15,
  "message": "Model is deprecated by the provider and is no longer available.",
  "original_id": "flux-old"
}
```

Check the catalog for a model to use in place of the retired one.

 <a id="where-it-works"></a>
 
<a id="supported-endpoints"></a>
## Supported endpoints

| Method | Routes to a configured replacement | Returns HTTP 410 when no replacement exists |
| --- | --- | --- |
| `POST /v1/chat/completions` | yes | yes |
| `POST /v1/embeddings` | yes | yes |
| `POST /v1/messages` | yes | yes |
| `POST /v1/media/create` | yes | yes |
| `POST /v1/audio/transcriptions` | yes | yes |
| `POST /v1/media/generate` | no | no |
| `POST /api/v2/media/tasks` | yes | yes |
| `POST /api/v2/media/price` | yes | yes |

> **Note: Synchronous Creative Lab generation**
>
> The `/v1/media/generate` endpoint uses a fixed model and does not handle model retirement.

> **Note: Creative Lab API v2 price calculation**
>
> The price quote (`POST /api/v2/media/price`) handles replacements the same way as task creation. If there is no replacement, both endpoints return HTTP `410` with `code: 21` and the `original_id` field in the response body.

> **Note: Catalogs report model status**
>
> Use `/v1/models`, `/v1/media/models` or `/api/v2/media/models` to read a model’s retirement status. Routing to a replacement happens when you make a request that uses the model.
