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

Prerequisites

An API key from the developer settings.

1. Set your API key

Export your API key as an environment variable.
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.
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);
The response includes a data array with the generated image and the download URL you need next.
{
  "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.
curl -o image.png "https://api.getimg.ai/v2/downloads/req-01HXYZABCD1234/0?exp=1760000000&sig=1d9c2f..."

Next steps

Generate images

Explore reference images, output formats, and response handling.

Generate videos

Learn the async submit, poll, and download flow.

Models

Check current model availability in the dashboard.

Models guide

Learn how to list and choose models with GET /v2/models.