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

# Errors and rate limits

# Errors and Rate Limits

This guide defines v1 error behavior and request-throttling expectations.

## Error Envelope

All non-2xx responses use:

```json theme={null}
{
  "code": "string",
  "message": "string",
  "details": {},
  "request_id": "string"
}
```

## Core Error Codes

* `BAD_REQUEST` (`400`)
* `UNAUTHORIZED` (`401`)
* `NOT_FOUND` (`404`)
* `TOO_MANY_REQUESTS` (`429`)
* `INTERNAL_ERROR` (`500`)

## Rate Limit Behavior

* Rate limits apply per API key.
* `429` responses include `Retry-After`.
* Clients should use exponential backoff for retries.
