Image generation with NovelAI Diffusion V5 Full (async job), NovelAI's latest anime illustration model. Text-to-image, or image-to-image from one reference (strength / noise adjustable); 15 aspect ratios or a custom size in multiples of 64 (at most 1,048,576 pixels), 1K only; you get the original PNG signed by NovelAI. Billed per image, failures never charged.
Try in Playground →Authentication
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
Create an API Key in the console to start.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID, here nai-diffusion-5-full. |
| prompt | string | Yes | What to draw. NovelAI is trained on English tags and phrases, so English works best (e.g. `1girl, silver hair, school uniform, cherry blossoms`); other languages are accepted but followed less closely. V5 adds NovelAI's quality tags to the end. Explicit sexual content and any sexual content involving minors is refused at submit, nothing charged. |
| size | string | No | Aspect ratio: `1:1` (default for text-to-image), `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `1:2`, `2:1`, `9:21`, `21:9`, `1:3`, `3:1`, `1:4`, `4:1`, or `auto`; or a pixel size (e.g. `832x1216`): with both sides multiples of 64, each 256-2048, and at most 1,048,576 pixels in all it is drawn exactly; any other pixel size is matched by its ratio to one of the 15 (within 1.5%), and one that matches none returns 400 at submit, nothing charged. For image-to-image and inpainting, no size or `auto` picks the size closest to the reference's ratio. |
| resolution | string | No | Tier: `1K` only (the default). `2K` or `4K` returns 400 `unsupported_resolution` at submit, nothing charged. |
| n | integer | No | Always 1: one image per request. For several, submit several jobs at once; any other value returns 400 at submit, nothing charged. |
| image | string | No | Reference image; sending one makes it image-to-image (V5 Full / V5 Curated only): at most one, in `image` (or a single item in `images`). A public image URL, a data: URI or base64. The reference is scaled to the output size before rendering (centre-cropped first if its ratio differs, never stretched); `strength` sets how far the result may move from it. |
| negative_prompt | string | No | Negative prompt (V4.5 only): what to keep out of the picture, e.g. `lowres, blurry, text, watermark`. We always put `nsfw` in front; without one, NovelAI's standard negative prompt is used. The three V5 models always use NovelAI's own negative prompt, and this parameter has no effect on them. |
| seed | integer | No | Random seed, a whole number from 0 to 4294967295; the same prompt, parameters and seed give much the same picture. Random when left out. |
| steps | integer | No | Sampling steps, a whole number from 1 to 28, default 23. More steps settle the detail a little more; above 28 returns 400 at submit, nothing charged. |
| strength | number | No | Image-to-image strength, 0.01-0.99, default 0.7: higher moves further from the reference and follows the prompt more, lower stays closer to the reference. Image-to-image on V5 Full / V5 Curated only. |
| noise | number | No | Extra noise for image-to-image, 0-0.99, default 0: a little adds variation to the detail. Image-to-image on V5 Full / V5 Curated only. |
| output_format | string | No | PNG only: an `output_format` other than PNG or `background: "transparent"` returns 400 at submit, nothing charged. OpenAI parameters such as `quality` and `style` have no effect and do not change the price. Results come back as a `url`; with `response_format: "b64_json"` the result also carries a base64 copy. |
Request example
# 1) submit -> 202 {"id":"img_...","status":"queued"}
curl https://kovapi.com/v1/images/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "nai-diffusion-5-full", "prompt": "1girl, silver hair, school uniform, cherry blossoms, night city, looking at viewer", "size": "2:3", "seed": 12345}'
# image-to-image: one reference in "image" (a URL, a data: URI or base64), strength 0.01-0.99
curl https://kovapi.com/v1/images/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "nai-diffusion-5-full", "prompt": "1girl, silver hair, watercolor, soft light", "image": "https://example.com/sketch.png", "strength": 0.6, "size": "auto"}'
# 2) poll until status=succeeded
curl https://kovapi.com/v1/images/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'Response
{
"id": "img_3f9a...c2",
"object": "image.generation.job",
"status": "queued",
"model": "nai-diffusion-5-full"
}Image-to-Image
Image-to-image: put the reference in `image` (a public URL, a data: URI, or raw base64) to run true identity-preserving i2i — the model regenerates from it at the chosen size/ratio. Equivalent to calling /v1/images/edits.
curl https://kovapi.com/v1/images/generations -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "nai-diffusion-5-full", "prompt": "replace the background with a starry sky", "image": "https://example.com/ref.png", "size": "3:4"}'Image jobs (submit → poll for the result)
Image rendering usually takes 1–3 minutes, so the image endpoints are job-only: submitting a request returns a job id immediately (HTTP 202); poll for the result with that id — the server keeps rendering across restarts, so the image is never lost. Same for text-to-image and image-to-image. (The old "async": true field is no longer needed; it is accepted but ignored.)
curl https://kovapi.com/v1/images/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "nai-diffusion-5-full", "prompt": "an ink-wash poster with lots of negative space", "size": "3:4"}'{ "id": "img_3f9a...c2", "object": "image.generation.job", "status": "queued", "model": "nai-diffusion-5-full" }curl https://kovapi.com/v1/images/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
{
"id": "img_3f9a...c2",
"object": "image.generation.job",
"status": "succeeded",
"model": "nai-diffusion-5-full",
"data": [{ "url": "https://img.kovapi.com/i/9f86d081a8....png" }]
}🕑 data[0].url is a link on our image host that is kept for 7 days and then deleted automatically; to keep using it, download it and store it on your own storage or CDN.
status is one of queued / processing / succeeded / failed. On success the response carries data[].url. A job can only be polled by the account that created it. Image endpoints are always async — submit returns a job id; "async": true is accepted only for backward compatibility and ignored.
Rather not poll? Add callback_url when you submit and we push the result to your server when the job ends, or set a default endpoint in the console. Webhook docs →
Error codes
Every error carries error.message / error.type / error.code / error.param; branch on code. The most common ones are below; the full list is under Error codes.
| HTTP | code | Description |
|---|---|---|
| 401 | invalid_api_key | No key, or the key is invalid or disabled (missing_api_key, invalid_api_key). |
| 402 | insufficient_quota | Not enough balance, or the key has reached its budget (insufficient_quota). |
| 400 | invalid_request | A bad parameter or an unknown model (such as model_not_found); error.param names the field. |
| 429 | rate_limit_exceeded | Over the per-minute limit set on this key or a free model's daily quota, or the model is at capacity (rate_limit_exceeded). Wait the seconds in Retry-After when it is there, otherwise a few seconds, then retry. |
| 502 | upstream_* | The upstream failed or timed out and the automatic retries did not help; code says why, e.g. upstream_timeout or upstream_unavailable. Not billed; safe to retry. |