建立非同步生成任務
建立非同步生成任務(支援影片、圖像和音訊生成)。支援 application/json 和 multipart/form-data 兩種請求內容類型。
認證
BearerAuth
使用 Bearer Token 認證。
格式:Authorization: Bearer sk-xxxxxx
In: header
請求體
application/json
Model name used for channel selection and upstream request conversion.
Prompt text. Required unless input is provided.
General text input. Also acts as prompt fallback.
Task action. Usually generate. For Suno, supports MUSIC and LYRICS; it can also be inferred from model.
Negative prompt (applies to: video, image).
Single image URL, base64 input, or multipart file (applies to: video, image).
Alias of image; compatible with provider-style form uploads (applies to: video, image).
Multiple image URLs, base64 inputs, or multipart files (applies to: video, image).
Alias of images; compatible with Fal-style image edit inputs (applies to: video, image).
Reference image for OpenAI-compatible video tasks (applies to: video).
Audio URL input (applies to: video, audio).
Video URL input or provider-specific video reference (applies to: video).
Size such as 1024x1024, 1280x720, or provider-specific values (applies to: video, image).
Aspect ratio, for example 16:9, 9:16, 1:1 (applies to: video, image).
Provider-specific ratio field (applies to: video, image).
Resolution such as 720P or 1080P (applies to: video).
Output width when supported (applies to: image, video).
Output height when supported (applies to: image, video).
Duration in seconds (applies to: video, audio).
OpenAI-compatible video duration field (applies to: video).
Number of images (applies to: image).
Random seed (applies to: video, image).
Image quality, for example standard, hd, or provider-specific values (applies to: image).
Image style (applies to: image).
Output response format, for example url or b64_json (applies to: image).
Provider output format, for example png, jpg, or webp (applies to: image).
Voice name when supported (applies to: audio).
Speech or audio speed when supported (applies to: audio).
Song or audio title (applies to: audio).
Song style tags (applies to: audio).
Lyrics text when supported (applies to: audio).
Callback URL when supported by the upstream provider.
Provider-specific extra fields. Values are merged into provider payloads when supported.
curl -X POST "https://us-api.tokenhub.com/generation/tasks" \ -H "Content-Type: application/json" \ -d '{ "model": "wanx2.1-t2i-turbo" }'{
"code": "success",
"message": "string",
"data": {
"task_id": "task_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "queued",
"media_type": "image",
"model": "gpt-image-2",
"created_at": 1780000000
}
}回應體
application/json
最後更新於