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
🧩 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.
https://adverraai.com/hub/mcp.phpAuthorization: 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"
Open Claude Desktop › Settings › Developer › Edit Config and paste into claude_desktop_config.json (Node.js required), then restart Claude Desktop.
{
"mcpServers": {
"adverra-hub": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://adverraai.com/hub/mcp.php",
"--header", "Authorization:${AUTH_HEADER}"],
"env": { "AUTH_HEADER": "Bearer sk-adv-YOUR_KEY" }
}
}
}
Add to ~/.codex/config.toml and set ADVERRA_API_KEY before starting Codex · type /mcp to see the tools.
# ~/.codex/config.toml [mcp_servers.adverra-hub] url = "https://adverraai.com/hub/mcp.php" bearer_token_env_var = "ADVERRA_API_KEY" # Optional: let Codex use the Hub’s chat models directly [model_providers.adverra] name = "Adverra AI Hub" base_url = "https://adverraai.com/hub/api/v1" env_key = "ADVERRA_API_KEY" wire_api = "chat"
export ADVERRA_API_KEY="sk-adv-YOUR_KEY" codex
Add to ~/.gemini/settings.json and restart Gemini CLI · type /mcp to check.
// ~/.gemini/settings.json
{
"mcpServers": {
"adverra-hub": {
"httpUrl": "https://adverraai.com/hub/mcp.php",
"headers": { "Authorization": "Bearer sk-adv-YOUR_KEY" }
}
}
}
Add to the tools array of your xAI Responses API request (Grok will call the Hub’s tools itself).
"tools": [{
"type": "mcp",
"server_url": "https://adverraai.com/hub/mcp.php",
"server_label": "adverra-hub",
"authorization": "Bearer sk-adv-YOUR_KEY"
}]
Works with any OpenAI-compatible client such as the OpenAI SDK, Cursor, Cline or LibreChat — set the Base URL and API key like this.
from openai import OpenAI
client = OpenAI(base_url="https://adverraai.com/hub/api/v1", api_key="sk-adv-YOUR_KEY")
r = client.chat.completions.create(model="anthropic/claude-sonnet-5.5",
messages=[{"role": "user", "content": "Hello"}])
print(r.choices[0].message.content)
⚠️ 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