Skip to main content

1. Get an API key

Create an API key in the Dashboard. Use it as a bearer token:
For local scripts, store it in an environment variable:

2. Choose an endpoint

3. Create a task

This example creates a video task:
The response includes a task_id:

4. Poll the task

Use the task_id with the matching query endpoint:
Stop polling when status is Success, Failed, or Cancelled. When video generation succeeds, file_url contains the generated video URL. For image tasks, output_images contains generated image URLs.

5. Check usage and cost

The create response includes pricing information when available. For model-level pricing and parameters, open the model page in the API Reference or browse the model catalog.

Next

Use Models to pick the best model family, or open the API Reference for exact request schemas.