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

# Error codes

> Look up API error status codes, their causes, and quick fixes.

| Code | Cause | Solution |
| - | - | - |
| 400 - Invalid Request | The request is misconfigured, the input token count plus `max_tokens` exceeds the model's [context length](https://docs.together.ai/docs/inference-models.md), or a request to the [dedicated model inference](https://docs.together.ai/docs/dedicated-endpoints/overview.md) management API includes an unknown field. | Check that the request is [valid JSON](https://docs.together.ai/reference/chat-completions.md) and your [API key](https://api.together.ai/settings/projects/~current/api-keys) is correct. Use the prompt format the model expects, which differs between Mistral and Llama models. If the request exceeds the context length, lower `max_tokens`. For a chat model, you can also set `max_tokens` to `null` to let the model decide when to stop generating. If a management API request returns an `unknown field "..."` error, [remove the named field](https://docs.together.ai/docs/dedicated-endpoints/manage.md#troubleshooting). |
| 401 - Authentication Error | The API key is missing or invalid. | Check that you're using the correct [API key](https://api.together.ai/settings/projects/~current/api-keys) and [passing it correctly](https://docs.together.ai/reference/chat-completions.md). |
| 402 - Payment Required | Your organization's balance has reached its [spend cut-off](https://docs.together.ai/docs/billing-spend-controls.md) (\$0 for prepaid accounts), or the model requires a positive credit balance. | [Add credits](https://api.together.ai/settings/organization/~current/billing) to resume service. If you've already paid, wait up to 5 minutes for your balance to update, then retry. |
| 403 - Forbidden | Your account can't access the requested model or feature. For example, your plan doesn't include the model, the model requires a credit card on file, your organization has turned off [passthrough models](https://docs.together.ai/docs/privacy-and-security.md#passthrough-third-party-models), or the account is blocked. | The error message names the reason. Upgrade your plan or add a payment method in your [billing settings](https://api.together.ai/settings/organization/~current/billing), or ask an organization admin to turn on passthrough models. If your account is blocked, [contact support](https://portal.usepylon.com/together-ai/forms/support-request). |
| 404 - Not Found | The endpoint URL or model name is invalid. | Check that the endpoint URL matches the [API reference](https://docs.together.ai/reference/chat-completions.md) and that the [model you're querying is available](https://docs.together.ai/docs/inference-models.md). |
| 413 - Request Entity Too Large | The request body is larger than the endpoint accepts. Limits vary by endpoint. | Reduce the request size. Pass large images or audio as a URL instead of embedding them in the request body. Direct audio uploads are capped at 80 MB (see [transcription limits](https://docs.together.ai/docs/inference/transcription/overview.md#limits)). |
| 429 - Too Many Requests | Together is limiting serverless requests during high demand, or a deployment on a [dedicated endpoint](https://docs.together.ai/docs/dedicated-endpoints/manage.md) would exceed your project's or organization's GPU quota for its GPU type. | For serverless [rate limiting](https://docs.together.ai/docs/serverless/rate-limits.md), reduce your request rate, spread out bursts, and retry with exponential backoff. For GPU quota, lower the requested replica count, stop unused deployments on that GPU type, or [contact support](https://portal.usepylon.com/together-ai/forms/support-request) to raise the quota. If the platform itself is out of capacity for that GPU type, retry later. |
| 500 - Server Error | An unknown server error occurred. | Wait briefly, then retry. If the error persists, [contact support](https://portal.usepylon.com/together-ai/forms/support-request). |
| 503 - Service Unavailable | The service is temporarily unavailable, for example during high demand. | Wait briefly, then retry with exponential backoff. If the error persists, [contact support](https://portal.usepylon.com/together-ai/forms/support-request). |
| 504 - Timeout | The request didn't complete in time. | Wait briefly, then retry. If the error persists, [contact support](https://portal.usepylon.com/together-ai/forms/support-request). |
| 524 - Cloudflare Timeout | The connection timed out at the network edge. | Wait briefly, then retry. If the error persists, [contact support](https://portal.usepylon.com/together-ai/forms/support-request). |
| 529 - Overloaded | The model has reached its maximum replica count and can't take more requests. | Wait briefly, then retry with exponential backoff. If the error persists, [contact support](https://portal.usepylon.com/together-ai/forms/support-request) to raise the model's maximum replica count. |

If you see an error code that isn't listed here, or a solution doesn't resolve the error, [contact support](https://portal.usepylon.com/together-ai/forms/support-request).


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