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
| Type | Tier | Description |
|---|---|---|
| Standard | Free & Premium | Default token issued on signup. Can be rotated or revoked from the dashboard. |
| Service | Premium only | Long-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:
| Endpoint | Auth | Description |
|---|---|---|
| POST /auth/revoke | API token | Programmatically 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:
Invalid or missing API token.
Email not verified, or token revoked.