Skip to contentNewDeepSeek V4.1 Flash 1017 is now availableTry it now
Docs / API keys and authentication

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.

  1. Open API keys and choose Create key.
  2. Give the key a recognizable name.
  3. 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. Keys created in the dashboard belong to the first project of the team selected in the dashboard sidebar, and usage made with a key is reported for that 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
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/messages endpoint
  • Asynchronous API: /v1/slow and 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.