API Documentation
Access every model through one API — chat models are compatible with the OpenAI SDK
1. Getting started
https://adverraai.com/hub/api/v1Authorization: Bearer sk-adv-…🛡️ Security
- API keys are stored hashed — not even admins can see the full key — and are shown only once.
- Never put an API key in front-end JavaScript or mobile apps. Call the API from your own server only, and never commit keys to GitHub.
- Use a separate key per app. If a key leaks, delete it in the dashboard and create a new one — the old key stops working immediately.
- IPs that send a wrong key more than 20 times in 10 minutes are blocked temporarily, and requests per key are rate-limited.
- Concurrent tasks per model are limited to prevent accidental overspending.
- All traffic is HTTPS; result file links are signed, can’t be guessed, and expire after 24 hours.
2. List models
GET https://adverraai.com/hub/api/v1/models
Returns the id, type (llm / image / video / audio) and credit price of every model. Each model page also shows its Model ID.
3. Chat / text (OpenAI-compatible)
POST https://adverraai.com/hub/api/v1/chat/completions
{
"model": "anthropic/claude-sonnet-5.5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello"}
],
"stream": true,
"temperature": 0.7,
"max_tokens": 1024
}
Works with the OpenAI SDK by setting base_url to the Base URL above · Billed by actual tokens · Non-stream responses include usage.credits · Streams end with a {"object":"hub.billing"} event
4. Image / video / music (async tasks)
POST https://adverraai.com/hub/api/v1/images/generations
POST https://adverraai.com/hub/api/v1/videos/generations
POST https://adverraai.com/hub/api/v1/music/generations
POST https://adverraai.com/hub/api/v1/generate
{
"model": "kling-v3",
"prompt": "a golden cat running on a meadow, cinematic",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"image_urls": ["https://example.com/first-frame.jpg"]
}
→ 200 OK
{
"id": "task_9f2c…",
"status": "queued",
"credits_held": 12.5,
"output": []
}
GET https://adverraai.com/hub/api/v1/tasks/{id}
→ {
"id": "task_9f2c…",
"status": "completed", // queued | processing | completed | failed
"progress": 100,
"credits_charged": 11.8,
"output": [{"type": "video", "url": "https://…/video.mp4", "download_url": "https://adverraai.com/hub/media.php?t=…&dl=1"}]
}
Credits are reserved at an estimated price on submission and adjusted to the actual cost on completion · Failed tasks are fully refunded · Poll the status every 3–5 seconds · Download result files within 24 hours
Common parameters: prompt, image_urls, size / aspect_ratio, resolution, duration, n, negative_prompt, seed. Credits are reserved at an estimated price when you submit and adjusted to the actual cost when the task finishes (failed tasks are fully refunded).
🔊 Text-to-Speech
POST https://adverraai.com/hub/api/v1/audio/speech
{
"model": "elevenlabs/eleven-v4",
"input": "สวัสดีครับ ยินดีต้อนรับ",
"voice": "george"
}
→ {"id":"task_…","status":"completed","output":[{"type":"audio","url":"…","download_url":"…"}]}
Returns an mp3 immediately · billed per character · see each model’s voices on its model page
🧩 Connect AI agents (MCP)
Claude Code, Claude Desktop, claude.ai, Codex, Cursor, VS Code — one-click connect. See the dedicated MCP page.
Open MCP connect page →💰 Check balance
Returns the remaining credits of the API key owner. Free. Same as GET /v1/me; in MCP use the get_balance tool.
curl https://adverraai.com/hub/api/v1/balance \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"object": "balance",
"email": "[email protected]",
"credits": 1250.5,
"credits_thb": 1250.5,
"credit_unit": "1 credit = 1 THB",
"usage": { "credits_used": 830.25, "tasks": 57 },
"topup_url": "https://adverraai.com/hub/topup.php",
"checked_at": "2026-11-26T09:00:00+00:00"
}
5. Other
GET https://adverraai.com/hub/api/v1/balance GET https://adverraai.com/hub/api/v1/tasks?limit=20