Base URL and authentication
https://api.api-key.org
Authorization: Bearer YOUR_API_KEY
# or
x-api-key: YOUR_API_KEY
Create keys at Settings → API Keys. Never ship a key in browser or mobile code.
Billing
| Rule | Details |
|---|---|
| Unit | 1 credit = $0.001. Prices for every model are listed at /pricing and in GET /v1/models. |
| LLM | Billed per input, output and cached token. A hold based on max_tokens is placed before the call and settled to actual usage. |
| Media tasks | A hold is placed when the task is created and settled to the actual cost when it finishes. Failed tasks are refunded in full. |
| Balance | GET /v1/credits returns your balance in credits and USD. |
LLM endpoints
/v1/messages
Anthropic Messages API for Claude models (streaming, tools, prompt caching). Works with Claude Code.
/v1/responses
OpenAI Responses API for GPT, Codex, Grok and DeepSeek models.
/v1/chat/completions
OpenAI Chat Completions for Gemini and GPT-5.2 models.
/v1/models
Every model with its endpoint and USD price.
Each model is served on one endpoint; the endpoint field in GET /v1/models tells you which.
Claude Code
export ANTHROPIC_BASE_URL=https://api.api-key.org
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
export ANTHROPIC_MODEL=claude-sonnet-5-5
claude
Messages example
curl https://api.api-key.org/v1/messages \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Write a launch tweet" }]
}'
Responses example
curl https://api.api-key.org/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-d '{ "model": "gpt-6-sol", "input": "Summarise this changelog", "stream": true }'
Media tasks
/api/v1/jobs/createTask
Create a task for any image, video or audio model: { model, input, callBackUrl }.
/api/v1/jobs/recordInfo?taskId=
Task state (waiting, generating, success, fail), result URLs and credits used.
/v1/images/generations · /v1/videos · /v1/music/generations
OpenAI-style aliases. Pass any model id; extra fields become the task input.
/v1/tasks/{task_id}
OpenAI-style task status with result URLs.
Create a task
curl https://api.api-key.org/api/v1/jobs/createTask \
-H "Authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "nano-banana-2",
"input": { "prompt": "A product photo of a ceramic mug", "aspect_ratio": "1:1", "resolution": "1K" },
"callBackUrl": "https://your-app.com/webhooks/api-key"
}'
{ "code": 200, "msg": "success", "data": { "taskId": "task_..." } }
Poll the result
curl "https://api.api-key.org/api/v1/jobs/recordInfo?taskId=task_..." \
-H "Authorization: Bearer $API_KEY"
{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_...",
"model": "nano-banana-2",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://api.api-key.org/files/task_.../0\"]}",
"creditsConsumed": 52
}
}
Input fields for each model are listed on its card at /models. Result files are kept for 14 days; download anything you need to keep.
Webhooks
When callBackUrl is set, the task record is POSTed to it when the task succeeds or fails.
Generate a signing key at Settings → API Keys to receive signed callbacks:
X-Webhook-Timestamp: 1790000000
X-Webhook-Signature: base64(HMAC-SHA256(taskId + "." + timestamp, webhookSigningKey))
Limits
| Limit | Default |
|---|---|
| Requests per API key | 5 per 10 seconds |
| Concurrent media tasks per API key | 2 |
| Higher limits | Contact support with your expected volume. |
Limited requests return HTTP 429 with a retry-after header.
Errors
{
"error": {
"message": "Insufficient credits: this request needs up to 120 credits.",
"type": "insufficient_quota",
"code": "insufficient_credits"
},
"request_id": "..."
}
/v1/messages returns the Anthropic error shape and /api/v1/jobs/* returns { code, msg, data }.