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

# Generate your first video

> Create an account, prepare an inference key and credits, then submit a Wan3.0 video request with cURL and poll for the finished result.

Use the AntiRouter video API to submit a generation request, then retrieve the result with its task ID. This example creates a five-second, 720p video with `w3.0-video`. Check the model list and console for current availability and pricing.

## 1. Prepare your account and key

1. Open [Sign in](https://anti.rs/login), select **Create account**, and register with the verification code sent to your email.
2. Open [API Keys](https://anti.rs/app/api-keys), select **Create key** under **Inference keys**, and copy the new key.
3. [Add credits](https://docs.anti.rs/en/get-started/top-up.md) so your available balance covers the generation request.

Set your key in your server-side environment. The value below is a placeholder:

```bash theme={null}
export ANTI_API_KEY="sk-YOUR_INFERENCE_KEY"
```

## 2. Submit a video task

```bash cURL theme={null}
curl --request POST \
  --url "https://anti.rs/api/v1/services/aigc/video-generation/video-synthesis" \
  --header "Authorization: Bearer $ANTI_API_KEY" \
  --header "Content-Type: application/json" \
  --data '
{
  "model": "w3.0-video",
  "input": {
    "prompt": "A paper boat floats along a quiet stream at sunrise. Slow tracking shot, soft natural light."
  },
  "parameters": {
    "resolution": "720p",
    "ratio": "16:9",
    "duration": 5,
    "audio": true,
    "prompt_extend": true
  }
}
'
```

A successful submission returns HTTP `200`. The IDs below are illustrative. Save the actual `output.task_id` from your response:

```json 200 theme={null}
{
  "request_id": "3c22bd6d-4101-4c7d-8430-b7af1050e842",
  "output": {
    "task_id": "example-task-id",
    "task_status": "PENDING"
  }
}
```

## 3. Retrieve the result

Replace the task ID with the value from your response and use your inference key:

```bash theme={null}
export TASK_ID="YOUR_TASK_ID"

curl --request GET \
  --url "https://anti.rs/api/v1/tasks/$TASK_ID" \
  --header "Authorization: Bearer $ANTI_API_KEY"
```

Poll every three seconds as a starting point. `PENDING` and `RUNNING` mean the task is still in progress. Read `output.video_url` when the state is `SUCCEEDED`, and stop polling on `FAILED` or `CANCELED`. Querying a task does not create another generation.

## Troubleshooting

| Symptom | What to check |
| - | - |
| `401 unauthorized` | Use an enabled inference key and check your IP allowlist. |
| `402 insufficient_balance` | Add credits before submitting again. |
| `400 invalid_model_request` | Explicitly set `parameters.duration` to 3–14 or `-1`. |
| Polling timeout | Keep the task ID and query it later instead of submitting another generation. |

See [Generation](https://docs.anti.rs/en/api-reference/wan3/generation.md) for all fields and [Query Task](https://docs.anti.rs/en/api-reference/wan3/query-task.md) for statuses and a Python polling example.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.