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

# Create image

> Creates an image based on the provided text prompt.



## OpenAPI

````yaml /openapi/serverless-openapi.yaml post /v1/images/generations
openapi: 3.0.0
info:
  title: Nscale Inference API
  version: 1.26.0
servers:
  - url: https://inference.api.nscale.com
    description: Production
security: []
tags:
  - name: Inference
  - name: Models
paths:
  /v1/images/generations:
    post:
      tags:
        - Inference
      summary: Create image
      description: Creates an image based on the provided text prompt.
      requestBody:
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequestBody'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponseBody'
          headers:
            INFERENCE-ID:
              required: true
              deprecated: false
              schema:
                type: string
        '400':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: ''
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - IdentityAuthorization: []
components:
  schemas:
    ImageGenerationRequestBody:
      type: object
      title: ImageGenerationRequestBody
      required:
        - model
        - prompt
      properties:
        model:
          type: string
        prompt:
          type: string
        size:
          type: string
          default: 1024x1024
        'n':
          type: integer
          format: int32
          default: 1
      example:
        model: black-forest-labs/FLUX.1-schnell
        'n': 1
        prompt: >-
          A serene mountain landscape at sunset with a lake reflecting the
          orange sky
        size: 1024x1024
    ImageGenerationResponseBody:
      type: object
      title: ImageGenerationResponseBody
      required:
        - created
        - data
      properties:
        created:
          type: integer
          format: int64
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageData'
    ErrorResponse:
      type: object
      title: ErrorResponse
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
    ImageData:
      type: object
      title: ImageData
      required:
        - b64_json
      properties:
        b64_json:
          type: string
    ApiError:
      type: object
      title: ApiError
      required:
        - code
        - message
        - error_type
      properties:
        code:
          type: string
        message:
          type: string
        param:
          type: string
        error_type:
          type: string
  securitySchemes:
    IdentityAuthorization:
      type: http
      description: Security scheme that accepts Unikorn Identity JWTs.
      scheme: bearer

````