API reference

Generations

Every image and video request creates a generation. It moves queued → processing → completed | failed, or queued → cancelled. Credits for failed and cancelled generations are refunded automatically.

The generation object

  • idstring

    Identifier, gen_ + 32 hex characters.

  • objectstring

    Always generation.

  • typestring

    image or video.

  • modelstring

    orior-image for images; the video model ID for videos.

  • statusstring

    One of queued · processing · completed · failed · cancelled. Terminal states: completed, failed, cancelled.

  • creditsinteger

    Credits charged when the request was accepted.

  • refunded_creditsinteger

    Credits returned (failed, cancelled, or unspent). Net cost = credits − refunded_credits.

  • resultobject | null

    Present when completed.

    • urlstring

      Full-resolution output (WebP image or MP4 video). Permanent until you delete the generation.

    • thumbnail_urlstring | null

      Small preview (400px for images; poster for videos when available).

  • errorobject | null

    Present when failed or cancelled.

    • codestring

      CONTENT_BLOCKED, INSUFFICIENT_CREDITS, TIMEOUT, PROVIDER_ERROR, RATE_LIMIT, VALIDATION_ERROR, UNKNOWN or CANCELLED.

    • messagestring

      Human-readable explanation. Do not parse; use code.

  • requestobject

    The normalised parameters the generation ran with (defaults filled in). Media inputs are summarised, not echoed.

  • timelinearray

    Stage failures and automatic recoveries recorded while generating — see Generations.

    • atinteger

      Unix time in milliseconds.

    • stagestring

      scene_analysis, character_analysis, prompt_merge, text_model, image_generation, video_generation, storage or queue.

    • resolutionstring

      What happened next: continued_without_analysis, retried, fallback or stopped.

    • statusinteger | null

      Upstream HTTP status, when known.

    • messagestring

      Human-readable summary of what failed and what happened next.

  • created_atinteger

    Unix time in milliseconds.

  • completed_atinteger | null

    When the generation reached a terminal state.

GET/v1/generations/{id}
Scope: readReturns 200

Current state. Poll every 3–5 s for images and 10–15 s for videos, or use webhooks.

  • idstringrequired

    Generation ID.

curl https://api.oriorai.com/v1/generations/gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b \
  -H "Authorization: Bearer $ORIOR_API_KEY"
Response
{
  "id": "gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b",
  "object": "generation",
  "type": "image",
  "model": "orior-image",
  "status": "completed",
  "credits": 2,
  "refunded_credits": 0,
  "result": {
    "url": "https://storage.googleapis.com/…/generated-images/…/3kf9.webp",
    "thumbnail_url": "https://storage.googleapis.com/…/3kf9_thumb.webp"
  },
  "error": null,
  "request": {
    "prompt": "A barista smiling behind a latte, morning light",
    "character_id": null,
    "product_id": null,
    "aspect_ratio": "9:16",
    "resolution": "2K",
    "edit": false,
    "has_scene_image": false,
    "reference_images": 0
  },
  "timeline": [],
  "created_at": 1758620000000,
  "completed_at": 1758620031000
}
GET/v1/generations
Scope: readReturns 200

Newest first. Cursor-paginated.

  • typestring

    image or video.

  • statusstring

    queued · processing · completed · failed · cancelled

  • limitintegerdefault: 20

    1–100.

  • cursorstring

    next_cursor from the previous page.

curl https://api.oriorai.com/v1/generations \
  -H "Authorization: Bearer $ORIOR_API_KEY"
Response
{
  "data": [
    {
      "id": "gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b",
      "object": "generation",
      "type": "image",
      "model": "orior-image",
      "status": "completed",
      "credits": 2,
      "refunded_credits": 0,
      "result": {
        "url": "https://storage.googleapis.com/…/generated-images/…/3kf9.webp",
        "thumbnail_url": "https://storage.googleapis.com/…/3kf9_thumb.webp"
      },
      "error": null,
      "request": {
        "prompt": "A barista smiling behind a latte, morning light",
        "character_id": null,
        "product_id": null,
        "aspect_ratio": "9:16",
        "resolution": "2K",
        "edit": false,
        "has_scene_image": false,
        "reference_images": 0
      },
      "timeline": [],
      "created_at": 1758620000000,
      "completed_at": 1758620031000
    }
  ],
  "next_cursor": "gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b"
}
POST/v1/generations/{id}/cancel
Scope: generateIdempotency-Key requiredReturns 200

Only while queued. Refunds the full price.

  • idstringrequired

    Generation ID.

CodeWhen
CONFLICTAlready processing or finished.
curl -X POST https://api.oriorai.com/v1/generations/gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b/cancel \
  -H "Authorization: Bearer $ORIOR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response
{
  "id": "gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b",
  "object": "generation",
  "type": "image",
  "model": "orior-image",
  "status": "cancelled",
  "credits": 2,
  "refunded_credits": 2,
  "result": null,
  "error": {
    "code": "CANCELLED",
    "message": "The generation was cancelled."
  },
  "request": {
    "prompt": "A barista smiling behind a latte, morning light",
    "character_id": null,
    "product_id": null,
    "aspect_ratio": "9:16",
    "resolution": "2K",
    "edit": false,
    "has_scene_image": false,
    "reference_images": 0
  },
  "timeline": [],
  "created_at": 1758620000000,
  "completed_at": 1758620031000
}
DELETE/v1/generations/{id}
Scope: generateIdempotency-Key requiredReturns 200

Permanently deletes the output files and the record, including from the Orior library. Credits are not affected. Only finished generations can be deleted.

  • idstringrequired

    Generation ID.

CodeWhen
CONFLICTStill queued or processing.
curl -X DELETE https://api.oriorai.com/v1/generations/gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b \
  -H "Authorization: Bearer $ORIOR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response
{
  "id": "gen_7f3c9a1e2b4d4c8f9a0b1c2d3e4f5a6b",
  "object": "generation",
  "deleted": true
}