Text

Create Message (Anthropic-compatible)

Anthropic Messages API for Claude Code, the Anthropic SDKs, and other Messages clients. Point the client's base URL at https://gen.pollinations.ai and authenticate with Authorization: Bearer. JSON request bodies may be up to 32 MiB, including inline images.

Runs every model that lists /v1/messages in supported_endpoints — the same text models as Chat Completions, with the same balance checks, key permissions, rate limits, caching, and billing. Supports streaming, tools, images, PDF documents (base64), system prompts, stop sequences, cache_control, and thinking. Thinking maps to reasoning_effort; provider reasoning returns as thinking blocks.

Errors use Anthropic's error shape. count_tokens, batches, files, server tools, and x-api-key auth are not supported.

post/v1/messages

Request

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

Request body

modelstring required

Pollinations text model. Models that support this endpoint list /v1/messages in supported_endpoints.

max_tokensinteger required
streamboolean
stop_sequencesstring[]
temperaturenumber
top_pnumber

Response

Message JSON or Messages SSE stream

idstring required
type'message' required
role'assistant' required
modelstring required
stop_reasonstring nullable required
stop_sequencestring nullable required

Changes

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