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.
Source: jeremylongshore/claude-code-plugins-plus-skills → skills/.curated/ideogram-hello-world/SKILL.md
Also appears in: jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/ideogram-pack/skills/ideogram-hello-world/SKILL.md
1---2name: ideogram-hello-world3description: "'Create a minimal working Ideogram image generation example. Use when starting a new Ideogram integration, testing your setup, or learning basic Ideogram API patterns. Trigger with phrases like \"ideogram hello world\", \"ideogram example\", \"ideogram quick start\", \"simple ideogram code\", \"first ideogram image\". '"4allowed-tools: "Read, Write, Edit, Bash(curl:*), Bash(node:*), Bash(npx:*)"5category: media-and-creative6source_repo: jeremylongshore/claude-code-plugins-plus-skills7source_path: "skills/.curated/ideogram-hello-world/SKILL.md"8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/skills/.curated/ideogram-hello-world/SKILL.md9---1011# Ideogram Hello World1213## Overview1415Generate 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.1617## Prerequisites1819- Completed `ideogram-install-auth` setup20- `IDEOGRAM_API_KEY` environment variable set21- Node.js 18+ or Python 3.10+2223## Instructions2425### Step 1: Quick Test with curl2627```bash28set -euo pipefail29# Legacy endpoint (V_2 model, JSON body)30curl -s -X POST https://api.ideogram.ai/generate \31 -H "Api-Key: $IDEOGRAM_API_KEY" \32 -H "Content-Type: application/json" \33 -d '{34 "image_request": {35 "prompt": "A cheerful golden retriever wearing sunglasses on a beach, with text saying \"Hello Ideogram!\"",36 "model": "V_2",37 "style_type": "REALISTIC",38 "aspect_ratio": "ASPECT_16_9",39 "magic_prompt_option": "AUTO"40 }41 }' | jq '.data[0] | {url, seed, resolution, is_image_safe}'42```4344### Step 2: TypeScript -- Generate and Download4546```typescript47// hello-ideogram.ts48import { writeFileSync } from "fs";4950async function helloIdeogram() {51 // Generate an image with embedded text (Ideogram's specialty)52 const response = await fetch("https://api.ideogram.ai/generate", {53 method: "POST",54 headers: {55 "Api-Key": process.env.IDEOGRAM_API_KEY!,56 "Content-Type": "application/json",57 },58 body: JSON.stringify({59 image_request: {60 prompt: 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background, clean typography',61 model: "V_2",62 style_type: "DESIGN",63 aspect_ratio: "ASPECT_1_1",64 magic_prompt_option: "AUTO",65 num_images: 1,66 },67 }),68 });6970 if (!response.ok) {71 throw new Error(`Generation failed: ${response.status} ${await response.text()}`);72 }7374 const result = await response.json();75 const image = result.data[0];7677 console.log("Generated image:");78 console.log(" URL:", image.url);79 console.log(" Seed:", image.seed);80 console.log(" Resolution:", image.resolution);81 console.log(" Style:", image.style_type);82 console.log(" Safe:", image.is_image_safe);8384 // Download immediately -- URLs expire after ~1 hour85 const imgResponse = await fetch(image.url);86 const buffer = Buffer.from(await imgResponse.arrayBuffer());87 writeFileSync("hello-ideogram.png", buffer);88 console.log("Saved to hello-ideogram.png");89}9091helloIdeogram().catch(console.error);92```9394### Step 3: Python -- Generate and Download9596```python97# hello_ideogram.py98import os, requests99100response = requests.post(101 "https://api.ideogram.ai/generate",102 headers={103 "Api-Key": os.environ["IDEOGRAM_API_KEY"],104 "Content-Type": "application/json",105 },106 json={107 "image_request": {108 "prompt": 'Modern poster design with bold text "HELLO WORLD" in neon gradient, dark background',109 "model": "V_2",110 "style_type": "DESIGN",111 "aspect_ratio": "ASPECT_1_1",112 "magic_prompt_option": "AUTO",113 }114 },115)116response.raise_for_status()117118image = response.json()["data"][0]119print(f"URL: {image['url']}")120print(f"Seed: {image['seed']}")121122# Download the image (URLs expire)123img_data = requests.get(image["url"]).content124with open("hello-ideogram.png", "wb") as f:125 f.write(img_data)126print("Saved to hello-ideogram.png")127```128129## Key Parameters Quick Reference130131| Parameter | Values | Default |132|-----------|--------|---------|133| `model` | `V_1`, `V_1_TURBO`, `V_2`, `V_2_TURBO`, `V_2A`, `V_2A_TURBO` | `V_2` |134| `style_type` | `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`, `RENDER_3D`, `ANIME` | `AUTO` |135| `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` |136| `magic_prompt_option` | `AUTO`, `ON`, `OFF` | `AUTO` |137| `num_images` | 1-4 | 1 |138139## Response Shape140141```json142{143 "created": "2025-01-15T10:30:00Z",144 "data": [145 {146 "url": "https://ideogram.ai/assets/image/...",147 "prompt": "expanded prompt if magic_prompt was ON",148 "resolution": "1024x1024",149 "is_image_safe": true,150 "seed": 12345,151 "style_type": "DESIGN"152 }153 ]154}155```156157## Error Handling158159| Error | HTTP Status | Cause | Solution |160|-------|-------------|-------|----------|161| Auth error | 401 | Missing or invalid `Api-Key` header | Check `IDEOGRAM_API_KEY` env var |162| Safety rejected | 422 | Prompt failed content filter | Remove flagged terms, rephrase |163| Rate limited | 429 | Too many in-flight requests | Wait and retry with backoff |164| Bad request | 400 | Invalid parameter values | Check enum values match exactly |165166## Output167168- Generated image file downloaded locally169- Console output with URL, seed, resolution, and safety status170- Seed value for reproducible regeneration171172## Resources173174- [Legacy Generate Endpoint](https://developer.ideogram.ai/api-reference/api-reference/generate)175- [V3 Generate Endpoint](https://developer.ideogram.ai/api-reference/api-reference/generate-v3)176- [Ideogram Prompt Tips](https://docs.ideogram.ai/using-ideogram/generation-settings/style)177178## Next Steps179180Proceed to `ideogram-local-dev-loop` for development workflow setup.181182---183184**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `skills/.curated/ideogram-hello-world/SKILL.md`185186**Also appears in:** `jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/ideogram-pack/skills/ideogram-hello-world/SKILL.md`