# Ideogram 4.5 API Documentation > LLM-optimized documentation for Ideogram 4.5. Copy into your AI assistant for integration help. ## Overview **Model ID:** `ideogram-4-5` **Type:** Image Generation **Credit Cost:** 2 credits per image Ideogram 4.5: best-in-class text rendering, posters, logos and photoreal images, plus natural-language edits and Precise Edit that changes only what you ask. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/ideogram-4-5/run ``` ## Authentication All requests require an API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key: https://pixeldojo.ai/api-platform/api-keys ## Input Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `prompt` | string | Yes | - | What to create, or the edit to make when image_urls is supplied. Put any text you want rendered in quotes. | | `image_urls` | array | No | - | Optional, up to 5. Omit for text-to-image. With images the prompt is an edit or composition instruction. With precise: true the first image is edited and the rest guide the edit (up to 4). | | `precise` | boolean | No | false | Edits only: keep everything the prompt does not mention exactly as it is (framing, layout, other text). Uses Ideogram 4.5 Precise Edit. | | `mask_url` | string | No | - | Optional black-and-white mask for edits, matching the first image's size. BLACK pixels are edited, WHITE pixels are preserved (Ideogram's convention). | | `quality` | enum | No | medium | very_low (0.5 credits, edits only; text-to-image runs it as low), low (1 credit), medium (2 credits), high (6 credits). Per image. (Options: very_low, low, medium, high) | | `resolution` | enum | No | auto | Text-to-image output size. "auto" lets Ideogram pick the aspect ratio from the prompt. (Options: auto, 2048x2048, 1440x2880, 2880x1440, 1664x2496...) | | `edit_size` | enum | No | source | Edit output size (non-precise edits without a mask). "source" keeps the first image's proportions. (Options: source, 1024x1024, 1280x896, 896x1280, 1344x768...) | | `num_images` | integer | No | 1 | Images to generate (1-4). Billed per image. (min: 1, max: 4) | | `seed` | integer | No | - | Optional seed for reproducible results. | ## Capabilities - Text to Image - Image to Image ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/ideogram-4-5/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Retro travel poster for Lisbon, bold headline \"LISBOA\", tram on a hill at sunset, flat screen-print style", "resolution": "2560x1440" }' ``` **Response:** ```json { "jobId": "job_abc123...", "status": "pending", "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123", "creditCost": 2, "creditsRemaining": 95 } ``` ### 2. Poll for Results ```bash curl "https://pixeldojo.ai/api/v1/jobs/job_abc123" \ -H "Authorization: Bearer YOUR_API_KEY" ``` **Completed Response:** ```json { "jobId": "job_abc123...", "status": "completed", "output": { "images": ["https://temp.pixeldojo.ai/..."] }, "creditCost": 2 } ``` ## Python Example ```python import requests import time API_KEY = "YOUR_API_KEY" # Submit job response = requests.post( "https://pixeldojo.ai/api/v1/models/ideogram-4-5/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "Retro travel poster for Lisbon, bold headline \"LISBOA\", tram on a hill at sunset, flat screen-print style", "resolution": "2560x1440" } ) job = response.json() job_id = job["jobId"] # Poll for completion while True: status_response = requests.get( f"https://pixeldojo.ai/api/v1/jobs/{'{job_id}'}", headers={"Authorization": f"Bearer {API_KEY}"} ) status = status_response.json() if status["status"] == "completed": print("Output:", status["output"]) break elif status["status"] == "failed": print("Error:", status.get("error")) break time.sleep(2) ``` ## JavaScript Example ```javascript const API_KEY = 'YOUR_API_KEY'; // Submit job const submitResponse = await fetch('https://pixeldojo.ai/api/v1/models/ideogram-4-5/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "Retro travel poster for Lisbon, bold headline \"LISBOA\", tram on a hill at sunset, flat screen-print style", "resolution": "2560x1440" }) }); const job = await submitResponse.json(); // Poll for completion const pollForResult = async (jobId) => { while (true) { const statusResponse = await fetch(`https://pixeldojo.ai/api/v1/jobs/${jobId}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } }); const status = await statusResponse.json(); if (status.status === 'completed') return status.output; if (status.status === 'failed') throw new Error(status.error); await new Promise(r => setTimeout(r, 2000)); } }; const output = await pollForResult(job.jobId); console.log('Output:', output); ``` ## Error Codes | Code | Status | Description | |------|--------|-------------| | `unauthorized` | 401 | Invalid or missing API key | | `insufficient_credits` | 402 | Not enough credits | | `invalid_request` | 400 | Invalid parameters | | `model_not_found` | 404 | Model ID not found | | `internal_error` | 500 | Server error | ## Links - **Full Documentation:** https://pixeldojo.ai/api-platform/ideogram-4-5 - **API Keys:** https://pixeldojo.ai/api-platform/api-keys - **Buy Credits:** https://pixeldojo.ai/api-platform/buy-credits - **All Models:** https://pixeldojo.ai/api/v1/models - **OpenAPI Spec:** https://pixeldojo.ai/api/openapi