OmwAIOmwAI
API GuideAPI ReferenceProgramming Tools
Novel AI

Image Generation

Novel AI async image generation endpoint

The Novel AI image generation endpoint (focused on anime-style text-to-image). Submits a generation task from a prompt. The interface is async: on success it returns an image.task object; poll the Query Result endpoint with the returned task ID until status becomes completed to fetch the final image.

Billing model

This endpoint is billed under the model specified by the model field (nai-diffusion-4-5-full / nai-diffusion-4-5-curated), and the fee is deducted from your account balance.

Async flow

  1. POST /v1/images/async/generations submits the task and returns task_id (prefixed with task_) and status=queued/in_progress;
  2. Poll GET /v1/images/async/generations/{task_id} with that task_id;
  3. When status=completed, the data array contains the final image URL (url field); when failed, error explains why.

Images are kept for about 2 hours

The returned image URL is temporary (metadata.assetsExpireAt holds the expiry time in Unix seconds); images are kept for about 2 hours and then deleted automatically. Download them before they expire if you need long-term storage.

POST
/v1/images/async/generations

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx 令牌需开通对应模型的调用权限。

In: header

Request Body

application/json

model*string

模型名称,可选:nai-diffusion-4-5-full、nai-diffusion-4-5-curated

prompt*string

提示词,描述希望生成的图片内容

n?integer

生成数量(1-4),默认 1

Range1 <= value <= 4
size?string

输出尺寸(像素,OpenAI 风格 宽x高),例如 1024x1024、竖版 832x1216、横版 1216x832。不传默认 1024x1024

Response Body

application/json

application/json

application/json

curl -X POST "https://www.omwai.xyz/v1/images/async/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "nai-diffusion-4-5-curated",    "prompt": "1girl, professional office lady, warm smile, masterpiece, best quality",    "size": "832x1216",    "n": 1  }'
{
  "id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "task_id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "object": "image.task",
  "model": "nai-diffusion-4-5-curated",
  "status": "queued",
  "progress": "20%",
  "created_at": 1788256630,
  "completed_at": 1788256720
}
{
  "code": "invalid_request",
  "message": "string"
}
{
  "code": "string",
  "message": "string"
}

Note

A successful submission (HTTP 200) only means the task was accepted, not that the image is ready. Always poll the query endpoint until status=completed.

How is this guide?

Last updated on