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

# Generate Image

> Generate an image from a text prompt. Pass a `reference_image_url` to guide the output toward a specific look or subject. Returns the image URL.



## OpenAPI

````yaml api-reference/openapi/content.json POST /api/content/image
openapi: 3.1.0
info:
  title: Recoup API - Content
  description: >-
    API documentation for the Recoup platform - an AI agent platform for the
    music industry
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.recoupable.dev
security: []
paths:
  /api/content/image:
    post:
      description: >-
        Generate an image from a text prompt. Pass a `reference_image_url` to
        guide the output toward a specific look or subject. Returns the image
        URL.
      requestBody:
        description: Image generation parameters
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentCreateImageRequest'
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentCreateImageResponse'
        '400':
          description: Validation failed — invalid or missing request body fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentErrorResponse'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentErrorResponse'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    ContentCreateImageRequest:
      type: object
      properties:
        template:
          type: string
          description: >-
            Optional template ID. When provided, uses the template's image
            prompt, reference images, and style rules. Caller params override
            template defaults. Artist context overrides template style when
            available. See [GET
            /api/content/templates](/api-reference/content/templates) for
            available options.
        prompt:
          type: string
          description: Optional prompt to guide image generation
        reference_image_url:
          type: string
          format: uri
          description: URL of a reference image for conditioning the generation
        images:
          type: array
          items:
            type: string
            format: uri
          description: Optional reference image URLs to guide generation
        num_images:
          type: integer
          minimum: 1
          maximum: 4
          default: 1
          description: Number of images to generate (1-4)
        aspect_ratio:
          type: string
          enum:
            - auto
            - '21:9'
            - '16:9'
            - '3:2'
            - '4:3'
            - '5:4'
            - '1:1'
            - '4:5'
            - '3:4'
            - '2:3'
            - '9:16'
            - '4:1'
            - '1:4'
            - '8:1'
            - '1:8'
          default: auto
          description: Aspect ratio of the generated image
        resolution:
          type: string
          enum:
            - 0.5K
            - 1K
            - 2K
            - 4K
          default: 1K
          description: Output resolution
        model:
          type: string
          description: fal.ai model ID. Defaults to fal-ai/nano-banana-2
    ContentCreateImageResponse:
      type: object
      required:
        - imageUrl
        - images
      properties:
        imageUrl:
          type: string
          format: uri
          description: URL of the first generated image
        images:
          type: array
          items:
            type: string
            format: uri
          description: >-
            URLs of all generated images. Contains one element when num_images
            is 1.
    ContentErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Recoup API key. [Learn more](/quickstart#api-keys).
    bearerAuth:
      type: http
      scheme: bearer

````