AyaSpeech LogoBeta

Authentication

All API requests require an API key, passed in the x-api-token request header.

API Key

Include your token in every request using the x-api-token header:

curl -H "x-api-token: your_api_token" https://api.ayaspeech.ayadata.ai/translate

API Keys

  • Your first API key is created when you activate your account in the dashboard.
  • Premium and custom plans can create additional API keys, e.g. one per environment.
  • Keys don't expire. They stop working only when you disable or regenerate them, or when AyaData revokes one (you'll get an email with the reason).
  • All of an account's keys share the same limits.

Managing API Keys

Creating, regenerating and disabling API keys is done from the API keys page of your dashboard. The only programmatic endpoint is self-revocation:

EndpointAuthDescription
POST /auth/revokeAPI keyProgrammatically disable the API key making the request. Useful for automated key rotation in CI/CD pipelines.
curl -X POST "https://api.ayaspeech.ayadata.ai/auth/revoke" \
  -H "x-api-token: your_api_token"

Security Best Practices

Never commit API keys to source control. Use environment variables or a secrets manager.

Regenerate a key straight away if you suspect it was exposed, or after team member changes.

Use a separate key per environment. Then you can disable one without affecting the others.

Keys are shown once. After creating or regenerating a key, it is displayed only once. Store it immediately.

Error Responses

If authentication fails, the API returns one of these responses:

401 Unauthorized

Invalid or missing API key.

403 Forbidden

Email not verified, key revoked (TOKEN_REVOKED), account suspended (ACCOUNT_SUSPENDED), or a custom plan outside its dates. The error code says which; the message includes the reason when AyaData made the change.