Skip to main content
POST
/
images
/
generations
Create image generation
curl --request POST \
  --url https://api.neosantara.xyz/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "A beautiful sunset over the mountains in an anime art style.",
  "n": 1,
  "size": "1024x1024",
  "model": "neosantara-gen-2045"
}'
{
  "id": "img-12345",
  "object": "image",
  "created": 1717950000,
  "model": "neosantara-gen-2045",
  "data": [
    {
      "url": "https://example.com/image.png",
      "b64_json": null
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 8,
    "total_tokens": 23
  }
}

Authorizations

Authorization
string
header
required

Your NeosantaraAI API Key.

Body

application/json
model
string
default:neosantara-gen-2045
required

The model to use for image generation.

prompt
string
required

A text description of the desired image(s). The maximum length is 1000 characters.

n
integer
default:1

The number of images to generate.

Required range: 1 <= x <= 4
size
enum<string>
default:1024x1024

The size of the generated images.

Available options:
256x256,
512x512,
1024x1024
response_format
enum<string>
default:url

The format in which the generated images are returned.

Available options:
url,
b64_json

Response

Image generation result

id
string

A unique identifier for the image generation request.

object
string

The type of object returned.

Example:

"image"

created
integer

The timestamp of when the image was created.

model
string

The model used for the image generation.

data
object[]

A list of generated image objects.

  • Option 1
  • Option 2
usage
object

Token usage information for the request.

_metadata
object