API Reference
Base URL, authentication, endpoints, response format and error codes for the API.
This page covers the mechanics shared by every model. For model-specific parameters and examples, see Image Models, and Video Models.
Base URL
https://reve2img.comAuthentication
All requests require an API key, passed as a Bearer token:
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCreate and manage keys at Settings → API Keys (reve2img.com/settings/apikeys). Keep your key secret — it can spend your account credits. Use it from a server, never in client-side code.
Core endpoints
| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/v1/generate | Create a generation task. |
GET | /api/v1/status?task_id={id} | Get a task's status and results. |
Create a task
POST /api/v1/generateThe request body always includes a model; the media type (image or video)
and scene are inferred from it. These fields are common to all models:
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model id. See the model category pages for the full list. |
prompt | string | Usually | Text description. Required for image and text/image-to-video. |
Each category adds its own fields (e.g. image_urls, aspect_ratio,
duration, resolution, generate_audio). See the category pages.
Response
{
"code": 200,
"message": "success",
"data": { "task_id": "abc123", "status": "IN_PROGRESS" }
}Synchronous models (e.g. Reve 2.0) may return SUCCESS with response.resultUrls
right away; everything else returns IN_PROGRESS — poll the status endpoint.
Get task status
GET /api/v1/status?task_id={task_id}| Query param | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | The id returned by /api/v1/generate. |
Poll every 2–5 seconds until status is SUCCESS or FAILED. Polling too
fast simply returns the current state (it is not an error).
{
"code": 200,
"message": "success",
"data": {
"task_id": "abc123",
"status": "SUCCESS",
"consumed_credits": 12,
"response": { "resultUrls": ["https://cdn.reve2img.com/...."] }
}
}On failure, status is FAILED and data.error contains a code and
message. Failed tasks are not charged.
Response format
Every response uses a consistent envelope:
{ "code": 200, "message": "success", "data": { /* ... */ } }Successful requests return code: 200. Errors return the HTTP status code in
both the HTTP response and code, with a machine-readable message and an
optional detail.
Task statuses
| Status | Meaning |
|---|---|
IN_PROGRESS | Queued or running. Keep polling. |
SUCCESS | Done. File URLs are in response.resultUrls. |
FAILED | The task failed. See error. No credits charged. |
Credits
Credits are deducted from your account balance when a task is created, and
the exact amount is returned as consumed_credits on success. Pricing depends on
the model (and on resolution / duration / options) — see each category page.
Failed tasks are refunded automatically. Top up at Settings → Credits.
Errors
{ "code": 401, "message": "INVALID_API_KEY", "detail": "Missing or invalid API key." }| HTTP | message | Meaning |
|---|---|---|
| 400 | INVALID_PROMPT | prompt is missing or empty. |
| 400 | INVALID_MODEL | Unknown or missing model. |
| 400 | INVALID_PARAMETER | Invalid JSON, or a parameter is invalid / missing. |
| 400 | CONTENT_POLICY_VIOLATION | Prompt or output rejected by content moderation. |
| 401 | INVALID_API_KEY | Missing, malformed, unknown, or revoked API key. |
| 402 | INSUFFICIENT_CREDITS | Not enough credits for this request. |
| 404 | TASK_NOT_FOUND | No task with that task_id belongs to your account. |
| 429 | RATE_LIMITED | Too many requests — slow down. |
| 429 | TOO_MANY_TASKS | Too many tasks in flight — wait for them to finish. |
| 500 | GENERATION_FAILED | Internal error. Safe to retry. |
| 503 | SERVICE_UNAVAILABLE | Upstream model temporarily unavailable. |
| 504 | TIMEOUT | The task timed out. |