Quickstart

From zero to your first image and video in about ten minutes — get a key, submit, read the result.

Get an API key

Sign in to Jiufeng (Google or GitHub account) and open the Console → API Keys ↗ page, then click "Create key". The full key is shown only once — copy and store it immediately (it starts with sk-).

New accounts get 5 free credits — enough for 62 GPT Image 2 images at 1K, or one 5-second 768P video. Repeated runs (especially the video example) can use up the free credits — when your balance runs out, the submit call returns 402; top up on the pricing page. All examples below use the placeholder sk-YOUR_KEY; replace it with your own key.

export JF_KEY=sk-YOUR_KEY

Submit a generation task

Pick one. Every call returns a task_id immediately — generation is asynchronous.

0.08 credits at 1K — cheapest, best with text in the image

curl https://api.jiufeng.ai/v1/images/generations \
  -H "Authorization: Bearer $JF_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A Shiba Inu running through a neon cyberpunk city",
    "size": "16:9",
    "resolution": "1K"
  }'
import os, requests
 
r = requests.post(
    "https://api.jiufeng.ai/v1/images/generations",
    headers={"Authorization": f"Bearer {os.environ['JF_KEY']}"},
    json={
        "model": "gpt-image-2",
        "prompt": "A Shiba Inu running through a neon cyberpunk city",
        "size": "16:9",
        "resolution": "1K"
    },
)
task_id = r.json()["data"][0]["task_id"]
const r = await fetch("https://api.jiufeng.ai/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.JF_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"
  }),
});
const taskId = (await r.json()).data[0].task_id;

0.212 credits at 1K — photoreal detail; version is flare or sunburst, same price

curl https://api.jiufeng.ai/v1/images/generations \
  -H "Authorization: Bearer $JF_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.5-ext",
    "version": "flare",
    "prompt": "Studio product shot of an amber perfume bottle on dark stone, rim light",
    "size": "1:1",
    "resolution": "1K"
  }'
import os, requests
 
r = requests.post(
    "https://api.jiufeng.ai/v1/images/generations",
    headers={"Authorization": f"Bearer {os.environ['JF_KEY']}"},
    json={
        "model": "gpt-image-2.5-ext",
        "version": "flare",
        "prompt": "Studio product shot of an amber perfume bottle on dark stone, rim light",
        "size": "1:1",
        "resolution": "1K"
    },
)
task_id = r.json()["data"][0]["task_id"]
const r = await fetch("https://api.jiufeng.ai/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.JF_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "gpt-image-2.5-ext",
    "version": "flare",
    "prompt": "Studio product shot of an amber perfume bottle on dark stone, rim light",
    "size": "1:1",
    "resolution": "1K"
  }),
});
const taskId = (await r.json()).data[0].task_id;

3.75 credits for 5 s at 768P — note the endpoint is POST /v1/videos/generations

curl https://api.jiufeng.ai/v1/videos/generations \
  -H "Authorization: Bearer $JF_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "prompt": "Rainy neon street at night, a black umbrella walks away from camera",
    "resolution": "768P",
    "duration": 5
  }'
import os, requests
 
r = requests.post(
    "https://api.jiufeng.ai/v1/videos/generations",
    headers={"Authorization": f"Bearer {os.environ['JF_KEY']}"},
    json={
        "model": "MiniMax-H3",
        "prompt": "Rainy neon street at night, a black umbrella walks away from camera",
        "resolution": "768P",
        "duration": 5
    },
)
task_id = r.json()["data"][0]["task_id"]
const r = await fetch("https://api.jiufeng.ai/v1/videos/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.JF_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "MiniMax-H3",
    "prompt": "Rainy neon street at night, a black umbrella walks away from camera",
    "resolution": "768P",
    "duration": 5
  }),
});
const taskId = (await r.json()).data[0].task_id;

Response:

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

Want to try it in the browser? Use “Try it live” on the Generate images page (paste your own key; GPT Image 2 only), or sign in and use the console with no key.

Poll for the result

curl https://api.jiufeng.ai/v1/tasks/task_01M0CGM9MRSMD6R6PPNQWXQZ77 \
  -H "Authorization: Bearer $JF_KEY"

When status reaches completed, the files are here:

  • Images: data.result.images[0].url (an array)
  • Video: data.result.videos[0].url (an array)
{
  "code": 200,
  "data": {
    "id": "task_01M0CGM9MRSMD6R6PPNQWXQZ77",
    "status": "completed",
    "progress": 100,
    "credits_cost": 0.08,
    "result": {
      "images": [
        { "url": ["https://token-img.jiufeng.ai/f/image/xxx_0.png"], "expires_at": 1785163216 }
      ]
    }
  }
}

With jq: jq -r '.data.result.images[0].url[0]' (image) or jq -r '.data.result.videos[0].url[0]' (video).

The status values are pending / processing / completed / failed (not queued / success). Result files are kept for 30 days (the exact deadline is expires_at) — download or re-host them before then.

Images usually finish in a few seconds; video from tens of seconds to a few minutes.

(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.

Next steps

On this page

Quickstart · Jiufeng Open API