# Troubleshoot API errors

Source: [Troubleshoot API errors](<https://docs.gptunnel.ru/en/getting-started/api-errors/>)

<a id="_top"></a>
<a id="с-какого-места-начать"></a>
 
<a id="where-to-begin"></a>
## Where to begin

1. Check the HTTP method and request path against the documentation for the endpoint.
2. Record the HTTP status and machine-readable error fields. Chat Completions returns `error.type`, `error.code`, and `error.param`. Creative Lab and the Business API often return a numeric `code` at the top level. MCP may include the code in the tool message.
3. Open the error reference for the service. If the response includes `error.param` or `details[].key`, find the field with that name in your request.

For streaming responses, inspect the events after the connection opens. A stream can start with HTTP `200` and later contain an error. The [SSE guide](<https://docs.gptunnel.ru/en/api/chat-completions/streaming/>) shows how to handle the final event and a dropped connection.

<a id="services-handbooks"></a>
## Services handbooks

- [Chat Completions](<https://docs.gptunnel.ru/en/api/chat-completions/#errors>) covers API keys, balance, request fields, and model availability.
- [Anthropic Messages](<https://docs.gptunnel.ru/en/api/anthropic-messages/#errors>) describes errors in the Anthropic format.
- [Creative Lab](<https://docs.gptunnel.ru/en/creative-lab/errors/>) covers input data, limits, and media task results. For `status: failed`, check `error` in the [task response](<https://docs.gptunnel.ru/en/creative-lab/get-task/>).
- [Business API](<https://docs.gptunnel.ru/en/business/errors/>) covers key permissions, roles, balances, and transfers.
- [MCP](<https://docs.gptunnel.ru/en/mcp/troubleshooting/>) covers connections, tools, and limits.
- [Transcription](<https://docs.gptunnel.ru/en/transcription/openai-compat/#errors>) covers file uploads and response formats.

<a id="examples-of-errors-and-decisions"></a>
## Examples of errors and decisions

<a id="chat-completions--invalid_model_error--404"></a>
### Chat Completions · invalid\_model\_error · 404

Use the same API key to look up the exact ID in the [model catalog](<https://docs.gptunnel.ru/en/api/models/>), then update the [`model` field](<https://docs.gptunnel.ru/en/api/chat-completions/#chat-request-model>). [Example error response](<https://docs.gptunnel.ru/en/api/chat-completions/#chat-invalid-model>)

<a id="chat-completions--model-is-required--400"></a>
### Chat Completions · model is required · 400

Add [`model`](<https://docs.gptunnel.ru/en/api/chat-completions/#chat-request-model>) to the top level of the JSON request body alongside `messages`. [Example error response](<https://docs.gptunnel.ru/en/api/chat-completions/#chat-missing-model>)

<a id="creative-lab--err_empty_prompt--400"></a>
### Creative Lab · ERR\_EMPTY\_PROMPT · 400

A price estimate for `kling-v3` with a missing prompt returns `code: 3` and `details[].key: "prompt"`. Include [`prompt`](<https://docs.gptunnel.ru/en/creative-lab/price/#request-prompt>) at the top level of the request body alongside `model`. [Error details](<https://docs.gptunnel.ru/en/creative-lab/errors/#error-empty-prompt>)

<a id="embeddings--invalid_input--422"></a>
### Embeddings · invalid\_input · 422

If `error.param` is `input`, send [text in the `input` field](<https://docs.gptunnel.ru/en/embedding/text-embedding-3-small/#embedding-request-input>). When `input` is empty or missing, the error message is `input must be not empty`.

<a id="authorisation--unauthorized_request_error--401"></a>
### Authorisation · unauthorized\_request\_error · 401

Check that the `Authorization` header contains an active API key. [Get or replace an API key](<https://docs.gptunnel.ru/en/#get-an-api-key>)

<a id="business-api--code-36--403"></a>
### Business API · code 36 · 403

If `POST /api/v1/orgs/list` returns code `36`, your organization does not have permission to view the list of client organizations. [Cause and next steps](<https://docs.gptunnel.ru/en/business/errors/#business-error-36>)

<a id="mcp--rate_limited"></a>
### MCP · RATE\_LIMITED

Wait for the interval specified in the error message before retrying. Keep subsequent calls within the rate limit. [MCP rate limit details](<https://docs.gptunnel.ru/en/mcp/troubleshooting/#mcp-rate-limited>)

<a id="if-you-need-support"></a>
## If you need support

Include the time of the request and its time zone, the HTTP method and path, the HTTP status, and the error message. If the API returned a `trace_id`, include it as well. Remove your API key and any sensitive data from the request details before sharing them with support.
