> ## Documentation Index
> Fetch the complete documentation index at: https://docs.octen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grounded Generation

> Generates an image or a video from a text prompt, grounded in reference material found by search.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/grounded-generation
openapi: 3.1.0
info:
  title: Octen API
  description: >-
    Octen API provides Broad Search, Web Search, Image Search, Video Search,
    Extract, Embeddings, VL Embeddings, Answer, and Deep Research services. The
    Web Search API searches ranked web results with optional filters,
    highlights, and full content. The Image Search API searches for images from
    a text query or an image, with an optional design mode that returns a
    structured summary and a reusable HTML snippet for each result. The Video
    Search API searches for videos from a text query. The Broad Search API
    decomposes a query into multiple sub-queries, searches them in parallel, and
    returns results grouped by sub-query. The Extract API extracts clean content
    from URLs, with optional query-focused highlights, page classification, and
    multimedia resources. The Embeddings API converts text into vector
    representations. The VL Embeddings API converts multimodal inputs into
    vector representations. The Answer API decomposes queries into multiple
    sub-queries for comprehensive search and synthesis. The Deep Research API
    runs a multi-round adaptive research pipeline that produces a structured
    research plan, executes iterative searches, and streams a final long-form
    report.
  version: 1.0.0
servers:
  - url: https://api.octen.ai
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /v1/grounded-generation:
    post:
      summary: Generate an image or a video
      description: >-
        Generates an image or a video from a text prompt, grounded in reference
        material found by search.
      operationId: post-grounded-generation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroundedGenerationRequest'
            examples:
              image:
                summary: Generate an image
                value:
                  modality: image
                  prompt: Ronaldo lifting the World Cup trophy, stadium lights
                  model: google/gemini-3-pro-image
                  aspect_ratio: '16:9'
              video:
                summary: Generate a video
                value:
                  modality: video
                  prompt: >-
                    A Tesla Cybertruck driving through a snowy mountain pass at
                    dawn
                  aspect_ratio: '9:16'
                  duration: 10
      responses:
        '200':
          description: >-
            Successful grounded generation response. The task starts in
            `queued`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroundedGenerationResponse'
              example:
                request_id: 20260924020604287FV3DLUK7ZX
                generation_id: mm-3ca3c4ff37c546b6b59f2e9cde09f2f6
                modality: image
                status: queued
                created_at: 1790215572
        '400':
          description: >-
            Invalid params — Returned when a required parameter is missing or
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 400
                msg: Unsupported multimodal model.
                request_id: req_abc123def456
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientBalance'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    GroundedGenerationRequest:
      type: object
      required:
        - modality
        - prompt
      description: Request body for the Grounded Generation API.
      properties:
        modality:
          type: string
          enum:
            - image
            - video
          description: The type of output to generate.
        prompt:
          type: string
          minLength: 1
          maxLength: 8000
          description: The text description of what to generate.
        model:
          type: string
          enum:
            - google/gemini-3-pro-image
            - minimax/hailuo-3
          description: The model to use. When omitted, the model default applies.
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '1:1'
            - '9:16'
          default: '16:9'
          description: Aspect ratio of the output.
        duration:
          type: integer
          default: 5
          minimum: 5
          maximum: 10
          description: >-
            Video length in seconds. Applies when `modality` is `video`. Values
            outside the allowed range are adjusted to the nearest bound.
    GroundedGenerationResponse:
      type: object
      required:
        - generation_id
        - modality
        - status
        - created_at
      properties:
        request_id:
          type: string
          description: Unique identifier for the request.
        generation_id:
          type: string
          description: Unique task id, used to retrieve the result.
        modality:
          type: string
          enum:
            - image
            - video
          description: The type of output this task generates.
        status:
          type: string
          enum:
            - queued
          description: Task state.
        created_at:
          type: integer
          description: Unix timestamp in seconds when the task was created.
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Business status code. Non-zero values indicate an error.
        msg:
          type: string
          description: A message describing the error.
        request_id:
          type: string
          description: Unique identifier for the request.
      required:
        - code
        - msg
        - request_id
  responses:
    Unauthorized:
      description: Invalid API Key — Returned when the API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            msg: Invalid API Key
            request_id: req_abc123def456
    InsufficientBalance:
      description: >-
        Insufficient balance in account — Returned when the account balance is
        insufficient to complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 403
            msg: Insufficient balance in account
            request_id: req_abc123def456
    RateLimited:
      description: >-
        Exceeding the rate limit — Returned when the request exceeds the
        configured rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            msg: Exceeding the rate limit
            request_id: req_abc123def456
    InternalError:
      description: Internal error — Returned when an unexpected server-side error occurs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            msg: Internal error
            request_id: req_abc123def456
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token used for request authentication. Alternatively, you can
        send the API key in the `x-api-key` header. Note: A payment method is
        required to use the API.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key used for request authentication. Alternatively, you can send the
        key as a Bearer token in the `Authorization` header. Note: A payment
        method is required to use the API.

````