Skip to Content
Cheapest Imagen

Quickstart

Make your first AI image with the Cheapest Imagen API in three steps: create a key, send one request and read the image from the response.

The API uses the same requests and responses as the OpenAI Images API. If you already call OpenAI, change the base URL and the key and keep the rest of your code.

1. Get an API key

Sign in and create a key on the API keys page. A new account has 5 free images, and they work through the API: GPT Image 2, 2.5 or 2.6 at 1K, one image per request. For anything else, top up first. A key starts with sk-cheap- and is shown once, so copy it when you create it.

2. Send a request

curl https://api.cheapestimagen.com/v1/images/generations \
  -H "Authorization: Bearer $YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a red fox in the snow",
    "size": "1536x1024"
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.cheapestimagen.com/v1",
    api_key="YOUR_KEY",
)
result = client.images.generate(
    model="gpt-image-2",
    prompt="a red fox in the snow",
    size="1536x1024",
)
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.cheapestimagen.com/v1',
  apiKey: process.env.YOUR_KEY,
});
const result = await client.images.generate({
  model: 'gpt-image-2',
  prompt: 'a red fox in the snow',
  size: '1536x1024',
});

3. Read the image

The response holds one entry per image. By default each entry carries the image as base64 in b64_json:

{
  "created": 1794660236,
  "data": [{ "b64_json": "iVBORw0KGgo..." }]
}

Send "response_format": "url" to get a link instead. Linked images are kept for 72 hours.

Synchronous or asynchronous

The request above is synchronous: it answers when the image is ready. If a request takes a long time, or you are sending many at once, use the asynchronous way: add "async": true to get a task id at once, then poll the task, or add webhook_url and we call you when it finishes. Both ways cost the same. Polling, reading many tasks in one call and webhooks are covered in Synchronous and asynchronous requests.

What it costs

GPT Image 2, 2.5 and 2.6 cost 8 credits per image; Nano Banana 2 and 2.1 cost 12; Nano Banana Pro, gpt-image-2-adobe and the flare variants 20; the sunburst variants 25; the Nano Banana stable channels (-1k, -2k, -4k) 60 to 180. Size and quality do not change the price (a credit is $0.001 to about $0.0018, see /pricing). A failed request costs nothing: credits are held when the request starts and returned for every image that is not delivered. The one exception: the Nano Banana stable channels (-1k, -2k, -4k) charge for images refused for their content.

On this page