API Documentation
Base: https://zetta-api.com
π Authentication: All
/api/v1/* endpoints require an API key. Get yours at
/app.
Header:
Authorization: Bearer la-xxxxxxxxxxxxxxxx
π¬ Chat Completions
POST/api/v1/chat/completions
OpenAI-compatible chat endpoint. Supports GPT-4o, Claude, DeepSeek, Gemini.
# cURL
curl -X POST https://zetta-api.com/api/v1/chat/completions \
-H "Authorization: Bearer la-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'
# Python
import requests
r = requests.post("https://zetta-api.com/api/v1/chat/completions",
headers={"Authorization": "Bearer la-xxx"},
json={"model": "gpt-4o", "messages": [{"role":"user","content":"Hi"}]})
print(r.json())
# JavaScript
const r = await fetch("https://zetta-api.com/api/v1/chat/completions", {
method: "POST",
headers: { "Authorization": "Bearer la-xxx", "Content-Type": "application/json" },
body: JSON.stringify({ model: "gpt-4o", messages: [{role:"user",content:"Hi"}] })
});
const data = await r.json();
Request Body
| Field | Type | Required | Description |
| model | string | β
| Model ID (see model list) |
| messages | array | β
| Array of {role, content} objects |
| temperature | float | | 0β2. Default: 0.7 |
| max_tokens | int | | Max output tokens |
| stream | bool | | Enable SSE streaming |
πΌοΈ Image Generation
POST/api/v1/images/generate
Generate images from text prompts. Supports SDXL, Flux, DALLΒ·E.
# cURL
curl -X POST https://zetta-api.com/api/v1/images/generate \
-H "Authorization: Bearer la-xxx" \
-H "Content-Type: application/json" \
-d '{"prompt":"A cyberpunk cat","size":"1024x1024","n":1}'
π΅ Music Generation
POST/api/v1/music/generate
Generate music from text descriptions + style tags.
# cURL
curl -X POST https://zetta-api.com/api/v1/music/generate \
-H "Authorization: Bearer la-xxx" \
-H "Content-Type: application/json" \
-d '{"prompt":"Epic orchestral theme","duration":30,"style":"cinematic"}'
GET/api/v1/music/status/{task_id}
Check generation status. Returns completed with audio URL when done.
GET/api/v1/music/history/{user_id}
List all music generation tasks for a user.
π¬ Video Processing
POST/api/v1/video/upload
Upload a video file for processing (subtitle, trim, etc.).
POST/api/v1/video/subtitle
Generate subtitles for an uploaded video (Whisper ASR).
POST/api/v1/video/trim
Trim video to specified start/end times.
GET/api/v1/video/status/{task_id}
Check video processing status.
GET/api/v1/video/download/{task_id}/{filename}
Download processed video file.
π API Key Management
GET/api/v1/keys
List all API keys for authenticated user. Requires JWT or API key.
POST/api/v1/keys/create
Generate a new API key. Returns the key (only shown once).
π° Credits & Payments
GET/api/v1/credits/packages
List available credit packages and pricing.
GET/api/v1/credits/pricing
Get current pricing for all models (per-1K-token rates).
POST/api/v1/credits/usdt
Create a USDT TRC-20 payment invoice (NOWPayments). Returns payment address.
GET/api/v1/credits/usdt-status/{order_id}
Check USDT payment status.
π Usage & History
GET/api/v1/usage
Get caller's credit usage history (last 50 records).
π§ Available Models
| Model ID | Provider | Type | Input $/1M tokens | Output $/1M tokens |
gpt-4o | OpenAI | Chat | $2.50 | $10.00 |
gpt-4o-mini | OpenAI | Chat | $0.15 | $0.60 |
claude-sonnet | Anthropic | Chat | $3.00 | $15.00 |
claude-haiku | Anthropic | Chat | $0.25 | $1.25 |
deepseek-v4 | DeepSeek | Chat | $0.55 | $2.19 |
gemini-flash | Google | Chat | $0.15 | $0.60 |
gemini-pro | Google | Chat | $1.25 | $5.00 |
dall-e-3 | OpenAI | Image | $0.04/image (1024Γ1024) |
sdxl | Stability | Image | $0.01/image |
musicgen | Meta | Audio | $0.05/second |