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

# Authentication

> API keys, rate limits, and error codes for Consus Gateway.

All API requests (except `/health`) require an API key. Authentication is handled at the API Gateway layer before requests reach the application.

## System Use Notification

This is a U.S. Government information system. By accessing this system, you acknowledge and consent to the following:

* This system is provided for authorized use only.
* Usage may be monitored, recorded, and subject to audit.
* Unauthorized use of this system is prohibited and subject to criminal and civil penalties.
* Use of this system constitutes consent to monitoring and recording.

This notice satisfies NIST SP 800-53 AC-8 (System Use Notification) for programmatic API access.

## Passing Your API Key

Include your key in the `x-api-key` header:

```bash theme={null}
curl https://api.consus.io/v1/models \
  -H "x-api-key: $CONSUS_API_KEY"
```

When using the OpenAI SDK, pass it via `default_headers`:

```python theme={null}
client = OpenAI(
    base_url="https://api.consus.io/v1",
    api_key="dummy",  # Required by SDK but not used
    default_headers={"x-api-key": "CONSUS_API_KEY"},
)
```

<Note>
  The OpenAI SDK requires an `api_key` value and sends it as a `Bearer` token in the `Authorization` header. Consus Gateway ignores this header. Authentication is performed via the `x-api-key` header, which is validated at the API Gateway layer before your request reaches the application. Set `api_key` to any non-empty string.
</Note>

## Rate Limits

See [Rate Limits](/rate-limits) for API key limits and per-model upstream limits.

## Error Responses

| Status Code             | Meaning                              |
| ----------------------- | ------------------------------------ |
| `401 Unauthorized`      | Authentication failed                |
| `403 Forbidden`         | Invalid or missing API key           |
| `429 Too Many Requests` | Rate limit or monthly quota exceeded |

## Key Management

To get an API key or adjust rate limits, [book a call](https://cal.com/emagliarditi/consus-gateway-intro-discussion) with our team.
