Authentication & API Setup
All ZQ Platform APIs share common authentication, rate limiting, and error handling.
Base URL: https://zq-api-gw-78psrgmc.uc.gateway.dev
Authentication
All API requests require an API key passed in the x-api-key header.
curl -H "x-api-key: $ZQ_API_KEY" \
https://zq-api-gw-78psrgmc.uc.gateway.dev/v1/models
Getting an API Key
Contact contact@zettaquant.ai to request access.
Keeping Your API Key Safe
warning
Treat your API key like a password.
| DO | DON'T |
|---|---|
| Store in environment variables | Hardcode in source code |
| Use secrets manager (GCP Secret Manager, AWS Secrets) | Commit to git repositories |
| Rotate keys periodically | Share keys between environments |
Example: Using Environment Variables
# Set in your shell profile (~/.bashrc or ~/.zshrc)
export ZQ_API_KEY="your_api_key_here"
export ZQ_BASE_URL="https://zq-api-gw-78psrgmc.uc.gateway.dev"
# Use in requests
curl -H "x-api-key: $ZQ_API_KEY" $ZQ_BASE_URL/v1/models
Rate Limits
| Plan | Daily Requests | Rate Limit | Batch Size |
|---|---|---|---|
| Free | 100 | 10 req/min | 10 texts |
| Pro | 1,000 | 60 req/min | 100 texts |
| Enterprise | 100,000 | 600 req/min | 1000 texts |
- Limits reset at 00:00 UTC daily
- Exceeding limits returns
429 Too Many Requests - Check your usage:
GET /v1/usage/me
Handling Rate Limits
import time
import requests
def request_with_retry(url, headers, max_retries=3):
for attempt in range(max_retries):
response = requests.get(url, headers=headers)
if response.status_code == 429:
wait_time = 2 ** attempt
print(f"Rate limited. Waiting {wait_time}s...")
time.sleep(wait_time)
continue
response.raise_for_status()
return response.json()
raise Exception("Max retries exceeded")
Error Codes
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Invalid request format or parameters |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Insufficient tier for requested resource |
404 | Not Found | Model or dataset not found |
429 | Too Many Requests | Rate limit exceeded |
500 | Server Error | Internal error (contact support) |
Error Response Format:
{
"detail": "Description of the error"
}
Check Your Usage
Monitor your API usage with the usage endpoint.
GET /v1/usage/me
Example:
curl -H "x-api-key: $ZQ_API_KEY" \
"$ZQ_BASE_URL/v1/usage/me?days=7"
Response:
{
"email": "user@company.com",
"tier": "pro",
"daily_limit": 1000,
"today": {
"date": "2026-01-22",
"used": 150,
"remaining": 850,
"percent_used": 15.0
},
"period": {
"days": 7,
"total_requests": 1200
},
"lifetime_requests": 5000
}
Next Steps
- Models Service → - Run inference on financial AI models
- Insights Service → - Access pre-computed metrics