Skip to main content
Requests to the Ditto API authenticate with an API key in the Authorization header. API keys give programmatic access to all data in your workspace, so keep them secret: never commit them or ship them in client-side code.

Create an API key

  1. In Ditto, open Developers. If the page offers to Enable Developer Integrations, enable them first. Plans that do not include developer integrations can start a trial from this page.
  2. Under API keys, click + Create API key.
  3. Give the key a name and click Create.
  4. Copy the key now. It is not shown again after you close the dialog.
Keys are managed from the same page. Creating one key per system (CI, an agent, an integration) makes it easy to rotate or remove one without affecting the others.

Authenticate a request

Pass the key in the Authorization header with the token scheme:
Example:

The CLI, the MCP server, and agents

API keys are for calling the REST API directly and for CI. The developer-facing tools log in with your Ditto account instead, so no key is needed on a developer’s machine:
  • The CLI logs in through your browser with npx @dittowords/cli login. Only a CI job without a browser needs an API key, set as DITTO_TOKEN. See Install and log in.
  • The MCP server logs you in with OAuth the first time a client connects. It accepts Authorization: token <your-api-key> for CI and headless clients. See Connect the Ditto MCP.
  • The Ditto Specs CLI has no login flow yet and reads DITTO_TOKEN. See Specs CLI setup.