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

# Generate AI image ad creatives for the team. Kicks off an async batch (Inngest) and returns a batchId immediately — poll get_generation_status for results. Charges credits: image cost per generation (aspect ratio × variation). Requires reference images or detailed instructions.

> Generate AI image ad creatives for the team. Kicks off an async batch (Inngest) and returns a batchId immediately — poll get_generation_status for results. Charges credits: image cost per generation (aspect ratio × variation). Requires reference images or detailed instructions.



## OpenAPI

````yaml /openapi.json post /tools/generate_image
openapi: 3.1.0
info:
  title: AdStellar API
  version: 1.0.0
  description: >-
    Public REST API for AdStellar — creative generation, video generation,
    campaign management, and analytics. Every endpoint maps 1:1 to an AdStellar
    MCP tool.
servers:
  - url: https://app.adstellar.ai/api/v1
security: []
paths:
  /tools/generate_image:
    post:
      summary: >-
        Generate AI image ad creatives for the team. Kicks off an async batch
        (Inngest) and returns a batchId immediately — poll get_generation_status
        for results. Charges credits: image cost per generation (aspect ratio ×
        variation). Requires reference images or detailed instructions.
      description: >-
        Generate AI image ad creatives for the team. Kicks off an async batch
        (Inngest) and returns a batchId immediately — poll get_generation_status
        for results. Charges credits: image cost per generation (aspect ratio ×
        variation). Requires reference images or detailed instructions.
      operationId: generate_image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                instructions:
                  description: >-
                    Detailed creative direction. Required when no
                    referenceAssetIds are given.
                  type: string
                  maxLength: 4000
                aspectRatios:
                  minItems: 1
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    enum:
                      - '1:1'
                      - '4:5'
                      - '9:16'
                      - '16:9'
                  description: >-
                    One or more aspect ratios — one generation per ratio ×
                    variationCount.
                variationCount:
                  description: Variations per aspect ratio (default 1).
                  type: integer
                  minimum: 1
                  maximum: 10
                referenceAssetIds:
                  description: >-
                    Media asset ids to use as visual references (from
                    search_assets).
                  maxItems: 5
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                brandKitId:
                  description: Brand kit to ground the creative in.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                productId:
                  description: Product to feature (resolves brand kit + assets).
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                renderMode:
                  description: Quality/speed tradeoff (default express).
                  type: string
                  enum:
                    - express
                    - studio
                workspaceId:
                  description: >-
                    Workspace to generate in (must be one this credential can
                    access). Omit for the primary workspace.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - aspectRatios
              additionalProperties: false
      responses:
        '200':
          description: Tool result
        '401':
          description: Missing or invalid API key
        '403':
          description: Missing required scope
        '429':
          description: Rate limit exceeded
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: AdStellar API key (ast_live_...)

````