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

# Quickstart

> Generate your first image in a few minutes.

This guide walks through generating an image end to end: create a key, submit a
job, poll for the result.

<Steps>
  <Step title="Create an API key">
    From your BudgetPixel account dashboard, create a key (private beta — see
    [Availability](/introduction#availability)). Copy it immediately — the full secret
    (`bpx_live_…`) is shown only once.
  </Step>

  <Step title="Pick a model">
    List the models available to the API and their pricing:

    ```bash theme={null}
    curl https://api.budgetpixel.com/v1/models?type=image \
      -H "Authorization: Bearer $BUDGETPIXEL_API_KEY"
    ```

    Each image model has its own endpoint: `POST /v1/images/{model-name}`. For
    example, FLUX 2 Pro is `POST /v1/images/flux-2-pro` and SeeDream 4.5 is
    `POST /v1/images/seedream-4.5`.
  </Step>

  <Step title="Create an image job">
    Submit a generation request to the model's endpoint. The response returns a
    `job_id`.

    ```bash theme={null}
    curl -X POST https://api.budgetpixel.com/v1/images/flux-2-pro \
      -H "Authorization: Bearer $BUDGETPIXEL_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "prompt": "a red cube on a white background, product photo",
        "num_images": 1,
        "aspect_ratio": "1:1",
        "size": "1MP"
      }'
    ```

    ```json theme={null}
    { "id": "img_a1b2c3d4e5f6", "status": "pending", "model": "flux-2-pro" }
    ```
  </Step>

  <Step title="Poll for the result">
    Generation is asynchronous. Poll the job until `status` is `succeeded`; the
    `images` array then contains your result URLs.

    ```bash theme={null}
    curl https://api.budgetpixel.com/v1/images/img_a1b2c3d4e5f6 \
      -H "Authorization: Bearer $BUDGETPIXEL_API_KEY"
    ```

    ```json theme={null}
    {
      "id": "img_a1b2c3d4e5f6",
      "status": "succeeded",
      "model": "flux-2-pro",
      "images": [{ "position": 0, "url": "https://.../image.png" }]
    }
    ```

    Image URLs are short-lived presigned links (valid \~1 hour). Re-call the
    status endpoint for fresh URLs; the underlying objects expire 24 hours
    after generation.
  </Step>
</Steps>

## Generating video

Video uses the same per-model pattern as images: `POST /v1/videos/{model-name}`,
then poll `/v1/videos/{job_id}`. See [Async jobs](/concepts/async-jobs).

```bash theme={null}
curl -X POST https://api.budgetpixel.com/v1/videos/seedance-1.5-pro \
  -H "Authorization: Bearer $BUDGETPIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a calm ocean wave rolling onto a sandy beach, cinematic",
    "length_seconds": 5,
    "aspect_ratio": "16:9"
  }'
```

<Tip>
  You're charged in credits only when a job **succeeds** — never for failures,
  timeouts, or content blocked before generation. Check your balance any time with
  `GET /v1/account/credits`.
</Tip>
