> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.gradii.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.gradii.ai/_mcp/server.

# Authentication

> Authenticate Gradii API requests with bearer tokens.

All protected Gradii API endpoints use HTTP bearer authentication.

```http
Authorization: Bearer iai_your_token_here
```

Keep tokens out of client-side code, public repositories, screenshots, and support tickets. Rotate tokens when an integration owner changes or a credential may have been exposed.

## Token format

Gradii API tokens use the `iai_` prefix.

```txt
iai_your_token_here
```

## Error responses

Authentication failures return standard JSON error payloads with a machine-readable `code`.

```json
{
  "success": false,
  "error": "Invalid or missing token",
  "code": "AUTH_FAILED",
  "message": "Authentication failed"
}
```