Overview
How the reAPI HTTP API works — base URL, authentication, async tasks, and credits.
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. 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
10 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.