> For the complete documentation index, see [llms.txt](https://docs.podtorrent.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podtorrent.com/using-the-api/errors-and-limits.md).

# Errors and limits

Errors look like OpenAI's:

```json
{ "error": { "message": "invalid API key", "type": "authentication_error" } }
```

## Error codes

| Status | `type`                  | What happened                                                                                            | What to do                                                                |
| ------ | ----------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| 400    | `invalid_request_error` | Body isn't JSON, `model` is missing, or a PodTorrent option is invalid                                   | Fix the request                                                           |
| 401    | `authentication_error`  | Key is missing, unknown or disabled                                                                      | Check the key                                                             |
| 404    | `invalid_request_error` | Unknown path                                                                                             | Check the URL                                                             |
| 429    | `rate_limit_error`      | Your key hit a quota                                                                                     | Slow down, or wait for the reset                                          |
| 503    | `capacity_error`        | No node serves the model at that tier and price, none had a free slot in time, or the nodes tried failed | Check `/v1/models`, raise your price ceiling, use `batch`, or retry later |

Errors from the engine itself, for example a `400` for a parameter it doesn't support, are passed through with the engine's status and body.

## Quotas

A key can have two limits. Ask the PodTorrent team if you need them changed.

* **Requests per minute**, over the last 60 seconds.
* **Tokens per day**, input plus output, reset at 00:00 UTC.

Quotas count requests once they finish. A burst of requests sent at the same moment can go a little over the limit before the `429`s start.

## Retrying

* `503` after waiting: the network is full for that model. Back off and try again, or switch to the `batch` tier, which waits longer.
* `429`: wait. The message says which limit you hit.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.podtorrent.com/using-the-api/errors-and-limits.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
