> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developer.ideogram.ai/v2/llms.txt
> - v1: https://developer.ideogram.ai/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.ideogram.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ideogram.ai/_mcp/server.

> Ideogram doesn't publish official SDK packages. Call the API over plain HTTP from Python or TypeScript, or generate a client from the OpenAPI specification.

Ideogram doesn't publish official SDK packages for Python, TypeScript or other languages. The API is plain HTTP with JSON and multipart requests, so any HTTP library works. The examples in these guides use `requests` in Python and `fetch` in TypeScript.

## OpenAPI specification

Download the v2 specification to generate a typed client with the OpenAPI tooling you already use:

* JSON: [https://developer.ideogram.ai/openapi/ideogram-api-v2.json](https://developer.ideogram.ai/openapi/ideogram-api-v2.json)
* YAML: [https://developer.ideogram.ai/openapi/ideogram-api-v2.yaml](https://developer.ideogram.ai/openapi/ideogram-api-v2.yaml)

## A first request

Generate an image with Ideogram 4.5 and save it. Result links expire after 24 hours, so download the file.

#### Python

```python
import os

import requests

API = "https://api.ideogram.ai"
HEADERS = {"Api-Key": os.environ["IDEOGRAM_API_KEY"]}

response = requests.post(
  f"{API}/v2/image/generate/ideogram-4-5",
  headers=HEADERS,
  json={"prompt": "A ceramic mug on a wooden table, soft window light"},
)
response.raise_for_status()
image = response.json()["data"][0]
with open("mug.png", "wb") as f:
  f.write(requests.get(image["url"]).content)
print(image["seed"], image["resolution"])
```

#### TypeScript

```typescript
// Run as an ES module (for example first-request.mts), which allows top-level await.
import { writeFile } from "node:fs/promises";

const API = "https://api.ideogram.ai";

const response = await fetch(`${API}/v2/image/generate/ideogram-4-5`, {
  method: "POST",
  headers: { "Api-Key": process.env.IDEOGRAM_API_KEY!, "Content-Type": "application/json" },
  body: JSON.stringify({ prompt: "A ceramic mug on a wooden table, soft window light" }),
});
if (!response.ok) throw new Error(`Ideogram API error ${response.status}`);
const { data } = await response.json();
const file = await fetch(data[0].url).then((r) => r.arrayBuffer());
await writeFile("mug.png", Buffer.from(file));
console.log(data[0].seed, data[0].resolution);
```

#### cURL

```bash
curl -X POST https://api.ideogram.ai/v2/image/generate/ideogram-4-5 \
  -H "Api-Key: $IDEOGRAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A ceramic mug on a wooden table, soft window light"}'
```

Next, see [Authentication and API keys](/v2/ideogram-api/authentication), [Responses and metadata](/v2/ideogram-api/responses-and-metadata) and [Rate limits](/v2/ideogram-api/rate-limits).