Overview
How the reAPI HTTP API works — base URL, authentication, async tasks, and credits.
The reAPI HTTP API exposes image, video, audio, and text models through one
set of endpoints at https://reapi.ai/api/v1, authenticated with
Authorization: Bearer rk_live_.... Generation is asynchronous: a submit
returns a task id, and you poll GET /api/v1/tasks/{id} until it reports
completed or failed.
Billing runs on credits, where 1 credit is $0.001. Credits are reserved when a request is accepted and settled when the task reaches a terminal state: a task that fails is refunded, and a task that costs less than the reserved amount gets the difference back. The one exception is documented per model — a model that runs a post-generation content check can charge for a generation the check blocks, because the generation itself already happened.
Base URL
https://reapi.ai/api/v1All endpoints accept and return JSON. The API mirrors OpenAI's conventions
where it makes sense — many existing OpenAI clients work by changing only
base_url.
Authentication
Every request must carry an API key as a Bearer token:
Authorization: Bearer rk_live_xxxxxxxxxxxxCreate keys in your dashboard. See Authentication for full details.
Asynchronous tasks (image, video)
Generation calls are asynchronous. The pattern is:
- POST the model endpoint (e.g.
/api/v1/images/generations) → returns atask_idimmediately. - GET
/api/v1/tasks/{task_id}periodically untilstatusiscompletedorfailed.
┌──────────┐ ┌──────────┐ ┌──────────┐
│ POST │ → │processing│ → │ completed│
│ /images/ │ └──────────┘ │ failed │
│generations│ └──────────┘
└──────────┘ │
▼
output / errorRecommended polling cadence: 1 request every 1–2 seconds.
For details see Tasks. Per-model request schemas are on each model's page in the Models sidebar.
Credits
Each call deducts credits from your balance. Failed tasks are
automatically refunded by the worker the moment the workflow ends in
failure — atomically, before any poll observes the failed status. The
exception is a model that runs a post-generation content check: when that
check blocks an output, the task ends failed and is still charged, because
the generation itself completed. Those models say so on their own page. Refund
is one-shot; re-polling never refunds twice.
Pricing per model is configured in your account dashboard.
Idempotency
reAPI does not deduplicate by Idempotency-Key. Every successful HTTP
POST to a generation endpoint creates a new task and charges credits — by
design, so no upstream provider call is ever silently skipped.
If you need retry safety, generate the same payload only once on your side or rely on the natural recovery path: when a task fails, credits are refunded automatically and you can resubmit.
The Idempotency-Key header is currently accepted and recorded for
telemetry but does not alter request behavior. Don't rely on it to
prevent duplicate charges.
Rate limits
Requests are limited per user, in 1-second windows. The default is
20 requests / second / user. When exceeded, you get HTTP 429 with code
50001 and a Retry-After header.
Polling GET /api/v1/tasks/{id} shares the same limit, so don't poll faster
than once every 1–2 seconds per task.
Response format
Successful responses are JSON of the resource type. Errors follow a standard shape:
{
"error": {
"code": 20002,
"message": "Both `model` and `prompt` are required",
"request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b"
}
}code is a 5-digit numeric identifier (see Errors
for the full catalog). request_id is unique per call — include it in
support requests.