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

# Troubleshooting

> Resolve common Pareto API connection errors.

Each API response has an HTTP status number. Use it to find the next step. A Messages API error has `error.type` and `error.message` but no `error.code`. Read `error.message` for the cause.

## 401 Unauthorized

The chat API key is missing, invalid, or no longer active. `GET /models` does not require a key.

1. Confirm that the API request sends your Pareto key to Pareto. For a router connection, check the provider key saved in the router.
2. Remove spaces before or after the key.
3. Check your account and key in the [dashboard](https://paretoinference.com/dashboard).

With a router, your app uses the router's key and the router uses your Pareto key. A direct API connection uses your Pareto key. If you lost that key, [create a replacement](https://docs.paretoinference.com/pricing.md#manage-api-keys) and update each connection that used it.

## 400 Bad Request

The request has an unsupported parameter or an invalid value.

1. Compare the request with the [request parameters](https://docs.paretoinference.com/api-reference.md#request-parameters).
2. Remove parameters that are not in the table.
3. Send only one of `max_tokens` and `max_completion_tokens`.

Read `error.message`, `error.code`, and `error.param` for validation details. For example, `unsupported_storage` means the request sent `store: true`. Use `store: false`. `streaming_only` means the request did not set `stream: true`: Pareto serves streamed requests only. `model_coming_soon` means the model is announced but does not accept requests yet. Use a model ID from `GET /models`. For Kimi K3.1 Pro, it means the model is not on for your account. Ask your Pareto contact to turn it on. `context_length_exceeded` means the prompt is too long for the model to start from. Shorten or compact the conversation, then retry. This request is not charged. `invalid_tool_call_id` means a tool result does not identify its tool call. In Chat Completions, send `tool_call_id` with each `tool` message. In the Responses API, send `call_id` with each `function_call_output` item.

## 429 Too Many Requests

The account has no credits for the request, too many requests were sent at the same time, or the model is at capacity. Read `error.code`.

| `error.code` | Cause | Next step |
| - | - | - |
| `credit_exhausted` | The account has no credits available. | [Buy credits](https://docs.paretoinference.com/pricing.md#buy-credits). |
| `credit_insufficient` | The available credits are less than this request can use. Pareto holds credits for `max_tokens` before the model starts. | Lower `max_tokens`, or buy credits. |
| `429` | Too many requests were sent at the same time. | Send fewer requests at the same time. Wait before you retry. |
| `model_capacity` | The model is at capacity. This is not your account's limit. | Retry after the delay in the `Retry-After` response header, or use another provider. |
| `prefill_busy` | The model is busy with other large requests, and about 25,000 or more of this prompt's tokens are not in its cache. This request is not charged. | Retry after the delay in the `Retry-After` response header. |

Avoid immediate repeated retries.

If your router has a fallback rule, it can send a request to another provider. See [How Pareto works](https://docs.paretoinference.com/how-pareto-works.md).

## 502 Bad Gateway

The model request failed, or the model returned a response that Pareto cannot deliver. Retry the request. Read `error.code`.

| `error.code` | Cause |
| - | - |
| `502` | The model request failed. A stream can stop with this error after it starts. |
| `invalid_tool_arguments` | The model returned invalid tool arguments. |
| `incomplete_tool_call` | The model returned an incomplete tool call. The output may have reached `max_tokens`; raise it before you retry. |
| `tool_response_limit` | The model tool response is above the limit. |
| `incompatible_tool_calls` | The model returned more tool calls than `parallel_tool_calls` allows. See [Tool calls](https://docs.paretoinference.com/api-reference.md#tool-calls). |

Before you retry a tool request, check whether the tool already ran.

## 503 Service Unavailable

The service is temporarily unavailable. Read `error.code`.

| `error.code` | Cause | Next step |
| - | - | - |
| `credit_unavailable` | Credit accounting is temporarily unavailable. | Wait, then retry. |
| `503` | The service is in maintenance, or it temporarily failed. | Wait, then retry. A `Retry-After` response header gives the delay in seconds. |

Avoid immediate repeated retries. If the error continues, send the request time and `X-Request-ID` response header to your Pareto contact.

## A stream stops before completion

Check for an error event. A successful stream ends with `data: [DONE]`. Do not treat an incomplete stream as a complete response. If you retry a tool request, first check whether the tool already ran.

## The app has no custom base URL field

Use a [router integration guide](https://docs.paretoinference.com/integrations/routers.md) or an app that accepts a custom base URL.

## The app requires a different API format

Pareto accepts OpenAI Chat Completions, OpenAI Responses API, and Anthropic Messages API requests. A router may translate another format into one of them. Check the router's supported formats and test the connection. A direct API connection must use the Pareto format.

## Other errors

Send the HTTP status number, request time, and `X-Request-ID` response header to your Pareto contact. Do not send your API key.


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