Chat Completions
Generate text responses using AI models. Fully compatible with the OpenAI Chat Completions API — use any OpenAI SDK by pointing it to https://gen.pollinations.ai.
Supports streaming, function calling, vision (image input), structured outputs, and reasoning/thinking modes depending on the model. JSON request bodies may be up to 100 MiB when inline media use image_url.url, video_url.url, or file.file_url data URIs. Larger requests also accept PDF file_data on OpenRouter models (a PDF data URI or raw base64 with mime_type application/pdf) and base64 input_audio.data on thinkingmachines/inkling. For requests over 32 MiB, each inline media item may be up to 20 MiB and the chat JSON must shrink below 16 MiB after media are replaced with URLs. Stored media are unlisted but publicly readable for provider access; retention is 30 days.
Successful text JSON responses contain usage. Text streams contain a usage chunk before [DONE]; missing text-provider usage fails the response.
Metadata is passed unchanged to endpoint agents; see the agent’s documentation for supported keys.
Media models that advertise this endpoint in /models also accept text prompts. Only the last user message's text is used (or a string input on Responses); history, instructions and text-generation settings are ignored. Empty prompts, malformed Unicode and prompts consisting only of . or .. return HTTP 400. Attachments are not supported; reference-required models return their normal missing-input error. Dialogue models expect one <voice>: <text> turn per line. Images return a Markdown image embed; audio, video and 3D return a Markdown link. Both include the plain public URL. With stream: true, events are emitted after generation finishes. Media is billed normally, without text-token usage: Responses returns usage: null; Chat JSON omits usage, while Chat streaming chunks contain usage: null and have no final usage chunk. Use the native media endpoints for generation settings.
Request
- Base URL: https://gen.pollinations.ai
- URL: https://gen.pollinations.ai/v1/chat/completions
- Auth: HTTP bearer
Request body
Response
Chat completion JSON or SSE stream
Changes
No recorded changes to this operation across all 1 revision of this API.