# Authentication

The Web API uses an ordinary relay.fast API key, the same key that calls the models. There is no separate web key and no separate balance. The key can be sent with or without the `sk-` prefix.

| Header | Where it works |
| --- | --- |
| `Authorization: Bearer sk-...` | Every native path, the compatibility paths and the MCP server. Use this one unless your client needs another form. |
| `X-API-KEY: sk-...` | The compatibility paths and the MCP server. Header names are case-insensitive. |

The key is accepted in a header only. A key in the query string is refused with `400 invalid_request`, because query strings end up in logs.

When both headers are sent, `Authorization` wins. A key that is missing, unknown, disabled, expired or exhausted gets `401 invalid_token` with the message `Invalid token`, without saying which case applies.

## Key settings

The settings of the key apply to web calls exactly as they do to model calls. These are its spending limit (`403 pre_consume_token_quota_failed`), its expiry and its IP allowlist (`403 access_denied`). A call whose maximum price the balance does not cover gets `402 insufficient_user_quota`.

websearch.fast uses relay.fast accounts. Keys of other sites do not work here.
