Skip to main content

Submit a generation

An accepted request returns 201. V1 produces queued, running, succeeded, failed, and canceled. The awaiting_supply value is reserved for a future version and is never produced in V1.
Use one stable, unique Idempotency-Key per generation. Replaying a completed request returns the existing generation with 200.
Using the same key with a different body returns 422 idempotency_conflict. An in-progress generation returns 503 generation_in_progress with Retry-After: 5.

Get and list generations

  • GET /api/v1/hub/generations/{id} returns one generation.
  • GET /api/v1/hub/generations lists the newest generations first.
  • Available filters are limit, cursor, status, from, to, model, and media_only.
  • media_only=true excludes LLM executions before pagination and the total_billed calculation.
  • Use the opaque next_cursor unchanged to load the next page.

Cancel a generation

POST /api/v1/hub/generations/{id}/cancel cancels only a queued generation. Other states return 409 not_cancelable.

Chat Completions compatibility

POST /api/v1/hub/chat/completions accepts OpenAI-compatible fields and forwards additional fields to the provider. Set stream to false or omit it. Omit the unsupported n parameter. A 200 response also includes:
The alias also accepts Idempotency-Key. A completed replay returns the existing completion. An in-progress replay returns 503 generation_in_progress with Retry-After: 5. Reusing the key with a different body returns 422 idempotency_conflict.