AI 모델 API생성 작업

비동기 생성 작업 만들기

비동기 생성 작업을 만듭니다(비디오, 이미지, 오디오 생성 지원). application/jsonmultipart/form-data 요청 콘텐츠 형식을 모두 지원합니다.

POST
/generation/tasks

인증

BearerAuth

AuthorizationBearer <token>

Bearer Token 인증을 사용합니다. 형식: Authorization: Bearer sk-xxxxxx

In: header

요청 본문

application/json

model*string

Model name used for channel selection and upstream request conversion.

prompt?string

Prompt text. Required unless input is provided.

input?string

General text input. Also acts as prompt fallback.

action?string

Task action. Usually generate. For Suno, supports MUSIC and LYRICS; it can also be inferred from model.

negative_prompt?string

Negative prompt (applies to: video, image).

image?string

Single image URL, base64 input, or multipart file (applies to: video, image).

image_url?string

Alias of image; compatible with provider-style form uploads (applies to: video, image).

images?array<string>

Multiple image URLs, base64 inputs, or multipart files (applies to: video, image).

image_urls?array<string>

Alias of images; compatible with Fal-style image edit inputs (applies to: video, image).

input_reference?string

Reference image for OpenAI-compatible video tasks (applies to: video).

audio_url?string

Audio URL input (applies to: video, audio).

video_url?string

Video URL input or provider-specific video reference (applies to: video).

size?string

Size such as 1024x1024, 1280x720, or provider-specific values (applies to: video, image).

aspect_ratio?string

Aspect ratio, for example 16:9, 9:16, 1:1 (applies to: video, image).

ratio?string

Provider-specific ratio field (applies to: video, image).

resolution?string

Resolution such as 720P or 1080P (applies to: video).

width?integer

Output width when supported (applies to: image, video).

height?integer

Output height when supported (applies to: image, video).

duration?integer

Duration in seconds (applies to: video, audio).

seconds?string

OpenAI-compatible video duration field (applies to: video).

n?integer

Number of images (applies to: image).

seed?integer

Random seed (applies to: video, image).

quality?string

Image quality, for example standard, hd, or provider-specific values (applies to: image).

style?string

Image style (applies to: image).

response_format?string

Output response format, for example url or b64_json (applies to: image).

output_format?string

Provider output format, for example png, jpg, or webp (applies to: image).

voice?string

Voice name when supported (applies to: audio).

speed?number

Speech or audio speed when supported (applies to: audio).

title?string

Song or audio title (applies to: audio).

tags?string

Song style tags (applies to: audio).

lyrics?string

Lyrics text when supported (applies to: audio).

callback_url?string

Callback URL when supported by the upstream provider.

metadata?object

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

마지막 업데이트