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

# Error Handling

When a request fails, check the **HTTP status code** and the **`error` object** in the response body. Use **`error.type`** together with **`error.code`** (when present) and the status code to decide what to do next.

If you need help, [contact support](https://console.scitix.ai/model-inference/home) and include **`traceId`** from the response.

## Error response format

Most failed **non-streaming** requests return JSON like this:

```json theme={null}
{
  "error": {
    "status": false,
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "Invalid parameter: temperature must be between 0 and 2.",
    "msg": "Invalid parameter: temperature must be between 0 and 2.",
    "param": "temperature",
    "traceId": "abc123",
    "retry_after_sec": 30
  }
}
```

| Field             | Description                                                                   |
| ----------------- | ----------------------------------------------------------------------------- |
| type              | Error category — your main signal for what to do next                         |
| code              | More specific reason; shown as — in the table below when not set              |
| message / msg     | What went wrong, in plain language (`message` and `msg` are usually the same) |
| param             | Related request field, when the API sets it                                   |
| traceId           | Reference ID for support tickets                                              |
| retry\_after\_sec | Suggested wait before retrying (common on 429)                                |

On **429** responses you may also see **`Retry-After`** and **`X-RateLimit-*`** headers.

## Error reference

Read **`message`** for specifics — limits, model names, parameters, or which API to use.

## Quick guide

* **Fix first, then retry:** `authentication_error`, `billing_denied`, `model_not_found`, `invalid_request`, `unsupported_protocol`
* **Wait, then retry:** `rate_limit_error` — use `retry_after_sec` or `Retry-After` when available
* **Retry with backoff:** `service_unavailable` and in-stream streaming errors; contact support with **`traceId`** if it keeps failing
* **Usually ignore:** `client_aborted`
* **If `code` is missing:** rely on `error.type` and the HTTP status
* **Still stuck?** Contact support with **`traceId`**

## Streaming requests

When a **streaming** request fails (e.g. `stream: true`), how the error is returned depends on when the failure happens:

1. **Before any stream data is sent** — You get the same JSON `error` object and a non-2xx HTTP status as in the table above.
2. **After the stream has started** — HTTP may already be **200**. The failure is reported as an **error event inside the stream** (format depends on the API). The text is usually generic, for example *upstream stream error, please retry later*. Retry with backoff; if it keeps happening, [contact support](https://console.scitix.ai/model-inference/home) with **`traceId`**.
