# Reve 2.1 API Documentation
> LLM-optimized documentation for Reve 2.1. Copy into your AI assistant for integration help.
## Overview
**Model ID:** `reve`
**Type:** Image Generation
**Credit Cost:** 4 credits per image
Reve 2.1 — generate from text, edit a single image, or remix up to 8 reference images with frame-level prompt control.
## Endpoint
```
POST https://pixeldojo.ai/api/v1/models/reve/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. When reference images are provided, describes how to edit or combine them. Reference a specific image from the prompt with N (0-based position in reference_images). |
| `reference_images` | array | No | - | Ordered list of up to 8 image URLs to edit (1 image) or remix (2-8 images). Leave empty for text-to-image generation. Address individual images from the prompt with N. |
| `aspect_ratio` | enum | No | auto | Desired aspect ratio of the generated image. Use 'auto' to let the model choose an appropriate ratio for the request. (Options: auto, 4:1, 3:1, 21:9, 2:1...) |
## Supported Aspect Ratios
- `1:1`
- `16:9`
- `9:16`
- `4:3`
- `3:4`
- `3:2`
- `2:3`
- `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/reve/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene mountain landscape at sunset with snow-capped peaks",
"aspect_ratio": "3:2"
}'
```
**Response:**
```json
{
"jobId": "job_abc123...",
"status": "pending",
"statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123",
"creditCost": 4,
"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": 4
}
```
## Python Example
```python
import requests
import time
API_KEY = "YOUR_API_KEY"
# Submit job
response = requests.post(
"https://pixeldojo.ai/api/v1/models/reve/run",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
},
json={
"prompt": "A serene mountain landscape at sunset with snow-capped peaks",
"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/reve/run', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"prompt": "A serene mountain landscape at sunset with snow-capped peaks",
"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);
```
## 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/reve
- **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