Developer documentation

API reference

Find the base URL, list models, and choose the endpoint for your integration.

List available models

The API gateway is hosted at https://api.api-key.org. Start with its live model catalog. Use the exact model ID in the JSON response when building requests.

curl -fsS https://api.api-key.org/v1/models

The catalog request is read-only. It does not submit an inference task.

Choose an endpoint

Task Method and path
List models GET /v1/models
Read your credit balance GET /v1/credits
Send Claude messages POST /v1/messages
Send an OpenAI-style responses request POST /v1/responses
Send a chat completion POST /v1/chat/completions
Start an image job POST /v1/images/generations
Start a video job POST /v1/videos
Read the status of a task GET /v1/tasks/:task_id

Get a key

Access is opened by hand at the moment, so there is no self-serve signup to click through yet. Send one message from the contact page saying what you want to run and roughly how much of it, and you get a key back. A small amount of credit goes on the account so the first calls cost nothing while you are testing.

Once a key exists it lives in your dashboard. Keep it on your server, never in browser code, and rotate it if it has ever been pasted into a screenshot, a ticket or a public repo.

Authenticate account requests

Send the key as Authorization: Bearer $API_KEY or as the x-api-key header. Both work on every endpoint.

curl -fsS https://api.api-key.org/v1/credits \
  -H "Authorization: Bearer $API_KEY"

A request with no key at all comes back as an authentication error before anything is queued:

{
  "error": {
    "message": "Missing API key. Send it as \"Authorization: Bearer <key>\" or \"x-api-key\".",
    "type": "authentication_error",
    "code": "missing_api_key"
  },
  "request_id": "a5f5003c88a9f46e"
}

Send an image request

curl https://api.api-key.org/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "The same bottle on green marble, warm side light, keep the label text unchanged.",
    "image_url": "https://your-bucket.example/bottle.jpg"
  }'

Drop image_url when you want a new picture instead of an edit. The model ID decides the price tier, so read the rate on the model page before you send a batch rather than after.

Send a video request

curl https://api.api-key.org/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2",
    "prompt": "a cinematic coffee ad, steam rising, slow push in",
    "resolution": "720p",
    "duration": 5
  }'

Video is billed per second of output and the resolution changes the rate, so a five second 720p clip and a five second 1080p clip are not the same order of cost. Add image_url for image to video and video_url for video to video; the latter is cheaper per second.

Send a language model request

Claude-style and OpenAI-style payloads are both accepted, which means existing SDKs work by changing the base URL:

curl https://api.api-key.org/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-5",
    "max_tokens": 512,
    "messages": [{ "role": "user", "content": "Summarise this changelog in three lines." }]
  }'

Use POST /v1/chat/completions or POST /v1/responses when your client speaks OpenAI, and POST /v1/messages when it speaks Claude. Text models are billed per million tokens, input and output priced separately.

Read the task status

Image and video jobs are asynchronous. The create call returns a task id immediately, and the result is read from a second endpoint:

curl https://api.api-key.org/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $API_KEY"

Poll on a backoff rather than in a tight loop: a few seconds apart is right for images, and video needs longer. Treat the result URL as issued by the API and store your own copy if your users need it later; do not build a product that depends on a third-party URL staying alive.

Handle errors

Every error comes back as one JSON object with a message, a type and a code, plus a request id:

  • 4xx means the request or the account needs attention — a missing or revoked key, an unknown model ID, a parameter the model does not accept, or a balance too low to run the job.
  • 5xx means the fault is upstream. Retry with backoff; if it persists, send the request_id to support and the exact call can be traced.

Two practical rules: do not retry a 4xx without changing anything, because it will fail the same way, and do log the request_id on every failure. It is the only handle that ties your error to a specific task in our logs. Failed jobs are not billed, so a retry after a genuine upstream failure costs nothing extra.

Estimate the request cost

Use pricing and the model pages to compare image size, video duration and per token text rates. The running cost of every task also appears in your usage log, which is the honest way to see what a real workload costs before committing to a larger batch.