API-Key API Reference

One API key for LLM, image, video and audio models.

Call Claude, GPT, Gemini and Grok through their native wire protocols, and run 80+ image, video and audio models through one async task API. Pay per token or per task from a single credit balance; failed tasks are never charged.

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

RuleDetails
Unit1 credit = $0.001. Prices for every model are listed at /pricing and in GET /v1/models.
LLMBilled per input, output and cached token. A hold based on max_tokens is placed before the call and settled to actual usage.
Media tasksA hold is placed when the task is created and settled to the actual cost when it finishes. Failed tasks are refunded in full.
BalanceGET /v1/credits returns your balance in credits and USD.

LLM endpoints

POST

/v1/messages

Anthropic Messages API for Claude models (streaming, tools, prompt caching). Works with Claude Code.

POST

/v1/responses

OpenAI Responses API for GPT, Codex, Grok and DeepSeek models.

POST

/v1/chat/completions

OpenAI Chat Completions for Gemini and GPT-5.2 models.

GET

/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

POST

/api/v1/jobs/createTask

Create a task for any image, video or audio model: { model, input, callBackUrl }.

GET

/api/v1/jobs/recordInfo?taskId=

Task state (waiting, generating, success, fail), result URLs and credits used.

POST

/v1/images/generations · /v1/videos · /v1/music/generations

OpenAI-style aliases. Pass any model id; extra fields become the task input.

GET

/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

LimitDefault
Requests per API key5 per 10 seconds
Concurrent media tasks per API key2
Higher limitsContact 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 }.