Authentication
JoyToken uses API key authentication. Model calls should be sent from your server using the header for the selected compatible API.
Common Request Headers
Do not send both Authorization and X-API-Key on the same request. If both are present, the current gateway reads X-API-Key first.
Choose a Protocol
OpenAI
Anthropic
Authentication header:
The same header authenticates both POST /openai/v1/responses and POST /openai/v1/chat/completions.
Set JOY_TOKEN_OPENAI_BASE_URL from Environments before running the example.
Server-Side Proxy
Browsers and mobile apps should not hold JoyToken API keys. Recommended structure:
OpenAI
Anthropic
To proxy the Responses API instead, send the same authenticated request to ${baseUrl}/responses. Keep the upstream path fixed in server code rather than accepting an arbitrary path from the browser.
Checks After Authentication
Rotate an API Key
- Create a new key with the same or stricter policy.
- Write it to your server-side secret manager or environment variables.
- Send one verification request with
X-Request-ID. - Confirm logs and usage in JoyToken Console.
- Disable or revoke the old key.
