JIUFENG API

Generate images

POST /v1/images/generations — submit an asynchronous generation task.

POST /v1/images/generations

Submit a generation task; it returns a task_id immediately (generation is asynchronous). Then poll via Query tasks, or receive a terminal-state Webhook.

Image-to-image / reference images use this same endpoint — just pass source images via image_urls; there is no separate edit endpoint.

Try it
With your key
No keyLogged in? Try it in the Console PlaygroundRuns on your account — no API key needed. The fastest way to see generation working.
or
Verify your API integration

Paste your own sk- key to confirm your public API access is wired up correctly.

This makes a real API call with your key and consumes credits.

🔒 Your key is used only for this call and is never saved — it clears when you refresh.

Get a key in the console →
Paste your API key to run.
Result
Your generated image will appear here.

Request parameters

FieldTypeRequiredDescription
promptstringYesThe prompt
modelstringNoCurrently gpt-image-2 (more models coming soon)
sizestringNoAspect ratio (not pixels), e.g. 16:9 / 1:1 / 9:16
resolutionstringNoQuality tier: 1K / 2K / 4K
nintegerNoNumber of images, default 1
image_urlsstring[]NoReference / source image URLs, up to 15
webhookstringNoCallback base URL; the platform POSTs to <webhook>/callback on terminal states only (see Webhook)
languagestringNoError-message language (zh / en / ko / ja)

Field names follow the Jiufeng gateway: quality is resolution (not upscale), reference images are image_urls, and size is an aspect ratio, not a pixel dimension.

Examples

curl
curl https://api.jiufeng.ai/v1/images/generations \
  -H "Authorization: Bearer sk-jf-live-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Match the composition of this image, but with a snowy mountain backdrop",
    "size": "1:1",
    "resolution": "2K",
    "image_urls": ["https://your-cdn.example.com/ref1.png"]
  }'
Python
import requests
 
resp = requests.post(
    "https://api.jiufeng.ai/v1/images/generations",
    headers={"Authorization": "Bearer sk-jf-live-YOUR_KEY"},
    json={
        "model": "gpt-image-2",
        "prompt": "A Shiba Inu running through a neon cyberpunk city",
        "size": "16:9",
        "resolution": "1K",
        "n": 1,
    },
)
task_id = resp.json()["data"][0]["task_id"]
print(task_id)
JavaScript
const resp = await fetch("https://api.jiufeng.ai/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer sk-jf-live-YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "gpt-image-2",
    prompt: "A Shiba Inu running through a neon cyberpunk city",
    size: "16:9",
    resolution: "1K",
    n: 1,
  }),
});
const { data } = await resp.json();
const taskId = data[0].task_id;

Response

{
  "code": 200,
  "data": [
    { "status": "submitted", "task_id": "task_01M0CGM9MRSMD6R6PPNQWXQZ77" }
  ]
}

Once you have the task_id:

On this page