AyaSpeech Logo

Authentication

All API requests require authentication via an API token passed in the request header.

API Token

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

Token Types

TypeTierDescription
StandardFree & PremiumDefault token issued on signup. Can be rotated or revoked from the dashboard.
ServicePremium onlyLong-lived token for server-to-server integrations. No expiry unless revoked.

Token Management

Token activation, rotation, revocation, and service token creation are all managed from your dashboard. The only programmatic endpoint is self-revocation:

EndpointAuthDescription
POST /auth/revokeAPI tokenProgrammatically revoke the token 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 tokens to source control. Use environment variables or a secrets manager.

Rotate tokens regularly if you suspect a compromise or after team member changes.

Use service tokens for production. They provide dedicated access without tying to a user session.

Token shown once. After activation or rotation, the token 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 token.

403 Forbidden

Email not verified, or token revoked.