Skip to main content
This guide helps you create and manage API keys for the Writer API. To create and manage API keys, you must be logged in to AI Studio.

About API keys

The Writer API uses token authentication for API requests. API keys are used as tokens, which you pass in the Authorization header of your requests:
Authorization: Bearer <api-key>

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

  1. From the AI Studio home page, open Admin settings in the navigation menu, then select API Keys.
  2. Click Create API agent in the top right corner of the page.
  3. 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, called Production. To create additional API keys:
  1. Open Admin settingsAPI Keys from the AI Studio home page (or from the sidebar on any AI Studio page).
  2. In the table, open the API agent you want to add a key to. The Manage keys tab shows that agent’s keys.
  3. Click Generate a new key.
  4. Give the key a name and click Generate.
  5. 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

  1. From the AI Studio home page, open Admin settingsAPI Keys.
  2. 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:
  1. From the AI Studio home page, open Admin settingsAPI Keys.
  2. In the table, open the agent you want to configure.
  3. 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:
  1. From the AI Studio home page, open Admin settingsAPI Keys.
  2. On the row for the agent you want to remove, open the Actions menu, then select Delete.
  3. Confirm the deletion by clicking Delete.

Delete an API key

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

Next steps