API Keys
What are API Keys
API Keys are tokens that authenticate requests to Toqan Router. A key covers one project, or every project in the workspace when created without one through the API. Its permissions limit what it can do. Two key types are available, chosen by the key’s owner.User keys
Tied to a specific user account. Automatically revoked if the user is removed from the organization or the project one of their keys is bound to. Use user keys for personal use and local development.Service account keys
Not tied to any individual user, with a lifecycle independent of user membership. Only workspace admins can create service account keys. Use service account keys for production systems, so access does not break when a team member leaves.Viewing API Keys
Navigate to Settings > API Keys to see all keys across projects. The table shows the following columns:
Use the menu to filter by Type or Permissions.
Creating an API Key
1
Open the creation panel
Navigate to Settings > API Keys and select Secret key. The Create new secret key sheet opens with Owned by, Name, Project, Permissions, and Expiration.
2
Choose an owner
Under Owned by, select You to create a User key, or Service account to create a key not tied to any individual user.
3
Set name and project
Enter a Name for the key and select the Project it will have access to.
4
Set permissions
Choose a permission preset. See Permissions below.
5
Set expiration (optional)
Set an Expiration date if the key should automatically become inactive after a certain date.
6
Create and copy the key
Select Create secret key. A Save your key dialog appears showing the token and its permissions summary.Click Copy to copy the token.
To cap a key’s cost, token, or requests-per-minute usage, attach a Budget to it. Budget limits reset on the configured period. See Rate limits & quotas for what the gateway enforces at each layer.
Permissions
With Restricted, set the permission for each resource individually: None, Read, or Write.
Write permission automatically includes Read where Read is available for the endpoint.
Restricted permission resources
Restricted permission resources
Managing Keys
Select the menu on any key to access the following actions:- Edit: update the name, permissions, or expiration date. The owner type cannot be changed after creation.
- Duplicate: opens the creation panel pre-filled with the key’s current settings.
- Delete: permanently removes the key. This cannot be undone.
A Revoked status means the key belonged to a user who was removed from the organization or project, or it has been revoked manually. Revocation is permanent.
Management Keys
Overview
Management Keys are only available to workspace admins. The Management Keys page is not visible to non-admin members.
Use cases
- Automating workspace provisioning via the API.
- Delegating API key rotation to a deployment pipeline without granting full admin access.
- Letting a billing automation script read and update Budgets without exposing API key management.
Workspace administration endpoints
API keys cannot administer API keys or Budgets, so those two families need a Management Key. Project and Smart Router management follows the key’s scope: an all-projects key can create, update, and delete them, a single-project key cannot.View Management Keys
Open Management Keys in the Settings sidebar, under Organization, to view all keys in the workspace. Click any row to open the edit panel and update the key’s name, permissions, or expiration date. Hover a row and click for additional options:- Edit: open the edit panel to update the key’s name, permissions, or expiration date.
- Duplicate: create a new key with the same permissions.
- Delete: permanently remove the key from the workspace.
Create a Management Key
1
Open the creation panel
In Settings → Organization, open Management Keys and click Key.
2
Enter a name
Enter a Name for the key (required, max 128 characters).
3
Set permissions
Select a Permissions mode, default is All. See Permission modes below.
4
Set expiration (optional)
Set an Expiration date if the key should stop authenticating after a certain date.
5
Create and copy the key
Click Create key. A Save your key panel appears showing the token.
Permission modes
Capabilities
The Restricted mode shows one row per capability. None grants no access to that capability, Read lists and views its resources, and Write also creates, updates, and deletes them. A ✗ marks a level the picker omits for that capability, which then takes only None or Read.Management Keys are not available through MCP. Use the REST API to manage keys programmatically.
Manage keys programmatically
Create, update, revoke, and delete API Keys and Management Keys with the API instead of the console. The full endpoint reference is on the API Keys reference and Management Keys reference pages.Authenticating with a Management Key
Key management requests authenticate with a Management Key, never an API key. API Keys are inference credentials scoped to project resources and cannot administer keys.- Pass a Management Key as the bearer token, or as the SDK API key.
- A Management Key with the
api-keywrite grant can list, create, update, revoke, and delete API Keys.
api_keys / apiKeys and management_keys / managementKeys: API Keys SDK, Management Keys SDK.
Key lifecycle in code
These examples use a Management Key asTOQAN_API_KEY.
Create a project-scoped key with restricted permissions:
Project scope
project_scope decides which projects the key reaches. On create, omit it and the key reaches every project in the workspace.
mode takes the short values all and single, or the enum values PROJECT_SCOPE_MODE_ALL and PROJECT_SCOPE_MODE_SINGLE. The nested spelling reaches the same scopes: {"all": {}} or {"single": {"project_id": "..."}}. Send one spelling per request.
projects is the legacy single-element array that older clients send instead of project_scope. It sets a single-project scope, and when a request carries both fields they must name the same project.
Permission model
permission_mode selects the preset:
With
restricted, the access map assigns a level to each domain. Write includes read:
The capability catalog lists the domains a key can be granted:
GET /v2/api-keys/capabilities returns each domain with its id, display name, group, and read / write availability. Use the catalog to discover grantable domains at runtime instead of hard-coding the list.
The access keys are the id values the catalog returns (responses, model), not the display_name values (Responses, Models). For example, a restricted key that may run Responses and read the model catalog in every project:
The secret is returned once
The create response returns the raw token exactly once, in thesk-orq-<id>-<secret> format. Store it immediately: the API stores only a displayable token_prefix and a hash of the secret, so list and retrieve responses never include the token.
For how every other kind of secret is stored, read, and rotated, see Secrets management.

