API Documentation

Access every model through one API — chat models are compatible with the OpenAI SDK

1. Getting started

Base URLhttps://adverraai.com/hub/api/v1
AuthenticationAuthorization: Bearer sk-adv-…
Create an API keyDashboard & API Keys
Pricing unitCredits (1 THB = 1 credit)

🔑 Create an API key

Sign in with Google to create an API key

Sign in with Google

🛡️ 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

🧩 Use via MCP (Model Context Protocol)

Connect the Hub to AI assistants like Claude, Codex, Gemini and Grok so they can generate images, videos, music and speech, or ask other models, right from the chat.

MCP URLhttps://adverraai.com/hub/mcp.php
TransportStreamable HTTP
AuthAuthorization: Bearer sk-adv-…

Available tools: list_models · get_balance · chat · generate_image · generate_video · generate_music · text_to_speech · get_task

🤖 Use with AI tools

Pick your tool and copy the config (replace sk-adv-YOUR_KEY with your key, or create a key above and it will be filled in).

Open a terminal and paste this command, then type /mcp in Claude Code to check the connection.

claude mcp add --transport http adverra-hub https://adverraai.com/hub/mcp.php \
  --header "Authorization: Bearer sk-adv-YOUR_KEY"

⚠️ This key spends your credits. Don’t share it, and keep it in an environment variable rather than hard-coding it.

5. Other

GET https://adverraai.com/hub/api/v1/balance
GET https://adverraai.com/hub/api/v1/tasks?limit=20

Error codes

401Invalid API key
402Insufficient credits — please top up
404Model / task not found
429Too many requests
5xxTemporary processing error (no credits charged)