About API keys
The Writer API uses token authentication for API requests. API keys are used as tokens, which you pass in theAuthorization header of your requests:
API agents and API keys
Writer API keys are attached to AI Studio API agents. API permissions and scopes are set at the agent level. Within an API-based agent, you can create multiple API keys that share the permissions of the agent. To create keys with different permissions, create multiple API agents.Create an API agent
- From the AI Studio home page, open Admin settings in the navigation menu, then select API Keys.

- Click Create API agent in the top right corner of the page.
- When the agent opens, select the title field to rename the agent, and enter a short description so you can recognize what the agent is for.
Create an API key
Each API agent has a default API key, calledProduction. To create additional API keys:
- Open Admin settings → API Keys from the AI Studio home page (or from the sidebar on any AI Studio page).
- In the table, open the API agent you want to add a key to. The Manage keys tab shows that agent’s keys.
- Click Generate a new key.

- Give the key a name and click Generate.
- As soon as the key appears, select Copy and store the value in a secure place. You can’t view or reveal the full key again after you leave that step.
Store the API key in a secure location, such as a
.env file (for example, WRITER_API_KEY=<API_KEY>). If you lose a key, revoke it and generate a new one—you can’t recover the original secret.See your API agents and manage API keys
- From the AI Studio home page, open Admin settings → API Keys.
- In the table, open an agent’s row to go to that agent.

You can’t view or reveal the full API key after it’s created. Copy it the first time it’s shown and store it securely. To replace a lost key, generate a new key from the API agent page.
Manage API agent permissions
API permissions are set at the agent level. To manage API agent permissions:- From the AI Studio home page, open Admin settings → API Keys.
- In the table, open the agent you want to configure.
- Under Capabilities, toggle to enable or turn off a specific capability for the API key.
Capabilities map to Writer API endpoints. Click Read more in the API Documentation column to learn more about the specific endpoints.
Delete an API agent
To delete an API agent:- From the AI Studio home page, open Admin settings → API Keys.
- On the row for the agent you want to remove, open the Actions menu, then select Delete.

- Confirm the deletion by clicking Delete.
Delete an API key
To delete an API key:- From the AI Studio home page, open Admin settings → API Keys.
- Open the agent in the table, then stay on the Manage keys tab.
- On the row for the key you want to remove, open the Actions menu, then select Revoke.

- Confirm by clicking Revoke key.
Next steps
- Make your first API call using your API key
- Read the chat completion endpoint reference
- Review API error codes if requests fail authentication