Skip to main content
Most requests need an API key sent as a Bearer token. A key created in the dashboard is a production key for https://api.protoface.com, ready to use without an activation step or an environment switch. One key covers both media generation and realtime sessions. The full secret is shown once when you create the key. Save it then. The key list later shows only sk_live_ plus the last four characters, such as sk_live_ABCD. This short identifier cannot authenticate. sk_live_ is the only customer API key prefix; it does not indicate that a request has authenticated successfully.
Only GET /v1/status and GET /v1/billing/plans do not require a key. Most other /v1 calls use the Bearer header above; Agora uses X-API-Key. Keep the full secret in the environment. Replace sk_live_... in examples with that secret.

Test your key

GET /v1/models returns 200 for a working key. Your plan and credit balance do not gate this call, including on the Free plan. Insufficient credits on a billable call return 402, not an authentication error.
The -H line is required. A bare GET https://api.protoface.com/v1/models without the header returns 401 with error.code: "missing_authorization".

Agora

Agora Generic Avatar endpoints POST /v1/agora/session/start and DELETE /v1/agora/session/stop use the same full API key in a different header:
Send the secret directly as the header value, without a Bearer scheme. An absent or empty X-API-Key returns 401 with error.code: "missing_api_key", even if an Authorization header is present.

Troubleshoot authentication

Use the stable error.code to choose the next step: Rotating keys does not fix missing_authorization if the request still sends a missing or malformed header. Check the outgoing request in the process making the call, including whether a proxy or redirect removes the header. Inspect it locally with the secret redacted; do not share the secret or an unredacted request with support. Include the request_id if you need help. Authentication codes lists the exact parsing conditions. error.message provides readable context, but its wording can change.

Scopes

A key is either unrestricted, with access to the whole API, or limited to named scopes. Generating media needs both scopes below, since creating a run and reading its result are separate permissions. A valid key without the required scope returns 403 with error.code: "api_key.scope_required".

Browsers and embeds

Keep API keys server-side. Anything shipped to a browser is readable. Embeds let a visitor reach an avatar directly, using a public embed ID (emb_...) that carries no account access.