# Qwen 3 Pro API Documentation > LLM-optimized documentation for Qwen 3 Pro. Copy into your AI assistant for integration help. ## Overview **Model ID:** `qwen-3-pro` **Type:** Image Generation **Credit Cost:** 2 credits per image Qwen Image 3.0 Pro — text-to-image generation and image editing in one model. Generate from a prompt, or supply 1-3 reference images plus an instruction. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/qwen-3-pro/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 instruction when reference images are supplied. | | `image` | array | No | - | One to three input images. Omit for pure text-to-image generation. Accepts a single URL string or an array of URLs. Image order defines the array sequence; the output aspect ratio matches the last image when size is omitted. Accepted formats: JPG / JPEG / PNG / BMP / TIFF / WEBP / GIF; max 10 MB each. | | `size` | enum | No | - | Output image dimensions (width*height). Optional. In text-to-image mode, omitting it lets the model pick a resolution that suits the prompt; in edit mode it matches the input image's resolution. Pricing: 1K sizes cost 1 credit per image, 2K sizes cost 2 credits per image, and omitting size (auto) costs 2 credits per image. Total pixels stay between 512² and 2048²; the model rounds to the nearest multiple of 16. (Options: 1024*1024, 768*1152, 1152*768, 960*1280, 1280*960...) | | `n` | integer | No | 1 | Number of images to generate (1-6). Credit cost is per image. (min: 1, max: 6) | | `negative_prompt` | string | No | - | What to avoid in the output. | | `prompt_extend` | boolean | No | false | Server-side LLM prompt rewriting. Off by default so your exact edit instruction is followed. Turn on to auto-enhance short prompts. | | `watermark` | boolean | No | false | Adds a "Qwen-Image" watermark to the bottom-right corner. | | `seed` | integer | No | - | Random seed (0–2147483647). Same seed + same inputs yields similar (not identical) outputs. Omit for random. (min: 0, max: 2147483647) | ## Capabilities - Text to Image - Image to Image - NSFW Content ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/qwen-3-pro/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A corner bakery at golden hour, hand-painted window sign reading FLOUR & SALT in worn gold leaf, smaller chalkboard below reading Fresh Sourdough Daily, warm morning light" }' ``` **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/qwen-3-pro/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "A corner bakery at golden hour, hand-painted window sign reading FLOUR & SALT in worn gold leaf, smaller chalkboard below reading Fresh Sourdough Daily, warm morning light" } ) 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/qwen-3-pro/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "A corner bakery at golden hour, hand-painted window sign reading FLOUR & SALT in worn gold leaf, smaller chalkboard below reading Fresh Sourdough Daily, warm morning light" }) }); 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 | | `rate_limited` | 429 | Too many requests | | `internal_error` | 500 | Server error | ## Links - **Full Documentation:** https://pixeldojo.ai/api-platform/qwen-3-pro - **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