API reference
Images
POST /v1/images/generations: draw pictures on an image model instance.
What it is
Qwen-Image 2.1 Turbo Uncensored, FLUX 3 Klein Uncensored draw pictures instead of chat. One request makes one picture and answers when it is done, with the PNG in the body as base64. It uses the same base URL and the same kind of API key as chat.
Request body
POST /v1/images/generations takes a JSON object. There is no model field: your key already says which instance.
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | What to draw, 1 to 4000 characters. There is no model field. |
| size | string | No | "1024x1024" (default), "1024x1536", "1536x1024", "768x1344", "1344x768" or "512x512". |
| seed | integer | No | 0 to 2147483647. The same seed and prompt give the same picture. |
| upsample | boolean | No | FLUX 3 Klein only: rewrite the prompt with more detail before drawing (default true). The rewrite comes back as revised_prompt. |
| n | integer | No | Pictures per request. Only 1. |
The response
| Field | Meaning |
|---|---|
| id | The picture's id (32 hex characters). GET /v1/images/{id} fetches it again. |
| seed | The seed it was drawn with. Send it back to get the same picture from the same prompt. |
| width, height | The size in pixels. |
| revised_prompt | FLUX 3 Klein with upsample on: the rewritten prompt it drew from. Otherwise null. |
| timings_ms | How long each stage took: upsample, generate, check, total. |
| data[0].b64_json | The PNG, base64-encoded. |
Examples
# Make one picture: the PNG comes back as base64 in data[0].b64_json
curl -s https://openllmbuddy-proxy.openllmbuddy.workers.dev/v1/images/generations \
-H 'Authorization: Bearer ob_sk_000000000000000000000000000000000000000000000001' \
-H 'Content-Type: application/json' \
-d '{"prompt":"A lighthouse on a cliff at dusk, oil painting","size":"1024x1024"}' \
| jq -r '.data[0].b64_json' | base64 --decode > image.png
# The same picture again, by its id (kept 24 hours, or until the instance ends)
curl -s https://openllmbuddy-proxy.openllmbuddy.workers.dev/v1/images/IMAGE_ID -H 'Authorization: Bearer ob_sk_000000000000000000000000000000000000000000000001' -o image.pngLimits and safety
- An instance draws one picture at a time. While it is busy it answers
429; while the model is still loading,503. Retry after a moment. - The base64 answer is a few MB for the large sizes. It is streamed through, but a host that caps responses (Vercel's limit is 4.5 MB) can cut a large one off: if that happens, fetch the PNG on its own with
GET /v1/images/{id}. - Pictures are kept on the instance for 24 hours, or until it ends. Save the ones you want.
- Every PNG is marked as AI generated (the X-AI-Generated header).
Refused requests
Requests involving anyone under 18 or real, identifiable people are refused with 422 and an error code (for example minor_prompt or real_person_prompt). Every finished picture is checked too (minor_output), and a request is refused when a check can't run (check_unavailable). These checks cannot be turned off.