Ideogram Hello World
Overview
Generate your first AI image with Ideogram. Demonstrates the legacy /generate endpoint (JSON body) and the V3 /v1/ideogram-v3/generate endpoint (multipart form). Both return temporary image URLs that must be downloaded promptly.
Prerequisites
- Completed
ideogram-install-auth setup
IDEOGRAM_API_KEY environment variable set
- Node.js 18+ or Python 3.10+
Instructions
Step 1: Quick Test with curl
set -euo pipefail
# Legacy endpoint (V_2 model, JSON body)
curl -s -X POST https://api.ideogram.ai/generate \
-H "Api-Key: $IDEOGRAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_request": {
"prompt": "A cheerful golden retriever wearing sunglasses on a beach, with text saying \"Hello Ideogram!\"",
"model": "V_2",
"style_type": "REALISTIC",
"aspect_ratio": "ASPECT_16_9",
"magic_prompt_option": "AUTO"
}
}' | jq '.data[0] | {url, seed, resolution, is_image_safe}'
Step 2: TypeScript -- Generate and Download
// hello-ideogram.ts
import { writeFileSync } from "fs";
async function helloIdeogram() {
// Generate an image with embedded text (Ideogram's specialty)
const response = await fetch("https://api.ideogram.ai/generate", {
method: "POST",
headers: {
"Api-Key": process.env.IDEOGRAM_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
image_request: {
prompt: 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background, clean typography',
model: "V_2",
style_type: "DESIGN",
aspect_ratio: "ASPECT_1_1",
magic_prompt_option: "AUTO",
num_images: 1,
},
}),
});
if (!response.ok) {
throw new Error(`Generation failed: ${response.status} ${await response.text()}`);
}
const result = await response.json();
const image = result.data[0];
console.log("Generated image:");
console.log(" URL:", image.url);
console.log(" Seed:", image.seed);
console.log(" Resolution:", image.resolution);
console.log(" Style:", image.style_type);
console.log(" Safe:", image.is_image_safe);
// Download immediately -- URLs expire after ~1 hour
const imgResponse = await fetch(image.url);
const buffer = Buffer.from(await imgResponse.arrayBuffer());
writeFileSync("hello-ideogram.png", buffer);
console.log("Saved to hello-ideogram.png");
}
helloIdeogram().catch(console.error);
Step 3: Python -- Generate and Download
# hello_ideogram.py
import os, requests
response = requests.post(
"https://api.ideogram.ai/generate",
headers={
"Api-Key": os.environ["IDEOGRAM_API_KEY"],
"Content-Type": "application/json",
},
json={
"image_request": {
"prompt": 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background',
"model": "V_2",
"style_type": "DESIGN",
"aspect_ratio": "ASPECT_1_1",
"magic_prompt_option": "AUTO",
}
},
)
response.raise_for_status()
image = response.json()["data"][0]
print(f"URL: {image['url']}")
print(f"Seed: {image['seed']}")
# Download the image (URLs expire)
img_data = requests.get(image["url"]).content
with open("hello-ideogram.png", "wb") as f:
f.write(img_data)
print("Saved to hello-ideogram.png")
Key Parameters Quick Reference
| Parameter |
Values |
Default |
model |
V_1, V_1_TURBO, V_2, V_2_TURBO, V_2A, V_2A_TURBO |
V_2 |
style_type |
AUTO, GENERAL, REALISTIC, DESIGN, RENDER_3D, ANIME |
AUTO |
aspect_ratio |
ASPECT_1_1, ASPECT_16_9, ASPECT_9_16, ASPECT_3_2, ASPECT_2_3, ASPECT_4_3, ASPECT_3_4, ASPECT_10_16, ASPECT_16_10, ASPECT_1_3, ASPECT_3_1 |
ASPECT_1_1 |
magic_prompt_option |
AUTO, ON, OFF |
AUTO |
num_images |
1-4 |
1 |
Response Shape
{
"created": "2025-01-15T10:30:00Z",
"data": [
{
"url": "https://ideogram.ai/assets/image/...",
"prompt": "expanded prompt if magic_prompt was ON",
"resolution": "1024x1024",
"is_image_safe": true,
"seed": 12345,
"style_type": "DESIGN"
}
]
}
Error Handling
| Error |
HTTP Status |
Cause |
Solution |
| Auth error |
401 |
Missing or invalid Api-Key header |
Check IDEOGRAM_API_KEY env var |
| Safety rejected |
422 |
Prompt failed content filter |
Remove flagged terms, rephrase |
| Rate limited |
429 |
Too many in-flight requests |
Wait and retry with backoff |
| Bad request |
400 |
Invalid parameter values |
Check enum values match exactly |
Output
- Generated image file downloaded locally
- Console output with URL, seed, resolution, and safety status
- Seed value for reproducible regeneration
Resources
Next Steps
Proceed to ideogram-local-dev-loop for development workflow setup.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: jeremylongshore-claude-code-plugins-plus-skills-ideogram-hel3description: Ideogram Hello World4---5# Ideogram Hello World67## Overview8Generate your first AI image with Ideogram. Demonstrates the legacy `/generate` endpoint (JSON body) and the V3 `/v1/ideogram-v3/generate` endpoint (multipart form). Both return temporary image URLs that must be downloaded promptly.910## Prerequisites11- Completed `ideogram-install-auth` setup12- `IDEOGRAM_API_KEY` environment variable set13- Node.js 18+ or Python 3.10+1415## Instructions1617### Step 1: Quick Test with curl18```bash19set -euo pipefail20# Legacy endpoint (V_2 model, JSON body)21curl -s -X POST https://api.ideogram.ai/generate \22 -H "Api-Key: $IDEOGRAM_API_KEY" \23 -H "Content-Type: application/json" \24 -d '{25 "image_request": {26 "prompt": "A cheerful golden retriever wearing sunglasses on a beach, with text saying \"Hello Ideogram!\"",27 "model": "V_2",28 "style_type": "REALISTIC",29 "aspect_ratio": "ASPECT_16_9",30 "magic_prompt_option": "AUTO"31 }32 }' | jq '.data[0] | {url, seed, resolution, is_image_safe}'33```3435### Step 2: TypeScript -- Generate and Download36```typescript37// hello-ideogram.ts38import { writeFileSync } from "fs";3940async function helloIdeogram() {41 // Generate an image with embedded text (Ideogram's specialty)42 const response = await fetch("https://api.ideogram.ai/generate", {43 method: "POST",44 headers: {45 "Api-Key": process.env.IDEOGRAM_API_KEY!,46 "Content-Type": "application/json",47 },48 body: JSON.stringify({49 image_request: {50 prompt: 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background, clean typography',51 model: "V_2",52 style_type: "DESIGN",53 aspect_ratio: "ASPECT_1_1",54 magic_prompt_option: "AUTO",55 num_images: 1,56 },57 }),58 });5960 if (!response.ok) {61 throw new Error(`Generation failed: ${response.status} ${await response.text()}`);62 }6364 const result = await response.json();65 const image = result.data[0];6667 console.log("Generated image:");68 console.log(" URL:", image.url);69 console.log(" Seed:", image.seed);70 console.log(" Resolution:", image.resolution);71 console.log(" Style:", image.style_type);72 console.log(" Safe:", image.is_image_safe);7374 // Download immediately -- URLs expire after ~1 hour75 const imgResponse = await fetch(image.url);76 const buffer = Buffer.from(await imgResponse.arrayBuffer());77 writeFileSync("hello-ideogram.png", buffer);78 console.log("Saved to hello-ideogram.png");79}8081helloIdeogram().catch(console.error);82```8384### Step 3: Python -- Generate and Download85```python86# hello_ideogram.py87import os, requests8889response = requests.post(90 "https://api.ideogram.ai/generate",91 headers={92 "Api-Key": os.environ["IDEOGRAM_API_KEY"],93 "Content-Type": "application/json",94 },95 json={96 "image_request": {97 "prompt": 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background',98 "model": "V_2",99 "style_type": "DESIGN",100 "aspect_ratio": "ASPECT_1_1",101 "magic_prompt_option": "AUTO",102 }103 },104)105response.raise_for_status()106107image = response.json()["data"][0]108print(f"URL: {image['url']}")109print(f"Seed: {image['seed']}")110111# Download the image (URLs expire)112img_data = requests.get(image["url"]).content113with open("hello-ideogram.png", "wb") as f:114 f.write(img_data)115print("Saved to hello-ideogram.png")116```117118## Key Parameters Quick Reference119120| Parameter | Values | Default |121|-----------|--------|---------|122| `model` | `V_1`, `V_1_TURBO`, `V_2`, `V_2_TURBO`, `V_2A`, `V_2A_TURBO` | `V_2` |123| `style_type` | `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`, `RENDER_3D`, `ANIME` | `AUTO` |124| `aspect_ratio` | `ASPECT_1_1`, `ASPECT_16_9`, `ASPECT_9_16`, `ASPECT_3_2`, `ASPECT_2_3`, `ASPECT_4_3`, `ASPECT_3_4`, `ASPECT_10_16`, `ASPECT_16_10`, `ASPECT_1_3`, `ASPECT_3_1` | `ASPECT_1_1` |125| `magic_prompt_option` | `AUTO`, `ON`, `OFF` | `AUTO` |126| `num_images` | 1-4 | 1 |127128## Response Shape129```json130{131 "created": "2025-01-15T10:30:00Z",132 "data": [133 {134 "url": "https://ideogram.ai/assets/image/...",135 "prompt": "expanded prompt if magic_prompt was ON",136 "resolution": "1024x1024",137 "is_image_safe": true,138 "seed": 12345,139 "style_type": "DESIGN"140 }141 ]142}143```144145## Error Handling146| Error | HTTP Status | Cause | Solution |147|-------|-------------|-------|----------|148| Auth error | 401 | Missing or invalid `Api-Key` header | Check `IDEOGRAM_API_KEY` env var |149| Safety rejected | 422 | Prompt failed content filter | Remove flagged terms, rephrase |150| Rate limited | 429 | Too many in-flight requests | Wait and retry with backoff |151| Bad request | 400 | Invalid parameter values | Check enum values match exactly |152153## Output154- Generated image file downloaded locally155- Console output with URL, seed, resolution, and safety status156- Seed value for reproducible regeneration157158## Resources159- [Legacy Generate Endpoint](https://developer.ideogram.ai/api-reference/api-reference/generate)160- [V3 Generate Endpoint](https://developer.ideogram.ai/api-reference/api-reference/generate-v3)161- [Ideogram Prompt Tips](https://docs.ideogram.ai/using-ideogram/generation-settings/style)162163## Next Steps164Proceed to `ideogram-local-dev-loop` for development workflow setup.165166---167> Converted and distributed by [TomeVault](https://tomevault.io/claim/jeremylongshore) — claim your Tome and manage your conversions.168<!-- tomevault:4.0:skill_md:2026-04-11 -->