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

# Create image

> Creates an image given a prompt.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/images/generations
openapi: 3.1.0
info:
  title: Neosantara AI API
  description: OpenAI-compatible LLM Gateway
  version: 1.0.0
servers:
  - url: https://api.neosantara.xyz
    description: Neosantara Production Gateway
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      tags:
        - Images
      summary: Create image
      description: Creates an image given a prompt.
      operationId: postV1ImagesGenerations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 4000
                'n':
                  type: integer
                  minimum: 1
                  maximum: 4
                  default: 1
                size:
                  type: string
                  pattern: ^\d+x\d+$
                  default: 1024x1024
                response_format:
                  type: string
                  enum:
                    - url
                    - b64_json
                  default: url
                steps:
                  type: integer
                  minimum: 1
                  maximum: 50
                  default: 20
                user:
                  type: string
                image:
                  type: string
                mask_image:
                  type: string
                mask_prompt:
                  type: string
                outpainting_mode:
                  type: string
                  enum:
                    - DEFAULT
                    - PRECISE
                quality:
                  type: string
                style:
                  type: string
                strength:
                  type: number
                  minimum: 0
                  maximum: 1
              required:
                - model
                - prompt
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: number
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                        b64_json:
                          type: string
                        revised_prompt:
                          type: string
                required:
                  - created
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                      code:
                        type:
                          - string
                          - 'null'
                    required:
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            from openai import OpenAI

            client = OpenAI(
                api_key='YOUR_NEOSANTARA_API_KEY',
                base_url='https://api.neosantara.xyz/v1'
            )

            response = client.images.generate(
                model='neosantara-gen-2045',
                prompt='Pemandangan alam Indonesia yang indah',
                n=1,
                size='1024x1024'
            )
            print(response.data[0].url)
        - lang: javascript
          label: Node.js SDK
          source: |-
            import OpenAI from 'openai';

            const client = new OpenAI({
              apiKey: 'YOUR_NEOSANTARA_API_KEY',
              baseURL: 'https://api.neosantara.xyz/v1'
            });

            const response = await client.images.generate({
              model: 'neosantara-gen-2045',
              prompt: 'Pemandangan alam Indonesia yang indah',
              n: 1,
              size: '1024x1024',
            });
            console.log(response.data[0].url);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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