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

# Error Handling

> Comprehensive guide to handling errors in the BevorAI API

The BevorAI API uses conventional HTTP response codes and provides detailed error information to help you understand and resolve issues quickly.

## Response Format

All error responses follow a consistent JSON structure:

```json theme={null}
{
  "message": "Human-readable error description",
  "code": "error.code"
}
```

You can find the possible error codes by looking the `400` responses for each endpoint. They'll
be consistent across each endpoint, but it's a useless frame of reference.

## Error Codes

<Note>
  The complete list of error codes is defined in the [Error Codes](/api-reference/error-codes) page. They're also shown in the error response for each endpoint.
  Do not assume all responses will be 400 responses, we just use that as a generic in the docs.
</Note>

## Request Tracking

Every API request includes a unique request identifier in the response headers:

```
bevor-request-id: req_1234567890abcdef
```

This identifier is crucial for:

* **Debugging**: Reference the request ID when contacting support
* **Logging**: Track specific requests in your application logs
* **Support**: Help our team quickly locate and resolve issues

### Using Request IDs

Always capture and log the `bevor-request-id` header for error responses:

```javascript theme={null}
fetch('https://api.bevor.io/v1/scan', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    contract_address: '0x...',
    network: 'ethereum'
  })
})
.then(response => {
  const requestId = response.headers.get('bevor-request-id');
  
  if (!response.ok) {
    return response.json().then(error => {
      console.error(`Request ${requestId} failed:`, error);
      throw new Error(`${error.message} (Request ID: ${requestId})`);
    });
  }
  
  return response.json();
})
.catch(error => {
  console.error('Request failed:', error);
});
```

## Getting Help

If you encounter errors that aren't covered in this documentation:

1. **Check the request ID**: Include the `bevor-request-id` in your support request
2. **Review your request**: Ensure all required parameters are provided correctly
3. **Contact support**: Reach out to [contact@bevor.io](mailto:contact@bevor.io) with:
   * The error message and code
   * The request ID
   * Your API key (for authentication issues)
   * Steps to reproduce the error
