Pollinations API Interface Explained
Pollinations provides a rich API interface that is completely free to use. Developers can use a variety of AI functions through a simple request.
The main API endpoints include:
- Image Generation::
GET https://image.pollinations.ai/prompt/{prompt} - Text Generation::
GET https://text.pollinations.ai/{prompt} - Audio Generation::
GET https://text.pollinations.ai/{prompt}?model=openai-audio&voice={voice} - Model List::
GET https://text.pollinations.ai/models
Example of a Python call::
If you need to download the generated images via Python:
import requests
url = "https://pollinations.ai/p/夜晚星空"
response = requests.get(url)
with open("image.jpg", "wb") as f:
f.write(response.content)
React Integration Methods::
Install first:npm install @pollinations/react
Then:
import { usePollinationsImage } from '@pollinations/react';
const imageUrl = usePollinationsImage("巴黎夜景", { width: 800 });
This answer comes from the articlePollinations: free big model services in the form of URL splicing and APIsThe































