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

# Introduction

> Max API Unified Interface Overview — Submit, Query, Cancel, Webhook

## Base URL

```
https://api.maxapi.io
```

## Workflow

All AI generation tasks follow the same asynchronous workflow:

<Steps>
  <Step title="Submit a Task">
    Call `POST /api/v1/task/submit`, specify the model and parameters, and receive a `taskId` immediately.
  </Step>

  <Step title="Wait for Results">
    Retrieve results by **polling** `GET /api/v1/task/:taskId` or by setting up a **Webhook callback**.
  </Step>

  <Step title="Get Output">
    Once the task succeeds, `result.urls` contains the generated image or video URLs.

    <Warning>File URLs are valid for **7 days** from the time of generation. Please download and save files promptly to avoid link expiration.</Warning>
  </Step>
</Steps>

## Common Response Format

**Success:**

```json theme={null}
{
  "code": 0,
  "msg": "ok",
  "data": { ... }
}
```

**Failure:**

```json theme={null}
{
  "code": 400,
  "msg": "错误描述"
}
```

## Task Status

| status       | Description                                            |
| ------------ | ------------------------------------------------------ |
| `PENDING`    | Queued, waiting to be processed                        |
| `PROCESSING` | Received by worker, preparing                          |
| `SUBMITTED`  | Submitted to upstream AI service, waiting for response |
| `SUCCESS`    | Task succeeded, `result` contains the output           |
| `FAILURE`    | Task failed                                            |
| `TIMEOUT`    | Task timed out                                         |
| `CANCELLED`  | Task was cancelled                                     |

**Status Transitions:**

```
PENDING → PROCESSING → SUBMITTED → SUCCESS
                                  → FAILURE
                                  → TIMEOUT
          (any non-terminal state) → CANCELLED
```

## Supported Models

<Tabs>
  <Tab title="Seedream Image">
    | model             | Description              |
    | ----------------- | ------------------------ |
    | `seedream-5-lite` | Seedream 5 Lite (Latest) |
    | `seedream-4.5`    | Seedream 4.5             |
    | `seedream-4`      | Seedream 4               |
  </Tab>

  <Tab title="Veo 3 Video">
    | model       | Engine       | Description                                               |
    | ----------- | ------------ | --------------------------------------------------------- |
    | `veo3`      | Veo 3.1      | Quality Mode (Default) — Best generation quality          |
    | `veo3_fast` | Veo 3.1      | Fast Mode — Speed optimized                               |
    | `veo3_lite` | Veo 3.1 Lite | Lite Mode — 720p only, lowest cost (no R2V, no upscaling) |
  </Tab>

  <Tab title="Nano Banana Image">
    | model             | Engine           | Description                    |
    | ----------------- | ---------------- | ------------------------------ |
    | `nano-banana`     | Gemini 2.5 Flash | Fast generation (\~10-20s)     |
    | `nano-banana-2`   | Gemini 3.1 Flash | Fast & high quality (\~10-20s) |
    | `nano-banana-pro` | Gemini 3.0 Pro   | High quality (\~30-60s)        |
  </Tab>

  <Tab title="Grok Imagine (xAI)">
    | model                                 | Type  | Description                                           |
    | ------------------------------------- | ----- | ----------------------------------------------------- |
    | `grok-imagine/text-to-image-lite`     | image | Text→Image, \$0.001/image, `n` up to 4                |
    | `grok-imagine/text-to-image-standard` | image | Text→Image, \$0.0012/image, `n` up to 10              |
    | `grok-imagine/text-to-image-pro`      | image | Text→Image, \$0.0015/image, `n` up to 10              |
    | `grok-imagine/image-to-image`         | image | Image edit (1-2 refs, fixed 1024×1024), \$0.015/image |
    | `grok-imagine/text-to-video`          | video | `duration` 6/10/12/16/20s, \$0.007/s                  |
    | `grok-imagine/image-to-video`         | video | Up to 5 reference images, \$0.007/s                   |

    Common params: `ratio` (`1:1` · `16:9` · `9:16`), `resolution` (images: `720p`/`1080p` · videos: `480p`/`720p`), `mode` (videos only: `fun`/`normal`/`spicy`/`custom`).
  </Tab>
</Tabs>
