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

# 이미지 생성

> OpenAI-compatible image generation. Also accepts Qwen-compatible payloads (`wanx-v1` style models) using an `input.messages` wrapper instead of `prompt`.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: DGrid AI Gateway API
  description: >-
    A single, unified API to access 200+ leading AI models. OpenAI-, Claude-,
    and Gemini-compatible endpoints for chat, completions, embeddings, images,
    audio, and moderations.
  version: 1.0.0
  contact:
    name: DGrid AI
    url: https://dgrid.ai
servers:
  - url: https://api.dgrid.ai
    description: DGrid AI Gateway
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      tags:
        - Images
      summary: Create image
      description: >-
        OpenAI-compatible image generation. Also accepts Qwen-compatible
        payloads (`wanx-v1` style models) using an `input.messages` wrapper
        instead of `prompt`.
      operationId: createImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: OpenAI format
                  required:
                    - prompt
                  properties:
                    prompt:
                      type: string
                      description: Image prompt.
                    model:
                      type: string
                      default: dall-e-2
                      description: Model such as `dall-e-2` or `dall-e-3`.
                    'n':
                      type: integer
                      default: 1
                      description: Number of images to generate.
                    quality:
                      type: string
                      enum:
                        - standard
                        - hd
                      default: standard
                    response_format:
                      type: string
                      enum:
                        - url
                        - b64_json
                      default: url
                    size:
                      type: string
                      default: 1024x1024
                      description: Output size.
                    style:
                      type: string
                      enum:
                        - vivid
                        - natural
                      default: vivid
                    user:
                      type: string
                      description: End-user identifier.
                - type: object
                  title: Qwen format
                  required:
                    - model
                    - input
                  properties:
                    model:
                      type: string
                      description: Model identifier, such as `wanx-v1`.
                    input:
                      type: object
                      description: Input wrapper object.
                      properties:
                        messages:
                          type: array
                          description: Messages array nested under `input`.
                          items:
                            type: object
            example:
              prompt: A cute baby sea otter wearing a beret
              model: dall-e-3
              size: 1024x1024
      responses:
        '200':
          description: Generated images.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    ImageResponse:
      type: object
      properties:
        created:
          type: integer
          description: Creation timestamp.
        data:
          type: array
          description: Generated image entries.
          items:
            type: object
            properties:
              url:
                type: string
                description: Image URL when using URL output.
              b64_json:
                type: string
                description: Base64 image payload when requested.
              revised_prompt:
                type: string
                description: Refined prompt returned by the model.
        usage:
          type: object
          properties:
            total_tokens:
              type: integer
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            input_tokens_details:
              type: object
              properties:
                text_tokens:
                  type: integer
                image_tokens:
                  type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
            code:
              type: string
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your DGrid API key. All endpoints use `Authorization: Bearer
        <DGRID_API_KEY>`.

````