SimpleLLMDocs
Build with SimpleLLM
Markdown ↗

Image generation

Generate images and handle their returned URLs or base64 data.

Send a text prompt to POST /v1/images/generations. The V1 handler uses its configured image service; the request's model field does not select arbitrary image backends.

Generate an image

bash
curl --fail-with-body https://api.simplellm.eu/v1/images/generations \
  -H "Authorization: Bearer $SIMPLELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A small lighthouse at dawn, watercolor illustration",
    "n": 1,
    "size": "1024x1024"
  }'

The configured model in the documented V1 handler is stable-diffusion-xl-base-v10. This is a configuration fact, not confirmation of current upstream availability.

Request fields

FieldBehavior
promptRequired, nonempty text
nDefaults to 1; maximum 4; V1 normalizes nonpositive values to 1
sizeAccepted and defaults to 1024x1024 locally, but is not forwarded by V1; it does not control generated dimensions
modelDoes not change the V1 configured image backend
response_formatOptional, forwarded; response support depends on the service

Multiple requested images are generated sequentially in V1. Do not assume a request for four images takes the same time as one.

Handle the response

The response has a created timestamp and data array. Each entry can contain a URL or base64 image data:

json
{
  "created": 1789380000,
  "data": [
    {"url": "https://api.simplellm.eu/images/EXAMPLE_IMAGE_ID"}
  ]
}

The URL above illustrates the response shape; always use the returned URL rather than constructing one. When b64_json is returned, decode it as base64 image bytes.

The V1 image proxy stores returned URL mappings with a 24-hour expiry. Download needed results promptly and store them in your application; do not treat generated links as permanent asset hosting.

Cost and failures

The V1 implementation checked on 2026-09-14 charges 5 SC per generated image. A four-image request therefore has a configured cost of 20 SC; verify current pricing before a larger job.

Handle 402 as insufficient credits and upstream errors as a failed request, not an image result. Avoid uncontrolled retries: image generation is a new operation each time.

See Image generation API for the schema and vision inputs if your goal is to analyze an existing image instead.

Search the complete documentation.