JIUFENG API

Quickstart

Generate your first image in five minutes — get a key, submit, poll.

1. Get an API key

Sign in to Jiufeng and open the Console → API Keys page (opens in a new tab), then click "Create key". The full key is shown only once — copy and store it immediately (it starts with sk-jf-live-).

All examples below use the placeholder sk-jf-live-YOUR_KEY; replace it with your own key.

2. Submit a generation task

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": "A Shiba Inu running through a neon cyberpunk city",
    "n": 1,
    "size": "16:9",
    "resolution": "1K"
  }'

You get a task_id back immediately (generation is asynchronous):

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

Prefer to try it without leaving the page? Paste your key and generate right here:

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.

3. Poll for the result

Query the task with the task_id from the previous step:

curl https://api.jiufeng.ai/v1/tasks/task_01M0CGM9MRSMD6R6PPNQWXQZ77 \
  -H "Authorization: Bearer sk-jf-live-YOUR_KEY"

When status reaches completed, the result images are in data.result.url (an array):

{
  "code": 200,
  "data": {
    "id": "task_01M0CGM9MRSMD6R6PPNQWXQZ77",
    "status": "completed",
    "progress": "100%",
    "result": {
      "url": ["https://token-img.jiufeng.ai/f/image/xxx_0.png"],
      "expires_at": 1785163216,
      "image_ids": ["img_01M0..."]
    }
  }
}

The real status values are pending / processing / completed / failed (not queued / success). Result image URLs expire 24 hours after completion — download or re-host them promptly.

4. (Optional) Use a webhook instead of polling

Include a webhook field on submission and the platform will POST to <webhook>/callback when the task reaches a terminal state (completed / failed), so you can skip polling. See Webhook callbacks.

Polling tips

Use exponential backoff: start around 1s and stretch to a few seconds between calls — don't hammer every 100ms. See Query tasks.

On this page

Quickstart · Jiufeng Open API