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

# Quickstart

> Submit your first generation task, poll until it finishes, and download the result.

Every WideRouter job follows the same three steps regardless of whether you are
generating an image or a video, and regardless of which model you pick.

<Info>
  **Scaffold notice.** The endpoint paths and field names below are placeholders
  from the repository bootstrap. Replace them with the real API surface, then
  regenerate the localized pages.
</Info>

## Get an API key

Create a key in the console, then export it so the examples below can read it.
Never hard-code a key into a file you commit.

```bash theme={null}
export WIDEROUTER_API_KEY="sk-your-api-key"
```

## Create a task

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.widerouter.com/v1/tasks \
    -H "Authorization: Bearer $WIDEROUTER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "your-model-id",
      "prompt": "a lighthouse at dusk"
    }'
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.post(
      "https://api.widerouter.com/v1/tasks",
      headers={"Authorization": f"Bearer {os.environ['WIDEROUTER_API_KEY']}"},
      json={"model": "your-model-id", "prompt": "a lighthouse at dusk"},
      timeout=30,
  )
  task_id = resp.json()["id"]
  ```
</CodeGroup>

The call returns immediately with a task id. Generation happens in the background.

## Poll until it finishes

Poll the task endpoint with backoff until the status reaches a terminal state,
then download whatever the task produced.

<Warning>
  Poll with backoff, not in a tight loop. Start around two seconds and grow the
  interval; a busy client that polls every 100 ms will get rate limited without
  finishing any faster.
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Models" icon="layers">
    Which parameters each model accepts, and what they default to.
  </Card>

  <Card title="API reference" icon="terminal">
    Full request and response schemas with an interactive playground.
  </Card>
</CardGroup>
