Reference
POST /v1/images/generations
Make pictures from a text prompt, in OpenAI’s format: the SDK’s images.generate works with only its base URL changed. Pictures come back in the response, and we keep no copy.
Checked 6 November 2026
Make a picture
import base64
import os
from openai import OpenAI
client = OpenAI(
base_url="https://nokeep.ai/v1",
api_key=os.environ["NOKEEP_API_KEY"],
)
result = client.images.generate(
model="z-image-turbo",
prompt="A lighthouse on a rocky coast at dusk",
size="1024x1024",
)
with open("picture.webp", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))Models
| Model | Good for | Per image | Size | Longest prompt |
|---|---|---|---|---|
| chroma | An open model that reads long, detailed prompts. | $0.03 | Up to 1280 pixels a side, returned at 1.5x | 7,500 characters |
| z-image-turbo | The fastest here, for photographic pictures at volume. | $0.03 | Up to 1280 pixels a side | 7,500 characters |
| wai-illustrious | Anime and illustration. | $0.03 | Up to 1280 pixels a side | 1,500 characters |
| krea-2-turbo | Holds known characters and a house style, at 1K or 2K. | $0.08 (1K), $0.12 (2K) | 1:1, 3:2, 16:9, 21:9, 9:16, 2:3, 3:4, 4:5 | 5,000 characters |
GET /v1/models lists the same prices and limits.
Request
| Field | Takes | What it does |
|---|---|---|
model | Required | One of the model ids above. |
prompt | Required | What to draw, sent to the model as written. Over the model’s limit is refused, never cut. |
size | WIDTHxHEIGHT or auto | The picture’s size. The default is 1024x1024. See Sizes. |
aspect_ratio | 1:1, 3:2, 2:3, 4:3, 3:4, 4:5, 16:9, 9:16, 21:9 | A shape, in place of size. It wins when both are sent. |
n | 1 to 4 | How many pictures. You pay for those that come back. |
response_format | b64_json or url | The default is b64_json. url returns a data: URL, not a link to a stored file. |
output_format | webp, png or jpeg | The default is webp. |
resolution | 1K or 2K | krea-2-turbo only, and priced by it. |
seed | A whole number | The same seed and prompt give a similar picture. With n, each picture adds one to it. |
negative_prompt | Text | What to leave out. It isn’t read by the hard-limit check, and not every model takes it into account. |
steps | 1 to 50 | More steps take longer. Not every model uses it. |
cfg_scale | Above 0, up to 20 | How closely to follow the prompt. Not every model uses it. |
Any other field, such as quality, style or user, is dropped and named in the x-nokeep-ignored header. A field that carries a picture, such as image, is refused with 400 unsupported_input: these models work from text only.
Sizes
- A side can be at least 256 pixels, and the longer side no more than three times the shorter. Outside that is
400 unsupported_size. - A larger size is fitted inside 1280 pixels a side, keeping its shape. OpenAI’s 1536x1024 is drawn at 1280x848, for example.
chromareturns 1.5x the pixels they draw at, at no extra cost, so 1024x1024 comes back at 1536x1536.krea-2-turbodraws in named shapes, so asizebecomes the nearest one.- The response’s
sizeoraspect_ratioalways says what you got.
Response
{
"created": 1793960000,
"data": [
{
"b64_json": "UklGRk…"
}
],
"model": "z-image-turbo",
"output_format": "webp",
"size": "1024x1024",
"usage": {
"images": 1,
"nokeep_credits": 30
}
}The x-nokeep-credits and x-nokeep-balance headers say what the call cost and what is left, as on chat. A picture is billed when it comes back. A failed or refused one costs nothing.
What the models will make
Adult content is in scope on the models the host marks uncensored. z-image-turbo isn’t one of them, and held back the most in our checks, so it can come back softer than asked.
Four hard limits stay: sexual content involving minors, sexual content of real people, mass-casualty harm and targeting a real person. A prompt that crosses one gets 422 hard_limit and costs nothing. The check reads the prompt; see Hard limits. A model’s host can also refuse a request or hold back a result: that is 422 content_refused, also free.
Limits and errors
A key can make 60 image requests a minute, inside its 120 requests overall. Past that is 429 rate_limited with Retry-After. The errors page lists every code.
To check your code without spending anything, send sk-nokeep-test as the key. It runs every check above and answers with a one-pixel picture.
curl https://nokeep.ai/v1/images/generations \
-H "Authorization: Bearer $NOKEEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "chroma",
"prompt": "A lighthouse on a rocky coast at dusk",
"n": 2,
"aspect_ratio": "16:9",
"output_format": "png",
"seed": 42
}'