Text

Text Generation With Messages

Generate text from an OpenAI-style messages array and return the assistant content directly.

Use /v1/chat/completions when you need the full OpenAI-compatible JSON response.

post/text

Request

  • Base URL: https://gen.pollinations.ai
  • URL: https://gen.pollinations.ai/text
  • Auth: HTTP bearer

Request body

modelstring

AI model for text generation. See /v1/models for full list.

metadataobject nullable

Passed unchanged to endpoint agents. Each agent documents the metadata keys it accepts.

modalitiesstring[]
frequency_penaltynumber nullable
repetition_penaltynumber nullable
logit_biasobject nullable
logprobsboolean nullable
top_logprobsinteger nullable
max_tokensinteger nullable
presence_penaltynumber nullable
seedinteger nullable
stopstring[]
streamboolean nullable
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'

Requests reasoning depth for models that support adjustable reasoning. "none" requests no reasoning.

temperaturenumber nullable

Sampling controls are ignored for model families that do not consistently support them, regardless of reasoning mode.

top_pnumber nullable
parallel_tool_callsboolean
userstring
prompt_cache_keystring
prompt_cache_retention'in_memory' | '24h'

Response

Generated text response, audio bytes, JSON message object, or SSE when stream=true

Changes

No recorded changes to this operation across all 1 revision of this API.