Skip to main content
POST
https://api.naga.ac
/
v1
/
images
/
generations
Image Generations
curl --request POST \
  --url https://api.naga.ac/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "quality": "<string>",
  "size": "<string>",
  "n": 123,
  "response_format": "<string>"
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Request Parameters

model
string
required
Image generation model (e.g., flux-1-schnell).
prompt
string
required
The text prompt for image generation.
quality
string
Provider-specific quality preset.
size
string
Target image resolution (e.g., 1024x1024).
n
integer
Number of images to generate.
response_format
string
default:"url"
Output format per image (url or b64_json).

Example Request

from openai import OpenAI

client = OpenAI(base_url="https://api.naga.ac/v1", api_key="YOUR_API_KEY")

resp = client.images.generate(
    model="flux-1-schnell",
    prompt="A white siamese cat",
    size="1024x1024",
    n=1,
    response_format="url",  # or "b64_json"
)
print(resp.data)  # array of images with url or b64_json

Response

Returns a JSON object with a data array of generated images. Each item contains either:
  • url when response_format = "url", or
  • b64_json when response_format = "b64_json".

Response Fields

created
integer
Unix timestamp of request creation
data
array
Array of generated image objects