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

# Create image

> Use an image model to generate an image for a given prompt.



## OpenAPI

````yaml together-openapi.yaml post /images/generations
openapi: 3.0.0
info:
  title: Together API
  description: The Together REST API. Please see https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.xyz/v1
security:
  - bearerAuth: []
paths:
  /images/generations:
    post:
      tags:
        - Images
      summary: Create image
      description: Use an image model to generate an image for a given prompt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
                - model
              properties:
                prompt:
                  type: string
                  description: >-
                    A description of the desired images. Maximum length varies
                    by model.
                  example: cat floating in space, cinematic
                model:
                  type: string
                  description: The model to use for image generation.
                  example: stabilityai/stable-diffusion-xl-base-1.0
                steps:
                  type: integer
                  default: 20
                  description: Number of generation steps.
                seed:
                  type: integer
                  description: >-
                    Seed used for generation. Can be used to reproduce image
                    generations.
                'n':
                  type: integer
                  default: 1
                  description: Number of image results to generate.
                height:
                  type: integer
                  default: 1024
                  description: Height of the image to generate in number of pixels.
                width:
                  type: integer
                  default: 1024
                  description: Width of the image to generate in number of pixels.
                negative_prompt:
                  type: string
                  description: The prompt or prompts not to guide the image generation.
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
components:
  schemas:
    ImageResponse:
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        object:
          enum:
            - list
          example: list
        data:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              b64_json:
                type: string
            required:
              - b64_json
              - index
      required:
        - id
        - model
        - object
        - data
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      x-default: default

````