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

# Errors & troubleshooting

> Identify request problems and retry only when appropriate.

Check the HTTP status before reading search results. Error responses include a `log_id` when available; retain it when reporting a failed request.

```json theme={null}
{
  "code": "400",
  "log_id": "example-request-id",
  "message": "count must not exceed 50"
}
```

| Status        | Meaning                          | What to do                                            |
| ------------- | -------------------------------- | ----------------------------------------------------- |
| `400`         | Invalid request                  | Check JSON, a non-empty query, and `count` ≤ 50.      |
| `401`         | Authentication failed            | Check your Bearer token and that the key is active.   |
| `403`         | Access denied                    | Check account access in the Dashboard.                |
| `429`         | Rate or daily allowance exceeded | Reduce bursts; check usage and the UTC reset time.    |
| `500`         | Server error                     | Retry a limited number of times with backoff.         |
| `502`         | Search provider failure          | Retry with backoff; keep the `log_id` if it persists. |
| `503` / `504` | Unavailable or timeout           | Allow time before a bounded retry.                    |

## Read the error safely

Depending on the response path, the error text can appear in `message` or `msg`, and `code` can be a string or number. Use HTTP status as the primary success check.

## Retry policy

Retry transient failures with an increasing delay and jitter, and set a maximum attempt count. A daily quota error requires waiting until the next automatic reset; repeated immediate retries will not restore allowance.

When reporting a problem, include the HTTP status, time in UTC, and `log_id`. Do not share your API key.
