Skip to content
All docs

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

ModelGood forPer imageSizeLongest prompt
chromaAn open model that reads long, detailed prompts.$0.03Up to 1280 pixels a side, returned at 1.5x7,500 characters
z-image-turboThe fastest here, for photographic pictures at volume.$0.03Up to 1280 pixels a side7,500 characters
wai-illustriousAnime and illustration.$0.03Up to 1280 pixels a side1,500 characters
krea-2-turboHolds 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:55,000 characters

GET /v1/models lists the same prices and limits.

Request

FieldTakesWhat it does
modelRequiredOne of the model ids above.
promptRequiredWhat to draw, sent to the model as written. Over the model’s limit is refused, never cut.
sizeWIDTHxHEIGHT or autoThe picture’s size. The default is 1024x1024. See Sizes.
aspect_ratio1:1, 3:2, 2:3, 4:3, 3:4, 4:5, 16:9, 9:16, 21:9A shape, in place of size. It wins when both are sent.
n1 to 4How many pictures. You pay for those that come back.
response_formatb64_json or urlThe default is b64_json. url returns a data: URL, not a link to a stored file.
output_formatwebp, png or jpegThe default is webp.
resolution1K or 2Kkrea-2-turbo only, and priced by it.
seedA whole numberThe same seed and prompt give a similar picture. With n, each picture adds one to it.
negative_promptTextWhat to leave out. It isn’t read by the hard-limit check, and not every model takes it into account.
steps1 to 50More steps take longer. Not every model uses it.
cfg_scaleAbove 0, up to 20How 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.
  • chroma returns 1.5x the pixels they draw at, at no extra cost, so 1024x1024 comes back at 1536x1536.
  • krea-2-turbo draws in named shapes, so a size becomes the nearest one.
  • The response’s size or aspect_ratio always says what you got.

Response

JSON
{
  "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
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
}'