# FLUX 3 Image API Documentation > LLM-optimized documentation for FLUX 3 Image. Copy into your AI assistant for integration help. ## Overview **Model ID:** `flux-3-image` **Type:** Image Generation **Credit Cost:** 1 credits per image Black Forest Labs FLUX 3: photoreal text-to-image up to 4K, edits with up to 10 reference images, and web-grounded generation for real products and places. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/flux-3-image/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 apply when image_urls is supplied. | | `image_urls` | array | No | - | Optional, up to 10. With references the prompt edits or combines them; refer to them as image 1, image 2, ... Each must be at least 256x256 and at most 16 MP. | | `resolution` | enum | No | 1k | 768sq (1 credit), 1k (1 credit), 1.5k (1 credit), 2k (1.5 credits), 4k (8 credits). (Options: 768sq, 1k, 1.5k, 2k, 4k) | | `aspect_ratio` | enum | No | auto | "auto" picks the ratio from the prompt and the first reference image. (Options: auto, 21:9, 2:1, 16:9, 3:2...) | | `grounding` | boolean | No | true | Let the model research the prompt with web and image search before generating (real products, places, current events). On by default. | | `output_format` | enum | No | jpg | Image format. (Options: jpg, png, webp) | ## Supported Aspect Ratios - `21:9` - `2:1` - `16:9` - `3:2` - `7:5` - `4:3` - `5:4` - `1:1` - `4:5` - `3:4` - `5:7` - `2:3` - `9:16` - `1:2` - `9:21` ## Capabilities - Text to Image - Image to Image ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/flux-3-image/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A ceramicist trimming a bowl on a wheel, late afternoon window light, clay dust in the air", "aspect_ratio": "16:9" }' ``` **Response:** ```json { "jobId": "job_abc123...", "status": "pending", "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123", "creditCost": 1, "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": 1 } ``` ## Python Example ```python import requests import time API_KEY = "YOUR_API_KEY" # Submit job response = requests.post( "https://pixeldojo.ai/api/v1/models/flux-3-image/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "A ceramicist trimming a bowl on a wheel, late afternoon window light, clay dust in the air", "aspect_ratio": "16:9" } ) 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/flux-3-image/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "A ceramicist trimming a bowl on a wheel, late afternoon window light, clay dust in the air", "aspect_ratio": "16:9" }) }); 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/flux-3-image - **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