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

# Quickstart

> Generate your first image in under two minutes.

This guide gets you from API key to first image generation with the fewest steps.

## Prerequisites

An API key from the [developer settings](https://getimg.ai/app/developer/api-keys).

## 1. Set your API key

Export your API key as an environment variable.

```bash theme={null}
export GETIMG_API_KEY="sk_your_key_here"
```

## 2. Generate an image

Send a request to the image generation endpoint with a model and prompt.

<CodeGroup>
  ```javascript Node.js theme={null}
  import GetimgAI from "getimg-ai";

  const client = new GetimgAI();

  const data = await client.images.generate({
    model: "seedream-5-lite",
    prompt: "A cinematic portrait of a cat astronaut",
    aspect_ratio: "1:1",
    resolution: "2K",
  });

  console.log(data);
  ```

  ```python Python theme={null}
  from getimg import GetimgAI

  client = GetimgAI()

  data = client.images.generate(
      model="seedream-5-lite",
      prompt="A cinematic portrait of a cat astronaut",
      aspect_ratio="1:1",
      resolution="2K",
  )

  print(data)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.getimg.ai/v2/images/generations \
    -H "Authorization: Bearer $GETIMG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "seedream-5-lite",
      "prompt": "A cinematic portrait of a cat astronaut",
      "aspect_ratio": "1:1",
      "resolution": "2K"
    }'
  ```
</CodeGroup>

The response includes a `data` array with the generated image and the download URL you need next.

```json theme={null}
{
  "id": "req-01HXYZABCD1234",
  "status": "completed",
  "model": "seedream-5-lite",
  "data": [
    {
      "url": "https://api.getimg.ai/v2/downloads/req-01HXYZABCD1234/0?exp=1760000000&sig=1d9c2f...",
      "width": 2048,
      "height": 2048,
      "mime_type": "image/jpeg",
      "deletes_at": "2026-05-02T12:30:00.000Z"
    }
  ],
  "usage": {
    "total_cost": 0.04,
    "billable_unit": "image",
    "unit_price": 0.04,
    "quantity": 1
  }
}
```

## 3. Download your image

The `url` in each `data` item is a signed download URL. Download the file before the `deletes_at` timestamp.

```bash theme={null}
curl -o image.png "https://api.getimg.ai/v2/downloads/req-01HXYZABCD1234/0?exp=1760000000&sig=1d9c2f..."
```

## Next steps

<CardGroup cols={2}>
  <Card title="Generate images" icon="image" href="/guides/generate-images">
    Explore reference images, output formats, and response handling.
  </Card>

  <Card title="Generate videos" icon="video" href="/guides/generate-videos">
    Learn the async submit, poll, and download flow.
  </Card>

  <Card title="Models" icon="microchip" href="https://getimg.ai/app/developer/models">
    Check current model availability in the dashboard.
  </Card>

  <Card title="Models guide" icon="list" href="/guides/models">
    Learn how to list and choose models with `GET /v2/models`.
  </Card>
</CardGroup>
