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

# Generate image

> Generates an image and saves it to the media library. Waits up to ~50 s; if `status` is still `pending`, poll Get generation. Screened against the content policy first; refused and failed requests cost nothing.

Requires the `generate` scope.



## OpenAPI

````yaml /openapi.json post /generations/image
openapi: 3.1.0
info:
  title: Autoadify API
  version: 1.0.0
  description: >-
    Schedule and publish social posts, generate AI images and video, manage your
    media library and more.
servers:
  - url: https://api.autoadify.com/v1
security:
  - apiKey: []
tags:
  - name: Account
    description: The API key making the request.
  - name: Channels
    description: Connected social accounts.
  - name: Posts
    description: Schedule, publish and manage posts.
  - name: Media
    description: The media library.
  - name: Generation
    description: AI image and video generation, billed in credits.
paths:
  /generations/image:
    post:
      tags:
        - Generation
      summary: Generate image
      description: >-
        Generates an image and saves it to the media library. Waits up to ~50 s;
        if `status` is still `pending`, poll Get generation. Screened against
        the content policy first; refused and failed requests cost nothing.


        Requires the `generate` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateImageRequest'
      responses:
        '201':
          description: 'The generation: completed, or pending to poll.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '401':
          description: Missing, invalid, expired or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Not enough credits (`insufficient_credits`, with `details.required`
            and `details.available`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The key lacks the scope this endpoint needs (`forbidden_scope`), or
            the plan has no API access (`plan_required`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Invalid body (`validation_failed`) or refused by the content policy
            (`content_policy`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit (`rate_limited`) or monthly quota (`quota_exceeded`)
            reached. `details.resetsAt` says when to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GenerateImageRequest:
      type: object
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 4000
          description: >-
            What to generate. Be specific about subject, style, setting and any
            text to render.
        model:
          default: nano-banana-2
          description: A model id from list_ai_models. Default nano-banana-2.
          type: string
          enum:
            - nano-banana-2
            - gpt-image-2
            - qwen-image-3
            - krea-2-medium
            - krea-2-medium-turbo
            - recraft-v4.1-flash
        aspectRatio:
          default: '1:1'
          description: >-
            1:1 feed, 4:5 Instagram portrait, 9:16 stories/reels, 16:9
            landscape.
          type: string
          enum:
            - '1:1'
            - '4:5'
            - '9:16'
            - '16:9'
      required:
        - prompt
    Generation:
      type: object
      properties:
        generation: 7ea75155-91de-4bd0-9c1c-34894620b676
      required:
        - generation
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden_scope
                - plan_required
                - reauth_required
                - not_found
                - validation_failed
                - limit_reached
                - duplicate_post
                - conflict
                - rate_limited
                - quota_exceeded
                - internal_error
            message:
              type: string
              description: Human-readable; safe to show to a user.
            details:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from Autoadify → Settings → API & MCP, sent as
        `Authorization: Bearer aak_live_…`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.