> ## 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.

# Submit Task

> Submit an AI generation task and immediately receive a taskId

Submit an asynchronous generation task. All models (image, video) share this endpoint, distinguished by the `model` parameter.

<Note>
  `400` responses from this endpoint can mean either:

  * request validation failed, such as a missing required field
  * the request was blocked by pre-submission content moderation

  If the request is rejected by content moderation, the response includes `msg: "content rejected by moderation"` plus `data.flagged` and `data.categories` fields with the moderation result details.
</Note>

<ParamField body="model" type="string" required>
  Model name. For example, `nano-banana`, `veo3`, etc. See individual model documentation for details.
</ParamField>

<ParamField body="input" type="object" required>
  Model input parameters, including prompt and model-specific parameters.

  <Expandable title="properties">
    <ParamField body="prompt" type="string" required>
      Prompt describing the content you want to generate.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="callBackUrl" type="string">
  Webhook callback URL. When the task reaches a terminal state, the system will send a POST request to this URL. Localhost is not supported.
</ParamField>

<ParamField body="user_id" type="string">
  Caller's user identifier, used for request tracing.
</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": "A cyberpunk Tokyo street"
    }
  }'
  ```
</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 Content moderation 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>
