API Reference
AvatarMe API Documentation
Overview
The AvatarMe API allows you to integrate AI image generation into your applications. All models are accessible through a unified API interface.
Authentication
All API requests require an API key. Get your key from the dashboard.
Authorization: Bearer YOUR_API_KEYGenerate Image
Generate an image from a text prompt.
Endpoint
POST https://api.avatarme.app/v1/generateRequest Body
{
"model": "gpt-image-1.5",
"prompt": "A modern coffee shop with warm lighting",
"size": "1024x1024",
"quality": "high"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model to use for generation |
prompt | string | Yes | Text description of the image |
size | string | No | Image size (default: 1024x1024) |
quality | string | No | Quality level: standard, high |
Available Models
| Model ID | Description |
|---|---|
gpt-image-1.5 | OpenAI GPT Image 1.5 |
flux-2 | Black Forest Labs FLUX.2 |
midjourney-v7 | Midjourney v7 |
hidream-i1 | HiDream-I1 |
nano-banana-pro | Google Nano Banana Pro |
recraft | Recraft |
Response
{
"id": "img_abc123",
"url": "https://cdn.avatarme.app/images/abc123.png",
"model": "gpt-image-1.5",
"prompt": "A modern coffee shop with warm lighting",
"created_at": "2026-01-15T10:30:00Z"
}Code Examples
JavaScript/TypeScript
const response = await fetch('https://api.avatarme.app/v1/generate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'flux-2',
prompt: 'Professional product photo of headphones',
size: '1024x1024',
}),
});
const data = await response.json();
console.log(data.url);Python
import requests
response = requests.post(
'https://api.avatarme.app/v1/generate',
headers={'Authorization': f'Bearer {API_KEY}'},
json={
'model': 'flux-2',
'prompt': 'Professional product photo of headphones',
'size': '1024x1024',
}
)
data = response.json()
print(data['url'])cURL
curl -X POST https://api.avatarme.app/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2",
"prompt": "Professional product photo of headphones",
"size": "1024x1024"
}'Rate Limits
| Plan | Requests/minute | Requests/day |
|---|---|---|
| Free | 5 | 50 |
| Pro | 60 | 1,000 |
| Lifetime | 120 | Unlimited |
Error Codes
| Code | Description |
|---|---|
| 400 | Bad request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 429 | Rate limit exceeded |
| 500 | Server error |
AvatarMe Docs