Skip to navigation

SDKs and Client Libraries

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:

A first request

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

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"])

Next, see Authentication and API keys, Responses and metadata and Rate limits.