Skip to content

Create API Key

An API key identifies the caller and determines which account balance, token quota, and restriction policies a request can use. The dashboard may also refer to an API key as a token.

Create a Token

When you create tokens in the dashboard, separate them by purpose:

  1. Open the DDTokens dashboard.
  2. Go to the token or API key management page.
  3. Create a token with a clear name such as prod-backend, staging-api, or local-test.
  4. Set its quota, expiration time, and optional restrictions.
  5. Copy the token value immediately and store it securely.

For security reasons, the dashboard usually does not display the complete token indefinitely. Make sure you have saved it before leaving the creation page.

Account Balance and Token Quota

DDTokens billing is usually subject to two types of limits:

  • Account balance: the total available balance in your account.
  • Token quota: the spending limit assigned to an individual API key.

Requests fail when the account balance is insufficient, even if the token still has quota. When a token quota is exhausted, that token may stop working until you adjust its quota or use a different token.

Recommendations

  • Use separate tokens for production, testing, and local development.
  • Give test tokens a small quota to prevent unexpected charges from scripts or loops.
  • Do not put tokens in source code, README files, screenshots, or public issues.
  • Disable or delete tokens that are no longer used.
  • Rotate production tokens regularly and keep a rollback window.

Use a Token in Requests

OpenAI-compatible endpoints use the Authorization request header:

http
Authorization: Bearer sk-your-key-here

For local development, use an environment variable:

bash
export DDDT_API_KEY="sk-your-key-here"

Read the environment variable in your code instead of hard-coding the key in a file.

© 2026 DDTokens