Skip to main content

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.

DODON'T
Store in environment variablesHardcode in source code
Use secrets manager (GCP Secret Manager, AWS Secrets)Commit to git repositories
Rotate keys periodicallyShare 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

PlanDaily RequestsRate LimitBatch Size
Free10010 req/min10 texts
Pro1,00060 req/min100 texts
Enterprise100,000600 req/min1000 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

CodeMeaningDescription
400Bad RequestInvalid request format or parameters
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient tier for requested resource
404Not FoundModel or dataset not found
429Too Many RequestsRate limit exceeded
500Server ErrorInternal 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