# Krea 3 API Documentation > LLM-optimized documentation for Krea 3. Copy into your AI assistant for integration help. ## Overview **Model ID:** `krea-3` **Type:** Image Generation **Credit Cost:** 1.5 credits per image Krea 3 for reference-driven images and edits. Start from up to 8 images, describe the change and keep the parts you like, or generate from a prompt alone. Up to 4K in 10 aspect ratios. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/krea-3/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 make, or what to change when image_urls is set. Refer to references by position ("the jacket from the second image") and to edit regions as @label or @1, @2. | | `image_urls` | array | No | - | Optional, up to 8. The first image is the one being edited; the others bring in objects, people or style. Each reference costs about as much as the output again. Four or fewer keep full detail. | | `edit_regions` | array | No | - | Optional, up to 24 boxes, needs image_urls. Each is { reference_index, x, y, width, height } with coordinates 0 to 1 of that image, plus an optional label (no spaces, call it as @label) and note (up to 600 characters, overrides the prompt inside the box). Boxes on the first image mark where the edit happens; boxes on the others mark objects to bring in. | | `thinking_level` | enum | No | fast | fast (default), or high for a stronger planning step on multi-step edits and many references. High takes longer. (Options: fast, high) | | `resolution` | enum | No | 2K | Output size: 1K (about 1 MP), 2K (about 4 MP) or 4K (about 16 MP). (Options: 1K, 2K, 4K) | | `aspect_ratio` | enum | No | - | Output shape. Defaults to 1:1 without references. With references, leave it out to keep the input shape, or set it to reframe. (Options: 1:1, 4:5, 3:4, 2:3, 9:16...) | | `num_images` | integer | No | 1 | Number of images to generate (1-4) (min: 1, max: 4) | | `seed` | integer | No | - | Integer seed for reproducible outputs. | | `output_format` | enum | No | png | Image output format (Options: png, jpeg, webp) | ## Supported Aspect Ratios - `1:1` - `4:5` - `3:4` - `2:3` - `9:16` - `5:4` - `4:3` - `3:2` - `16:9` - `21:9` ## Capabilities - Text to Image - Image to Image ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/krea-3/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "a quiet canal town at golden hour, film photograph", "resolution": "2K", "aspect_ratio": "3:2" }' ``` **Response:** ```json { "jobId": "job_abc123...", "status": "pending", "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123", "creditCost": 1.5, "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.5 } ``` ## Python Example ```python import requests import time API_KEY = "YOUR_API_KEY" # Submit job response = requests.post( "https://pixeldojo.ai/api/v1/models/krea-3/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "a quiet canal town at golden hour, film photograph", "resolution": "2K", "aspect_ratio": "3:2" } ) 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/krea-3/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "a quiet canal town at golden hour, film photograph", "resolution": "2K", "aspect_ratio": "3:2" }) }); 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); ``` ## Use Saved Characters (@Name) Write `@Name` in the prompt to use a character, product, outfit, location, prop or style saved in the account's Character Studio, for example `"@Mara on a beach at sunset"`. Its photos are added to `image_urls` automatically, after any images you send yourself, so your own image numbering is unchanged. List saved names with `GET /api/v1/characters` and save new ones with `POST /api/v1/characters`. An `@word` that names nothing saved stays plain text. ## 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/krea-3 - **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