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

# Overview

> Base URL, authentication, and the conventions every endpoint shares.

## Base URL

```bash theme={null}
https://api.protege.sh/v1
```

The API follows the OpenAI chat completions request and response shapes, so
OpenAI-compatible SDKs work by changing the base URL. Protégé-specific fields are
additive: `task` on the request, and a `protege` object on the response.

## Authentication

Every request carries a bearer token.

```bash theme={null}
Authorization: Bearer $PROTEGE_API_KEY
```

`x-api-key: $PROTEGE_API_KEY` is accepted as an alternative.

Keys are scoped to an environment. Use separate keys for production and staging,
so staging traffic does not enter a task's production history.

This is the only credential involved. Protégé is managed, so there is no
bring-your-own-key header and no provider account to configure.

<Warning>
  The key authorises real inference spend. Never expose it in a browser, a mobile
  binary, or anything else a user can read. Call Protégé from your server.
</Warning>

## Content type

Requests are JSON. Streaming responses are
[server-sent events](/api-reference/chat-completions#streaming).

```bash theme={null}
Content-Type: application/json
```

## Versioning

The version is in the path. `/v1` will not change in a way that breaks an
existing request body.

Additive changes ship without a version bump, so parse responses leniently.
Unknown response fields should be ignored rather than treated as errors, since
the `protege` object gains fields over time.

## Rate limits

600 requests per key per minute, returned on every response. A looser per-IP
ceiling applies before a key is verified.

| Header                           | Meaning                                  |
| -------------------------------- | ---------------------------------------- |
| `x-ratelimit-limit-requests`     | Requests permitted in the current window |
| `x-ratelimit-remaining-requests` | Requests left in the current window      |
| `x-ratelimit-reset-requests`     | Seconds until the window resets          |

A `429` means the window is exhausted. Back off using `x-ratelimit-reset-requests`
rather than retrying immediately.

## Request IDs

Every response carries `x-request-id`. Include it when reporting a problem; it is
what lets us find the exact call, its route and its trace.

<Card title="Chat completions" icon="code" href="/api-reference/chat-completions">
  The endpoint, and the `task` parameter in full.
</Card>
