---
title: "Get a generation result"
method: GET
path: "/v1/grounded-generation/{generation_id}"
---

# Get a generation result

`GET /v1/grounded-generation/{generation_id}`

## Request

- Base URL: `https://api.octen.ai`
- URL: `https://api.octen.ai/v1/grounded-generation/{generation_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Returns a grounded generation task by id.

## Path parameters

- `generation_id` string, required

## Response `200`

Successful grounded generation task response

- GroundedGenerationTask
  - `request_id` string: Unique identifier for the request.
  - `generation_id` string, required: Unique task id.
  - `modality` 'image' | 'video', required: The type of output this task generates.
  - `status` 'queued' | 'running' | 'succeeded' | 'failed', required: Task state.
  - `output_url` string: Signed download URL for the output, present when `status` is `succeeded`. Requires no API key, and is valid for 7 days after the task was created.
  - `references` GroundedGenerationReference[]: The reference material used to generate the output.
    - `source_id` string: Identifier of the reference, such as `source1`.
    - `url` string: The media URL.
    - `title` string: The title of the reference.
    - `cover_url` string: Thumbnail URL.
  - `search_results` GroundedGenerationSearchGroup[]: The search results the references were selected from, grouped by query.
    - `query` string: The query the task searched for.
    - `results` GroundedGenerationSearchResult[]: Results for this query.
      - `type` 'image' | 'video': Media type of the result.
      - `title` string: The title of the result.
      - `url` string: The media URL.
      - `source_page` string: URL of the original page hosting the media.
      - `description` string: Description of the result.
      - `cover_url` string: Thumbnail URL.
  - `error` GroundedGenerationError: Failure reason, present when `status` is `failed`. Failed tasks are not billed.
    - `code` 'MM_GENERATION_CONTENT_POLICY' | 'MM_GENERATION_INPUT_IMAGE_PRIVACY_BLOCKED' | 'MM_GENERATION_CONTENT_NOT_SUPPORTED' | 'MM_GENERATION_NO_REFERENCE_MATERIAL' | 'MM_GENERATION_REJECTED' | 'MM_GENERATION_TIMEOUT' | 'MM_GENERATION_FAILED': Machine-readable failure code. `MM_GENERATION_CONTENT_POLICY`: the prompt triggered a content policy; `MM_GENERATION_INPUT_IMAGE_PRIVACY_BLOCKED`: the reference material was blocked for privacy; `MM_GENERATION_CONTENT_NOT_SUPPORTED`: the content is not supported; `MM_GENERATION_NO_REFERENCE_MATERIAL`: no usable reference material was found; `MM_GENERATION_REJECTED`: the model rejected the request; `MM_GENERATION_TIMEOUT`: generation timed out, retry; `MM_GENERATION_FAILED`: generation failed for another reason, retry.
    - `message` string: A message describing the failure.
  - `created_at` integer, required: Unix timestamp in seconds when the task was created.
  - `updated_at` integer, required: Unix timestamp in seconds when the task was last updated.
  - `usage` GroundedGenerationUsage: Metering for the task. Present only when `status` is `succeeded`.
    - `image_count` integer: Number of images generated. Returned when `modality` is `image`.
    - `video_count` integer: Number of videos generated. Returned when `modality` is `video`.
    - `video_seconds` integer: Length of the generated video in seconds. Returned when `modality` is `video`.

## Other responses

- `401`: Invalid API Key — Returned when the API key is missing or invalid.
- `404`: Task not found or expired — Returned when the generation id does not exist or is older than 7 days.
- `429`: Exceeding the rate limit — Returned when the request exceeds the configured rate limit.
- `500`: Internal error — Returned when an unexpected server-side error occurs.

---

[API](https://skmtc.dev/octen/apis/octen-api.md) - [All operations](https://skmtc.dev/octen/apis/octen-api/llms.txt) - [OpenAPI document](https://skmtc.dev/octen/apis/octen-api/revisions/aaa6caaf46b0?raw)
