API keys and authentication
Create and revoke API keys, understand how they are scoped, and authenticate requests with a Bearer token.
Manage API keys
Create and revoke keys on the API keys page of the dashboard.
- Open API keys and choose Create key.
- Give the key a recognizable name.
- Copy the key. The dashboard shows the plaintext key once; store it in your password manager or secret store before closing the dialog.
To revoke a key, use its action in the keys table. Requests using a revoked key stop working immediately.
The fast CLI creates its own project-scoped key, named for your
machine, the first time you connect a coding agent.
Project scoping
API keys are scoped to a project. Select a team and project using the pickers at the top of the dashboard before creating a key. The key is granted read and write access to the selected project, and usage made with it is reported for that project. If no valid project selection is saved for that team in this browser, the dashboard selects its first available project. See Getting started.
Permissions
Keys created in the dashboard have read and write access to their project.
Authentication
Pass the key as a Bearer token in the Authorization header, or set it as the
API key in whichever SDK you use:
curl https://api.inference.net/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{ "role": "user", "content": "Hello" }]
}'The same key works across every endpoint:
- Synchronous API:
https://api.inference.net/v1, including the Anthropic-compatible/v1/messagesendpoint - Asynchronous API:
/v1/slowand the Group API - Batch API:
https://batch.inference.net/v1 - Generation results:
/v1/generation/{id} - Webhooks: asynchronous requests that reference a webhook registered for your team
The API reads only Authorization: Bearer. Clients built for the Anthropic API
must send the key as a Bearer token (for example, Claude Code's
ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY).
Best practices
- Keep API keys out of source control.
- Rotate keys periodically.
- Store keys in environment variables in your application.