# WAN 2.7 Pro API Documentation > LLM-optimized documentation for WAN 2.7 Pro. Copy into your AI assistant for integration help. ## Overview **Model ID:** `wan-2.7-image-pro` **Type:** Image Generation **Credit Cost:** 2 credits per image Higher quality Wan 2.7 tier with 4K support for text-to-image ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/wan-2.7-image-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 | - | Text description of the image to generate | | `size` | enum | No | 2K | Output resolution. Use a tier (1K/2K/4K — recommended) or an explicit width*height. 4K (and 4K-tier dimensions like 3840*2160) is supported by the Pro model for text-to-image only; 1K and 2K are supported by both models in all modes. (Options: 1K, 2K, 4K, 1280*1280, 1024*1024...) | | `thinking_mode` | boolean | No | false | Improves text-to-image quality at the cost of slower generation | | `n` | integer | No | 1 | Number of images to generate. Default mode: 1-4. Image-set mode (enable_sequential=true): up to 12; the model picks the actual count, capped at n. (min: 1, max: 12) | | `enable_sequential` | boolean | No | false | When true, generates a coherent set of related images instead of independent variants. Disables thinking_mode and color_palette and lets n go up to 12. | | `seed` | integer | No | - | Random seed (0–2147483647). Same seed + same inputs yields similar (but not identical) outputs. Omit for random. (min: 0, max: 2147483647) | | `color_palette` | array | No | - | Custom color theme. Array of 3–10 (8 recommended) objects with `hex` (#RRGGBB) and `ratio` (e.g. "25.00%"); ratios must sum to 100.00%. Only effective when enable_sequential=false. | ## Supported Aspect Ratios - `1:1` - `16:9` - `9:16` - `4:3` - `3:4` - `5:4` - `4:5` ## 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/wan-2.7-image-pro/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A beautiful mountain landscape at golden hour, photorealistic", "aspect_ratio": "1:1" }' ``` **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/wan-2.7-image-pro/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "A beautiful mountain landscape at golden hour, photorealistic", "aspect_ratio": "1:1" } ) 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/wan-2.7-image-pro/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A beautiful mountain landscape at golden hour, photorealistic', aspect_ratio: '1:1' }) }); 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/wan-2.7-image-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