> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 提交任务

> 提交 AI 生成任务，立即返回 taskId

提交一个异步生成任务。所有模型（图片、视频）共享此接口，通过 `model` 参数区分。

<Note>
  该接口返回 `400` 时，可能表示两种情况：

  * 请求参数校验失败，例如缺少必填字段
  * 请求在提交前被内容审核拦截

  如果是内容审核拦截，响应里会包含 `msg: "content rejected by moderation"`，以及 `data.flagged`、`data.categories` 等审核结果字段。
</Note>

<ParamField body="model" type="string" required>
  模型名称。如 `nano-banana`、`veo3` 等。详见各模型文档。
</ParamField>

<ParamField body="input" type="object" required>
  模型输入参数，包含 prompt 和模型特定参数。

  <Expandable title="properties">
    <ParamField body="prompt" type="string" required>
      提示词，描述你想生成的内容。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="callBackUrl" type="string">
  Webhook 回调地址。任务到达终态后，系统会向此地址发送 POST 请求。不支持 localhost。
</ParamField>

<ParamField body="user_id" type="string">
  调用方的用户标识，用于链路追踪。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  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": "赛博朋克风格的东京街景"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "code": 400,
    "msg": "model is required"
  }
  ```

  ```json 400 内容审核拦截 theme={null}
  {
    "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
      }
    }
  }
  ```

  ```json 401 theme={null}
  {
    "code": 401,
    "msg": "unauthorized"
  }
  ```
</ResponseExample>
