# Auth

Scoring requires an `ipa_live_` key. That covers `POST /v1/tutor`, `POST /v1/bench`, `PUT` and `GET /v1/uploads/{id}`, and `POST /mcp` when the method is `tools/call` (`score`, `heard_as`, `recognize`, `create_upload`, `score_attempt`). Send it as `Authorization: Bearer ipa_live_...` or `X-API-Key`. The window is `"tutor";q=120;w=60` on binding `TUTOR_KEY` (`namespace_id` `471702`), counted per key. The in-memory window is the fallback when the binding is absent.

A missing key is 401 `api-key-required` with `WWW-Authenticate: Bearer realm="https://ipa.raymati.com"`. An unrecognized or malformed key is 401 `api-key-rejected`. There is no anonymous scoring tier.

These stay public, with no key: the guides, `/openapi.json`, `/llms.txt`, `/llms-full.txt`, `/.well-known/*`, `/robots.txt`, `/sitemap.xml`, `/health`, the logo assets, and MCP `initialize` plus `tools/list`.

Request a key from the operator. The contact is <https://ipa.raymati.com/docs>. The operator runs `scripts/mint_key --label beta-1`, which prints a secret once and stores `sha256:` plus the hex digest. The record keeps the label, a short prefix, `created_at`, `audio_count`, and `ipa_count`. Audio is `audio_base64`, `audio_url`, an upload PUT, or `create_upload`. An `ipa` field counts as IPA, including when audio is also sent. No route lists secrets.

This host does not serve `/.well-known/oauth-protected-resource`. OAuth is not implemented. The API key is the credential.

## Later: MCP OAuth 2.1

Design only. This build does not implement an authorization server, a token endpoint, or Dynamic Client Registration.

The target is the [MCP authorization spec, 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization), which sits on OAuth 2.1. Both are drafts relative to a finished RFC for the MCP profile.

Client registration prefers [Client ID Metadata Documents](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration) over Dynamic Client Registration ([RFC 7591](https://www.rfc-editor.org/rfc/rfc7591.html)). The authorization server should advertise `client_id_metadata_document_supported`. DCR stays a deprecated fallback. Notes: [MCP blog, client registration](https://blog.modelcontextprotocol.io/posts/client_registration/).

Refresh tokens, from [SEP-2207](https://modelcontextprotocol.io/seps/2207-oidc-refresh-token-guidance):

- Clients should include `refresh_token` in `grant_types`.
- A client may request the `offline_access` scope only when the authorization server lists it in `scopes_supported`.
- The resource server should not advertise `offline_access`.
- Public clients must rotate refresh tokens (OAuth 2.1 section 4.3.1).

When that server exists, an OAuth access token can stand in for the API key. Until then, scoring still requires `ipa_live_`.
