Api18.dev

API reference

All endpoints. The base URL and Bearer authentication apply to every call.

Base & authentication#

https://api18.dev
Authorization: Bearer api18_xxxxxxxxxxxxxxxx
Content-Type: application/json

Synchronous mode#

Add ?wait=true to any create endpoint to wait for the result and get the finished job in one request (no polling). If the job exceeds the wait budget, the response is still a valid job you can poll. Returns 200 when finished, 202 when still processing.

Endpoints#

POST /v1/generate

One endpoint for any model — routes by the model field, so you never choose between video and images. Body is the same as the specific endpoints. Recommended for most integrations. POST /v1/generate?wait=true returns the finished job.

POST /v1/video/generations

Creates a video job (text-to-video or image-to-video). The body depends on the model — see each model's page. Returns the job object (HTTP 202).

POST /v1/images/generations

Creates an image job (text-to-image or editing). Body depends on the model. Returns the job object (HTTP 202).

GET /v1/jobs/{id}

Returns a job's current state (syncs with the provider). Use it for polling. Responds 404 if the job doesn't exist or has expired.

GET /v1/files/{id}

Redirects (302) to the output file. Use ?n=1, ?n=2… for additional outputs. Responds 404 if the file isn't ready yet.

Job object#

{
  "id": "string",
  "object": "generation",
  "model": "string",
  "output_kind": "video" | "image",
  "status": "processing" | "completed" | "failed",
  "created_at": "ISO-8601",
  "started_at": "ISO-8601 | null",
  "completed_at": "ISO-8601 | null",
  "expires_at": "ISO-8601",
  "retention_days": 7,
  "error": "string | null",
  "cost_usd": 0.30,
  "input": { },
  "timings": { "inference_ms": 1234 },
  "urls": { "get": "https://api18.dev/v1/jobs/{id}" },
  "data": [ { "url": "https://api18.dev/v1/files/{id}" } ]
}

For the error table, see Error handling.

API reference — Api18.dev Docs