A lightweight proxy service compatible with the OpenAI /v1/images/generations
endpoint. It forwards OpenAI-style image generation requests to Pollinations.
- ✅ OpenAI-style Compatibility
- 🔐 Requires
Authorization: Bearer pollinations
- 🐳 Docker & non-Docker ready
- ⚡ Built with FastAPI
.
├── main.py
├── requirements.txt
├── Dockerfile
└── README.md
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 5000
docker build -t pollinations-api .
docker run -d -p 5000:5000 pollinations-api
All requests must include the following header:
Authorization: Bearer pollinations
POST /v1/images/generations
{
"prompt": "a futuristic city with flying cars",
"width": 512,
"height": 512,
"model": "flux",
"enhance": true
}
Name | Type | Default | Description |
---|---|---|---|
prompt | string | — | Text description of the image to generate |
width | integer | 512 | Image width in pixels |
height | integer | 512 | Image height in pixels |
model | string | flux | The AI model to employ for image generation (see below) |
enhance | boolean | false | Apply high-resolution enhancement to the generated image |
The model
field influences both quality and generation style:
flux
: General purpose, good quality (default)flux-pro
: General, best quality but slowerflux-realism
: Realistically styled images without artistic embellishmentsflux-anime
: Ideal for anime, manga, and comic stylesflux-3d
: Best for intricate 3D-like scenesflux-cablyai
: General purpose with Cablyai inference engineturbo
: Medium to low quality, but marginally faster
Choose a task-specific model if your prompt is closely aligned with one of these styles. Otherwise, flux
is a solid general-purpose choice.
This project is licensed under the MIT License. See the LICENSE file for details.