Skip to main content
POST
/
v1
/
tasks
Submit Task
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "action": "<string>",
  "prompt": "<string>",
  "callback_url": "<string>",
  "extra": {}
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"callback_url": "<string>",
"extra": {}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
callback_url: '<string>',
extra: {}
})
};

fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.qingbo.dev/v1/tasks"

payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"extra\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"extra\": {}\n}")
.asString();
{
  "pre_consumed_cost": 123
}
Submit an image, video, or audio generation task and immediately receive a task_id.

Request Parameters

model
string
required
Model name, such as "veo3", "gpt-4o-image", "sora2"
action
string
default:"generate"
Action type: generate, edit, upscale, variation, blend
prompt
string
Generation prompt text
callback_url
string
Webhook URL invoked when the task completes
extra
object
Pass-through field for model-specific parameters; forwarded directly to the upstream model
For more parameters, see Image Generation Overview or Video Generation Overview.

Response

{
  "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K",
  "model": "veo3",
  "action": "generate",
  "status": "queued",
  "created_at": 1720000000,
  "progress": 0,
  "pre_consumed_cost": 5500
}
pre_consumed_cost
integer
Quota pre-deducted at submission. The final charge is the cost field returned by the status endpoint once the task reaches a terminal state: success = actual charge; failure/cancellation = automatic full refund (cost: 0).

In-Request Waiting (Prefer: wait)

If you’d rather not poll, add a Prefer: wait=N header (N ≤ 60 seconds) to wait for the result within a single call:
  • Completed within the window → the full terminal result is returned directly (including result and cost)
  • Window exceeded → the current state plus pre_consumed_cost is returned; continue polling GET /v1/tasks/{task_id}
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Prefer: wait=60" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-image", "prompt": "A tiny blue circle"}'
Best suited for fast tasks such as image generation, prototyping, and testing. For long-running tasks (video), prefer polling or webhooks.

Idempotent Submission (Idempotency-Key)

Submit with an Idempotency-Key: <unique-string> header and repeated requests with the same key within 24 hours reuse the originally created task (same task_id, no double billing). Useful for network-retry scenarios.

Examples

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo3",
    "action": "generate",
    "prompt": "A cat walking on the beach at sunset",
    "duration": 5
  }'
import requests

response = requests.post(
    "https://www.qingbo.dev/v1/tasks",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "veo3",
        "action": "generate",
        "prompt": "A cat walking on the beach at sunset",
        "duration": 5
    }
)

task_id = response.json()["task_id"]