curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana",
"input": {
"prompt": "赛博朋克风格的东京街景"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad"
}
}
{
"code": 400,
"msg": "model is required"
}
{
"code": 400,
"msg": "content rejected by moderation",
"data": {
"flagged": true,
"categories": {
"harassment": false,
"harassment/threatening": false,
"sexual": true,
"hate": false,
"hate/threatening": false,
"illicit": false,
"illicit/violent": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"self-harm": false,
"sexual/minors": false,
"violence": false,
"violence/graphic": false
}
}
}
{
"code": 401,
"msg": "unauthorized"
}
任务 API
提交任务
提交 AI 生成任务,立即返回 taskId
POST
/
api
/
v1
/
task
/
submit
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana",
"input": {
"prompt": "赛博朋克风格的东京街景"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad"
}
}
{
"code": 400,
"msg": "model is required"
}
{
"code": 400,
"msg": "content rejected by moderation",
"data": {
"flagged": true,
"categories": {
"harassment": false,
"harassment/threatening": false,
"sexual": true,
"hate": false,
"hate/threatening": false,
"illicit": false,
"illicit/violent": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"self-harm": false,
"sexual/minors": false,
"violence": false,
"violence/graphic": false
}
}
}
{
"code": 401,
"msg": "unauthorized"
}
提交一个异步生成任务。所有模型(图片、视频)共享此接口,通过
model 参数区分。
该接口返回
400 时,可能表示两种情况:- 请求参数校验失败,例如缺少必填字段
- 请求在提交前被内容审核拦截
msg: "content rejected by moderation",以及 data.flagged、data.categories 等审核结果字段。模型名称。如
nano-banana、veo3 等。详见各模型文档。Webhook 回调地址。任务到达终态后,系统会向此地址发送 POST 请求。不支持 localhost。
调用方的用户标识,用于链路追踪。
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "nano-banana",
"input": {
"prompt": "赛博朋克风格的东京街景"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad"
}
}
{
"code": 400,
"msg": "model is required"
}
{
"code": 400,
"msg": "content rejected by moderation",
"data": {
"flagged": true,
"categories": {
"harassment": false,
"harassment/threatening": false,
"sexual": true,
"hate": false,
"hate/threatening": false,
"illicit": false,
"illicit/violent": false,
"self-harm/intent": false,
"self-harm/instructions": false,
"self-harm": false,
"sexual/minors": false,
"violence": false,
"violence/graphic": false
}
}
}
{
"code": 401,
"msg": "unauthorized"
}
⌘I