This guide will help you create and manage API keys for the Writer API.

All actions are performed in 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, click on Build an agent.
  2. Select API as the agent type.
  3. Click on the agent’s name to rename it to something description, and provide a short description of your agent to help you keep track of what it does.

Create an API key

Each API agent has a default API key, called Production. To create additional API keys:

  1. Navigate to the API application. From the AI Studio home page, click on API Keys in the navigation menu.
  2. Click on Generate a new key.
  3. Give the key a name and click Generate.
  4. To see the API key value, click on Reveal key next to the key name.

Store the API key in a secure location. We recommend using a .env file to store the key.

See your API agents and API keys

  1. From the AI Studio home page, click on API Keys in the navigation menu.
  2. Click on an individual agent’s tile to navigate to the agent.
  3. To see the API key value, click on Reveal key next to the key name.

Manage API agent permissions

API permissions are set at the agent level. To manage API agent permissions:

  1. From the AI Studio home page, click on API Keys in the navigation menu.
  2. Click on an individual application’s tile to navigate to the application.
  3. Under Capabilities, toggle to enable or disable 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, click on API Keys in the navigation menu.
  2. Click on the dropdown menu () next to the agent you want to delete, and 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, click on API Keys in the navigation menu.
  2. Click on an individual application’s tile to navigate to the application.
  3. Click on the dropdown menu () next to the key you want to delete, and select Revoke.
  4. Confirm the deletion by clicking Revoke key.