{"openapi":"3.1.0","info":{"title":"Pollinations API","description":"> Generate text, images, video, audio, realtime voice, and embeddings with a single API. OpenAI-compatible — use any OpenAI SDK by changing the base URL.\n\n**Base URL:** `https://gen.pollinations.ai`\n\n**Get your API key:** [enter.pollinations.ai](https://enter.pollinations.ai/keys)\n\n**Model catalog migration:** model IDs now use `publisher/model` names. Existing aliases remain valid in requests; match catalog entries against both their canonical ID and `aliases` when restoring saved selections. Catalog metadata uses `publisher` (for example, `OpenAI`) instead of `brand`; update clients reading that field. `publisher` identifies the model publisher, not the inference provider. The existing `brand_url` logo field is unchanged. See the [live model catalog](https://gen.pollinations.ai/models) for current IDs and aliases.\n\n**Integrations:** [Connect User Wallets](/docs#tag/connect-user-wallets) · [Publish a Model](/docs#tag/publish-a-model) · [Publish an Agent](/docs#tag/publish-an-agent) · [MCP Servers](/docs#tag/mcp-servers) · [CLI](/docs#tag/cli)","version":"0.3.0"},"paths":{"/account/integrations":{"get":{"operationId":"getAccountIntegrations","tags":["🔗 Account"],"summary":"List Connected Apps","responses":{"200":{"description":"Connected app accounts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"toolkit":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":"string"},"logo":{"type":["string","null"]},"alias":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","toolkit","name","logo","alias","status"]}}},"required":["data"]}}}}}},"post":{"operationId":"postAccountIntegrations","tags":["🔗 Account"],"summary":"Connect App","responses":{"200":{"description":"Hosted authentication URL"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"toolkit":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9_-]+$"}},"required":["toolkit"],"additionalProperties":false}}}}}},"/account/integrations/toolkits":{"get":{"operationId":"getAccountIntegrationsToolkits","tags":["🔗 Account"],"summary":"Search Connectable Apps","responses":{"200":{"description":"Connectable apps","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"logo":{"type":["string","null"]}},"required":["slug","name","description","logo"]}}},"required":["data"]}}}}},"parameters":[{"in":"query","name":"search","schema":{"type":"string","maxLength":100}}]}},"/account/integrations/{id}":{"delete":{"operationId":"deleteAccountIntegrationsById","tags":["🔗 Account"],"summary":"Disconnect App","responses":{"204":{"description":"App disconnected"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/agents/{id}/sync":{"post":{"operationId":"postAccountAgentsByIdSync","tags":["Community Agents"],"summary":"Sync Code Agent","description":"Deploy the latest `agent.ts` revision and refresh the bundled runtime, even when the source commit is unchanged. The repository binding cannot be changed through this unauthenticated trigger, which is limited to once every 30 seconds.","responses":{"200":{"description":"Agent synchronized","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"boolean"},"deployedCommitSha":{"type":"string"}},"required":["updated","deployedCommitSha"]}}}},"404":{"description":"Code agent not found"},"429":{"description":"Sync rate limited"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/agents":{"get":{"operationId":"getAccountAgents","tags":["Community Agents"],"summary":"List Agents","description":"List managed agents owned by the authenticated account. API keys require `account:keys`.","responses":{"200":{"description":"Owned agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"},"systemPrompt":{"type":"string"},"baseModel":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string","enum":["pollinations","ask-jev","ffmpeg","exa","composio","computer"]}}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","systemPrompt","baseModel","mcpServers"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"},"repository":{"description":"Public GitHub repository containing agent.ts at its root.","type":"string","format":"uri"},"deployedCommitSha":{"type":"string","pattern":"^[0-9a-f]{40}$"}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","repository","deployedCommitSha"]}]}}},"required":["data"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}}},"post":{"operationId":"postAccountAgents","tags":["Community Agents"],"summary":"Create Agent","description":"Create a prompt agent or deploy `agent.ts` from a public GitHub repository. Code-agent identity comes from the repository, and public visibility requires community publisher access. Code agents export a default function accepting `{ request, pollinations, mcp }` and return an OpenAI Responses-compatible Response. API keys require `account:keys`.","responses":{"200":{"description":"Created agent","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"},"systemPrompt":{"type":"string"},"baseModel":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string","enum":["pollinations","ask-jev","ffmpeg","exa","composio","computer"]}}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","systemPrompt","baseModel","mcpServers"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"},"repository":{"description":"Public GitHub repository containing agent.ts at its root.","type":"string","format":"uri"},"deployedCommitSha":{"type":"string","pattern":"^[0-9a-f]{40}$"}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","repository","deployedCommitSha"]}]}}}},"400":{"description":"Invalid agent configuration"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}},"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"repository":{"description":"Public GitHub repository containing agent.ts at its root.","type":"string","format":"uri"},"type":{"type":"string","const":"code_agent"},"description":{"description":"An empty value is ignored; the description comes from GitHub.","type":"string","const":""},"visibility":{"default":"private","type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."}},"required":["repository","type"],"additionalProperties":false},{"type":"object","properties":{"systemPrompt":{"type":"string","minLength":1,"maxLength":8000},"baseModel":{"type":"string","minLength":1,"maxLength":253},"mcpServers":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["pollinations","ask-jev","ffmpeg","exa","composio","computer"]}},"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42},"description":{"default":"","type":"string","maxLength":1000},"visibility":{"default":"private","type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"type":{"default":"prompt_agent","type":"string","const":"prompt_agent"}},"required":["systemPrompt","baseModel","name","title"],"additionalProperties":false}]}}}}}},"/account/agents/{id}":{"get":{"operationId":"getAccountAgentsById","tags":["Community Agents"],"summary":"Get Agent","description":"Get an agent owned by the authenticated account. API keys require `account:keys`.","responses":{"200":{"description":"Owned agent","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"},"systemPrompt":{"type":"string"},"baseModel":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string","enum":["pollinations","ask-jev","ffmpeg","exa","composio","computer"]}}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","systemPrompt","baseModel","mcpServers"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"},"repository":{"description":"Public GitHub repository containing agent.ts at its root.","type":"string","format":"uri"},"deployedCommitSha":{"type":"string","pattern":"^[0-9a-f]{40}$"}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","repository","deployedCommitSha"]}]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Agent not found"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"patch":{"operationId":"patchAccountAgentsById","tags":["Community Agents"],"summary":"Update Agent","description":"Update a prompt agent's configuration or a code agent's visibility and safety policy. Send only the fields to change; the rest keep their current values. A code agent's identity and repository are fixed after creation. API keys require `account:keys`.","responses":{"200":{"description":"Updated agent","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"},"systemPrompt":{"type":"string"},"baseModel":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string","enum":["pollinations","ask-jev","ffmpeg","exa","composio","computer"]}}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","systemPrompt","baseModel","mcpServers"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"},"repository":{"description":"Public GitHub repository containing agent.ts at its root.","type":"string","format":"uri"},"deployedCommitSha":{"type":"string","pattern":"^[0-9a-f]{40}$"}},"required":["id","name","title","description","visibility","requiredSafetyFeatures","createdAt","updatedAt","type","repository","deployedCommitSha"]}]}}}},"400":{"description":"Invalid agent configuration"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Agent not found"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42},"description":{"type":"string","maxLength":1000},"visibility":{"type":"string","enum":["private","public"]},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"systemPrompt":{},"baseModel":{},"mcpServers":{}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"delete":{"operationId":"deleteAccountAgentsById","tags":["Community Agents"],"summary":"Delete Agent","description":"Delete an agent and its model listing. API keys require `account:keys`.","responses":{"200":{"description":"Deleted agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Agent not found"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/my-models":{"get":{"operationId":"getAccountMyModels","tags":["Community Models"],"summary":"List My Models","description":"List private and public community models owned by the authenticated account. API keys require `account:keys`.","responses":{"200":{"description":"Registered community models","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","const":"text"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","api","url"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","enum":["image","video","transcription","speech","embedding"]},"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","baseUrl"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"inputModalities":{"description":"Input types accepted by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"type":{"type":"string","const":"endpoint_agent"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","api","url","upstreamModel","perUserRpm"],"additionalProperties":false}]}},"provider":{"type":"object","properties":{"name":{"type":["string","null"]},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"iconUrl":{"type":["string","null"]}},"required":["name","url","iconUrl"]}},"required":["data","provider"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}}},"post":{"operationId":"postAccountMyModels","tags":["Community Models"],"summary":"Create My Model","description":"Register a private or public community text, image, video, transcription, speech, or embedding model. Private is the default. Public models require an allowlisted account and become public after 3 hours. API keys require `account:keys`. The upstream bearer token is encrypted and never returned.","responses":{"200":{"description":"Created community model","content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","const":"text"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","api","url"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","enum":["image","video","transcription","speech","embedding"]},"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","baseUrl"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"inputModalities":{"description":"Input types accepted by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"type":{"type":"string","const":"endpoint_agent"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","api","url","upstreamModel","perUserRpm"],"additionalProperties":false}]}}}},"400":{"description":"Invalid model configuration"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}},"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42,"description":"Display name shown in the model catalog."},"description":{"type":"string","maxLength":1000},"visibility":{"default":"private","type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"bearerToken":{"type":"string","minLength":1},"upstreamModel":{"type":"string","minLength":1,"maxLength":253},"imagePricing":{"default":"request","type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]},"description":"Input types accepted by the model. Select every supported modality so the model catalog can advertise them accurately."},"requiredSafetyFeatures":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"default":false,"type":"boolean","description":"Restrict callers to spending Paid Pollen on this model. Use it when the upstream bills per use, so Quest Pollen cannot cover the price and leave you paying the inference cost."},"fallbacks":{"maxItems":3,"type":"array","items":{"type":"string","minLength":1},"description":"Community model ids (\"community/<owner>/<name>\") tried in order when this model's upstream fails, or an empty array to clear them. Each must be another registered community model of the same modality, public or owned by you, and priced at or below this model on every price field."},"promptTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCachedPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCacheWritePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionReasoningPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionVideoPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"modality":{"default":"text","type":"string","const":"text"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."}},"required":["name","title","bearerToken","api","url"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42,"description":"Display name shown in the model catalog."},"description":{"type":"string","maxLength":1000},"visibility":{"default":"private","type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"bearerToken":{"type":"string","minLength":1},"upstreamModel":{"type":"string","minLength":1,"maxLength":253},"imagePricing":{"default":"request","type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]},"description":"Input types accepted by the model. Select every supported modality so the model catalog can advertise them accurately."},"requiredSafetyFeatures":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"default":false,"type":"boolean","description":"Restrict callers to spending Paid Pollen on this model. Use it when the upstream bills per use, so Quest Pollen cannot cover the price and leave you paying the inference cost."},"fallbacks":{"maxItems":3,"type":"array","items":{"type":"string","minLength":1},"description":"Community model ids (\"community/<owner>/<name>\") tried in order when this model's upstream fails, or an empty array to clear them. Each must be another registered community model of the same modality, public or owned by you, and priced at or below this model on every price field."},"promptTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCachedPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCacheWritePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionReasoningPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionVideoPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"modality":{"type":"string","enum":["image","video","transcription","speech","embedding"]},"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."}},"required":["name","title","bearerToken","modality","baseUrl"],"additionalProperties":false}]}}}}}},"/account/my-models/provider":{"post":{"operationId":"postAccountMyModelsProvider","tags":["Community Models"],"summary":"Update Community Provider Profile","description":"Set the public provider name, HTTPS service link, and optional media.pollinations.ai icon URL shared by all community models owned by the authenticated account. Publishing approval and `account:keys` are required.","responses":{"200":{"description":"Updated community provider profile","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"]},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"iconUrl":{"type":["string","null"]}},"required":["name","url","iconUrl"]}}}},"400":{"description":"Invalid provider profile"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":42},"url":{"type":"string","maxLength":2048},"iconUrl":{"type":["string","null"]}},"required":["name","url"],"additionalProperties":false}}}}}},"/account/my-models/{id}/fallback-candidates":{"get":{"operationId":"getAccountMyModelsByIdFallbackCandidates","tags":["Community Models"],"summary":"List Fallback Candidates","description":"Community models this model may declare as fallbacks: registered, public or owned by you, same modality, and priced at or below it on every price field. Computed with the same rule the update endpoint validates against, so every id listed here is accepted. Eligibility is re-checked when a request is routed, so a target repriced above this model afterwards stops serving without changing the stored list.","responses":{"200":{"description":"Eligible fallback model ids","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Model not found"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/my-models/endpoint-agents":{"post":{"operationId":"postAccountMyModelsEndpointAgents","tags":["Community Agents"],"summary":"Create Endpoint Agent","description":"Register an agent running on an external OpenAI-compatible endpoint. Pollinations sends a short-lived agent run token instead of a stored bearer credential. Private is the default; public agents require an allowlisted account and become public after 3 hours. API keys require `account:keys`.","responses":{"200":{"description":"Created endpoint agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"inputModalities":{"description":"Input types accepted by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"type":{"type":"string","const":"endpoint_agent"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","api","url","upstreamModel","perUserRpm"],"additionalProperties":false}}}},"400":{"description":"Invalid endpoint agent configuration"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"inputModalities":{"description":"Input types accepted by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42,"description":"Display name shown in the model catalog."},"description":{"type":"string","maxLength":1000},"visibility":{"default":"private","type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1,"maxLength":253},"requiredSafetyFeatures":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"perUserRpm":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."}},"required":["name","title","api","url"],"additionalProperties":false}}}},"x-codeSamples":[{"label":"Create endpoint agent","lang":"Shell","source":"curl https://gen.pollinations.ai/account/my-models/endpoint-agents   -H \"Authorization: Bearer YOUR_SECRET_KEY\"   -H \"Content-Type: application/json\"   -d '{\n    \"name\": \"my-agent\",\n    \"title\": \"My Agent\",\n    \"api\": \"responses\",\n    \"url\": \"https://agent.example.com/v1/responses\"\n  }'"}]}},"/account/my-models/models":{"post":{"operationId":"postAccountMyModelsModels","tags":["Community Models"],"summary":"List Upstream Models","description":"Fetch OpenAI-compatible upstream model IDs from a provider before registering a My Models endpoint. Limited to one probe every 30 seconds per account. API keys require `account:keys`.","responses":{"200":{"description":"Upstream model IDs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"400":{"description":"Endpoint probe failed"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"429":{"description":"Probe rate limited"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"baseUrl":{"type":"string","format":"uri"},"bearerToken":{"type":"string","minLength":1}},"required":["baseUrl","bearerToken"],"additionalProperties":false}}}}}},"/account/my-models/test":{"post":{"operationId":"postAccountMyModelsTest","tags":["Community Models"],"summary":"Test My Model Endpoint","description":"Test an upstream model before registering it. Text tests call the selected Chat Completions or Responses URL in JSON and streaming modes; both must return valid token usage. Image tests detect the image pricing mode and probe the derived `/images/edits` endpoint; video tests call the exact configured URL and validate completed MP4 data; speech tests send a short sample and accept a valid binary audio response. Limited to one probe every 30 seconds per account. API keys require `account:keys`.","responses":{"200":{"description":"Endpoint test result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"usage":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Raw provider usage, or `{ images: 1 }` when an image provider returns no token usage."},"billableUsage":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Normalized billable usage fields used to reveal applicable prices."},"imagePricing":{"description":"Image tests only: pricing mode detected from the provider response.","type":"string","enum":["request","tokens"]},"imageEditError":{"description":"Image tests only: edit-test failure details. Generation succeeded; this does not establish that editing is unsupported.","type":"string"},"inputModalities":{"description":"Image tests only: input types detected from generation and edit probes.","type":"array","items":{"type":"string","enum":["text","image","audio","video"]}}},"required":["ok","message","usage","billableUsage"],"additionalProperties":{}}}}},"400":{"description":"Endpoint test failed"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"429":{"description":"Probe rate limited"}},"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"bearerToken":{"type":"string","minLength":1},"model":{"type":"string","minLength":1,"maxLength":253},"modality":{"default":"text","type":"string","const":"text"}},"required":["api","url","bearerToken","model"],"additionalProperties":false},{"type":"object","properties":{"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."},"bearerToken":{"type":"string","minLength":1},"model":{"type":"string","minLength":1,"maxLength":253},"modality":{"type":"string","enum":["image","video","transcription","speech","embedding"]}},"required":["baseUrl","bearerToken","modality"],"additionalProperties":false}]}}}}}},"/account/my-models/{id}/update":{"post":{"operationId":"postAccountMyModelsByIdUpdate","tags":["Community Models"],"summary":"Update My Model","description":"Update a community model owned by the authenticated account. Code-agent names, titles, and descriptions come from GitHub; an empty description is ignored. Changing visibility to public requires an allowlisted account and takes effect after 3 hours; public models may be free or priced. API keys require `account:keys`.","responses":{"200":{"description":"Updated community model","content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","const":"text"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","api","url"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"proxy"},"upstreamModel":{"type":"string","minLength":1},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean"},"fallbacks":{"type":"array","items":{"type":"string"}},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"},"modality":{"type":"string","enum":["image","video","transcription","speech","embedding"]},"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","upstreamModel","imagePricing","inputModalities","advertised","perUserRpm","paidOnly","fallbacks","promptTextPrice","promptCachedPrice","promptCacheWritePrice","promptAudioPrice","promptImagePrice","completionTextPrice","completionReasoningPrice","completionAudioPrice","completionImagePrice","completionVideoPrice","modality","baseUrl"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"prompt_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"type":{"type":"string","const":"code_agent"}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"pending":{"anyOf":[{"type":"object","properties":{"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visibility":{"type":"string","const":"public"},"paidOnly":{"type":"boolean"},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"promptTextPrice":{"type":"number"},"promptCachedPrice":{"type":"number"},"promptCacheWritePrice":{"type":"number"},"promptAudioPrice":{"type":"number"},"promptImagePrice":{"type":"number"},"completionTextPrice":{"type":"number"},"completionReasoningPrice":{"type":"number"},"completionAudioPrice":{"type":"number"},"completionImagePrice":{"type":"number"},"completionVideoPrice":{"type":"number"}},"required":["effectiveAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"inputModalities":{"description":"Input types accepted by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"type":{"type":"string","const":"endpoint_agent"},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."}},"required":["id","modelId","name","title","description","visibility","requiredSafetyFeatures","pending","createdAt","updatedAt","type","api","url","upstreamModel","perUserRpm"],"additionalProperties":false}]}}}},"400":{"description":"Invalid model configuration"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Community endpoint not found"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9._:-]+$"},"title":{"type":"string","minLength":1,"maxLength":42,"description":"Display name shown in the model catalog."},"description":{"type":"string","maxLength":1000},"visibility":{"type":"string","enum":["private","public"],"description":"\"private\": owner-only and free at runtime; saved prices and fallbacks are retained. \"public\": callable by anyone and listed in the catalog when reliability permits. Publishing requires an allowlisted account."},"requiredSafetyFeatures":{"maxItems":5,"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]},"description":"Input safety checks callers cannot disable. Use sexual and violence to block harmful prompts before they reach the provider."},"baseUrl":{"type":"string","format":"uri","description":"Media API base URL or full endpoint URL. For video, the exact generation URL."},"api":{"type":"string","enum":["chat_completions","responses"]},"url":{"type":"string","format":"uri","description":"Exact upstream endpoint URL for the selected text API, including its path and query parameters."},"upstreamModel":{"type":"string","minLength":1,"maxLength":253},"bearerToken":{"type":"string","minLength":1},"perUserRpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}],"description":"Maximum requests per minute for each Pollinations user. Decimals are supported; 0.5 means one request every two minutes. Null means no Pollinations-side limit."},"paidOnly":{"type":"boolean","description":"Restrict callers to spending Paid Pollen on this model. Use it when the upstream bills per use, so Quest Pollen cannot cover the price and leave you paying the inference cost."},"imagePricing":{"type":"string","enum":["request","tokens"],"description":"Image models only. \"request\": the generated-image price is charged once per generation. \"tokens\": provider-returned OpenAI image token usage is charged against per-token prices. Detected by the endpoint test."},"inputModalities":{"minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video"]},"description":"Input types accepted by the model. Select every supported modality so the model catalog can advertise them accurately."},"advertised":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning"]}},"contextLength":{"type":"integer","exclusiveMinimum":0,"maximum":10000000}},"additionalProperties":false,"description":"Owner-declared catalog metadata for text models."},"fallbacks":{"maxItems":3,"type":"array","items":{"type":"string","minLength":1},"description":"Community model ids (\"community/<owner>/<name>\") tried in order when this model's upstream fails, or an empty array to clear them. Each must be another registered community model of the same modality, public or owned by you, and priced at or below this model on every price field."},"promptTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCachedPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptCacheWritePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"promptImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionTextPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionReasoningPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionAudioPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionImagePrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"completionVideoPrice":{"type":"number","minimum":0,"description":"Pollen price. Token rates are per token internally (the dashboard displays per 1M); `completionImagePrice` is per generated image when `imagePricing` is \"request\"; `completionVideoPrice` is per generated second."},"outputModalities":{"description":"Output types produced by the agent. Defaults to text.","minItems":1,"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/my-models/{id}":{"delete":{"operationId":"deleteAccountMyModelsById","tags":["Community Models"],"summary":"Delete My Model","description":"Delete a community model owned by the authenticated account. API keys require `account:keys`.","responses":{"200":{"description":"Deleted community model","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Community endpoint not found"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/profile":{"get":{"operationId":"getAccountProfile","tags":["Account"],"summary":"Get Profile","description":"Returns your account profile. GitHub username, profile image, and community model access are always returned. Name and email are returned only when the API key has `account:profile`.","responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"type":"object","properties":{"githubUsername":{"description":"GitHub username if linked","type":["string","null"]},"image":{"description":"Profile picture URL (e.g. GitHub avatar)","type":["string","null"]},"communityEndpointsAllowed":{"type":"boolean","description":"Whether the account is allowed to manage community endpoints."},"discordAvailable":{"type":"boolean","description":"Whether Discord account connections are available."},"name":{"description":"User's display name (only returned when the key has `account:profile` or `account:keys`)","type":["string","null"]},"email":{"description":"User's email address (only returned when the key has `account:profile` or `account:keys`)","anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"required":["githubUsername","image","communityEndpointsAllowed","discordAvailable"]},"example":{"githubUsername":"janedeveloper","image":"https://avatars.example.com/jane.jpg","communityEndpointsAllowed":false,"name":"Jane Developer","email":"jane@example.com"}}}},"401":{"description":"Unauthorized"}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/account/profile \\\n  -H \"Authorization: Bearer YOUR_API_KEY\""},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/account/profile\",\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nprofile = response.json()\nprint(profile[\"githubUsername\"])"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/account/profile\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst profile = await response.json();\nconsole.log(profile.githubUsername);"}]}},"/account/quests":{"get":{"operationId":"getAccountQuests","tags":["Account"],"summary":"Get Quest Status","description":"Returns the quest catalog with the authenticated account's read-only status. Globally completed quests and quests earned by the account are both returned as `completed`. API keys require the read-only `account:usage` permission. Claiming rewards remains dashboard-only.","responses":{"200":{"description":"Quest status for the authenticated account","content":{"application/json":{"schema":{"type":"object","properties":{"quests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["setup","grow","build","contribute","community","easteregg"]},"state":{"type":"string","enum":["available","completed","coming_soon"]},"status":{"type":"string","enum":["open","completed","coming_soon"]},"rewardAmount":{"type":"number"},"balanceBucket":{"type":"string","enum":["tier","pack"]},"url":{"type":["string","null"]},"reward":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"questId":{"type":["string","null"]},"title":{"type":"string"},"pollenAmount":{"type":"number"},"balanceBucket":{"type":"string"},"earnedAt":{"type":"string"},"claimedAt":{"type":["string","null"]}},"required":["id","questId","title","pollenAmount","balanceBucket","earnedAt","claimedAt"]},{"type":"null"}]}},"required":["id","title","description","category","state","status","rewardAmount","balanceBucket","url","reward"]}}},"required":["quests"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key missing `account:usage` permission"}}}},"/account/balance":{"get":{"operationId":"getAccountBalance","tags":["Account"],"summary":"Get Balance","description":"Returns the pollen balance visible to the caller. API keys with a budget always see their remaining budget in `balance` (no scope needed). When the caller can view account usage (`account:usage` or a dashboard session), the response also includes `accountBalance: { total, tier, paid }`. Unbudgeted keys without `account:usage` get 403. Key-scoped usage is `GET /account/key/usage`; account-wide usage is `GET /account/usage`.","responses":{"200":{"description":"Pollen balance","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"number","description":"Pollen remaining for this caller. Budgeted API keys see the key's remaining budget here, not the account total. Sessions and unbudgeted keys see the account total (Quest Pollen + paid)."},"accountBalance":{"description":"Full account balances. Included only when the caller can view account usage (dashboard session or `account:usage`). Omitted for budgeted keys that lack that permission so the account wallet is not leaked.","type":"object","properties":{"total":{"type":"number","description":"Quest Pollen + paid Pollen the account can spend on a regular model. Paid-only models spend `paid` alone, so use that field for them rather than this total."},"tier":{"type":"number","description":"Quest Pollen remaining, never below 0"},"paid":{"type":"number","description":"Paid Pollen remaining, never below 0"}},"required":["total","tier","paid"]}},"required":["balance"]},"example":{"balance":42.5}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key has no budget and is missing `account:usage` permission"}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/account/balance \\\n  -H \"Authorization: Bearer YOUR_API_KEY\""},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/account/balance\",\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nprint(response.json())  # {\"balance\": 42.5}"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/account/balance\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst { balance } = await response.json();\nconsole.log(balance);"}]}},"/account/usage":{"get":{"operationId":"getAccountUsage","tags":["Account"],"summary":"Get Usage History","description":"Returns your request history with per-request details: model used, token counts, cost, and response time. Defaults to the last 30 days, supports up to 90 days via `days`, or exact day/week/month periods via `granularity` and `period`. Supports JSON and CSV export. Each response is capped at 50,000 rows. Use `before` with `before_event_id` for stable cursor-based pagination. API keys require the read-only `account:usage` permission.","responses":{"200":{"description":"Usage records","content":{"application/json":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"Request timestamp (YYYY-MM-DD HH:mm:ss format)"},"cursor_event_id":{"type":"string","description":"Event id used with `before_event_id` for stable pagination"},"type":{"type":"string","description":"Request type (e.g., 'generate.image', 'generate.text')"},"model":{"description":"Model used for generation","type":["string","null"]},"api_key_id":{"description":"API key id used for generation","type":["string","null"]},"api_key":{"description":"API key display name","type":["string","null"]},"api_key_type":{"description":"Type of API key ('secret', 'publishable')","type":["string","null"]},"meter_source":{"description":"Billing source: 'tier' = Quest Pollen balance, 'pack' = paid balance","type":["string","null"]},"input_text_tokens":{"type":"number","description":"Number of input text tokens"},"input_cached_tokens":{"type":"number","description":"Number of cached input tokens"},"input_audio_tokens":{"type":"number","description":"Number of input audio tokens"},"input_audio_seconds":{"type":"number","description":"Duration of input audio in seconds (for transcription/STT)"},"input_image_tokens":{"type":"number","description":"Number of input image tokens"},"output_text_tokens":{"type":"number","description":"Number of output text tokens"},"output_reasoning_tokens":{"type":"number","description":"Number of reasoning tokens (for models with chain-of-thought)"},"output_audio_tokens":{"type":"number","description":"Number of output audio tokens"},"output_audio_seconds":{"type":"number","description":"Duration of output audio in seconds (for TTS/music generation)"},"output_image_tokens":{"type":"number","description":"Number of output image tokens (1 per image)"},"output_video_seconds":{"type":"number","description":"Duration of output video in seconds"},"cost_usd":{"type":"number","description":"Cost in USD for this request"},"response_time_ms":{"description":"Response time in milliseconds","type":["number","null"]}},"required":["timestamp","cursor_event_id","type","model","api_key_id","api_key","api_key_type","meter_source","input_text_tokens","input_cached_tokens","input_audio_tokens","input_audio_seconds","input_image_tokens","output_text_tokens","output_reasoning_tokens","output_audio_tokens","output_audio_seconds","output_image_tokens","output_video_seconds","cost_usd","response_time_ms"]},"description":"Array of usage records"},"count":{"type":"number","description":"Number of records returned"}},"required":["usage","count"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key missing `account:usage` permission"}},"parameters":[{"in":"query","name":"format","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"in":"query","name":"limit","schema":{"default":100,"type":"number","minimum":1,"maximum":50000}},{"in":"query","name":"before","schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]}},{"in":"query","name":"before_event_id","schema":{"type":"string"}},{"in":"query","name":"days","schema":{"default":30,"type":"integer","minimum":1,"maximum":90}},{"in":"query","name":"granularity","schema":{"type":"string","enum":["day","week","month"]}},{"in":"query","name":"period","schema":{"type":"string"}},{"in":"query","name":"api_key_ids","schema":{"type":"string"}},{"in":"query","name":"models","schema":{"type":"string"}}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"# Get usage history (JSON)\ncurl \"https://gen.pollinations.ai/account/usage?limit=10\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n\n# Export the latest 50,000 rows from the last 30 days as CSV\ncurl \"https://gen.pollinations.ai/account/usage?format=csv&days=30&limit=50000\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o usage.csv"},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/account/usage\",\n    params={\"limit\": 10, \"days\": 30},\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nfor record in response.json()[\"usage\"]:\n    print(f\"{record['model']}: {record['cost_usd']} pollen\")"}]}},"/account/usage/daily":{"get":{"operationId":"getAccountUsageDaily","tags":["Account"],"summary":"Get Daily Usage","description":"Returns aggregated usage for the requested time window, grouped by date, API key, model, and billing source. Use `days` for rolling windows or `granularity` and `period` for exact day/week/month periods. Useful for dashboards and spending analysis. Supports JSON and CSV export. Requires `account:usage` permission when using API keys.","responses":{"200":{"description":"Usage records aggregated by date/API key/model/source","content":{"application/json":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date (YYYY-MM-DD format)"},"api_key_id":{"type":"string","description":"API key id used for these requests"},"api_key":{"description":"API key name used for these requests","type":["string","null"]},"model":{"description":"Model used","type":["string","null"]},"meter_source":{"description":"Billing source: 'tier' = Quest Pollen balance, 'pack' = paid balance","type":["string","null"]},"requests":{"type":"number","description":"Number of requests"},"cost_usd":{"type":"number","description":"Total cost in USD"}},"required":["date","api_key_id","api_key","model","meter_source","requests","cost_usd"]},"description":"Array of daily usage records"},"count":{"type":"number","description":"Number of records returned"}},"required":["usage","count"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key missing `account:usage` permission"}},"parameters":[{"in":"query","name":"format","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"in":"query","name":"days","schema":{"default":90,"type":"integer","minimum":1,"maximum":90}},{"in":"query","name":"granularity","schema":{"type":"string","enum":["day","week","month"]}},{"in":"query","name":"period","schema":{"type":"string"}},{"in":"query","name":"api_key_ids","schema":{"type":"string"}}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://gen.pollinations.ai/account/usage/daily?days=30\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\""}]}},"/account/earnings/transactions":{"get":{"operationId":"getAccountEarningsTransactions","tags":["Account"],"summary":"Get Earnings Transactions","description":"Returns recent per-request earnings transactions, newest first. Requires `account:usage` permission when using API keys.","responses":{"200":{"description":"Earnings transaction records","content":{"application/json":{"schema":{"type":"object","properties":{"transactions":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"Request timestamp (YYYY-MM-DD HH:mm:ss format)"},"cursor_event_id":{"type":"string","description":"Stable event id"},"entity_name":{"type":"string","description":"Earning entity display name"},"model":{"description":"Model used for generation","type":["string","null"]},"meter_source":{"description":"Billing source: 'tier' = tier balance, 'pack' = paid balance","type":["string","null"]},"pollen_earned":{"type":"number","description":"Developer credit earned"}},"required":["timestamp","cursor_event_id","entity_name","model","meter_source","pollen_earned"]},"description":"Earning transaction records"},"count":{"type":"number","description":"Number of records returned"}},"required":["transactions","count"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key missing `account:usage` permission"}},"parameters":[{"in":"query","name":"limit","schema":{"default":100,"type":"number","minimum":1,"maximum":50000}},{"in":"query","name":"granularity","schema":{"type":"string","enum":["day","week","month"]}},{"in":"query","name":"period","schema":{"type":"string"}},{"in":"query","name":"days","schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}]}},"/account/earnings":{"get":{"operationId":"getAccountEarnings","tags":["Account"],"summary":"Get Developer Earnings","description":"Returns developer earnings in one response: per-(date, entity) buckets and per-entity rollups across BYOP apps and community models. Rows include `requests`, `baseline_price`, reward basis `cost_usd`, and `reward_rate`. Use `days` for rolling windows or `granularity` and `period` for exact day/week/month periods. API keys require the read-only `account:usage` permission.","responses":{"200":{"description":"Earnings buckets and additive totals","content":{"application/json":{"schema":{"type":"object","properties":{"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date bucket (YYYY-MM-DD or hourly); empty string on rollup rows"},"entity_id":{"type":"string","description":"Earning entity id (BYOP app key or community model)"},"entity_name":{"type":"string","description":"Earning entity display name"},"source":{"type":"string","enum":["byop_markup","community_model"],"description":"Reward source, such as byop_markup or community_model"},"requests":{"type":"number","description":"Number of billed requests"},"paid_requests":{"type":"number","description":"Billed requests paid from paid balance"},"tier_requests":{"type":"number","description":"Billed requests paid from tier balance"},"baseline_price":{"type":"number","description":"Model cost before markup (sum over the bucket)"},"pollen_earned":{"type":"number","description":"Developer credit earned over the bucket"},"paid_earned":{"type":"number","description":"Developer credit earned from paid-balance spend"},"tier_earned":{"type":"number","description":"Developer credit earned from Quest Pollen spend"},"cost_usd":{"type":"number","description":"Reward basis total for the bucket; BYOP rows use payer charge, community model rows use model price"},"reward_rate":{"type":"number","description":"Average reward or markup rate applied"}},"required":["date","entity_id","entity_name","source","requests","paid_requests","tier_requests","baseline_price","pollen_earned","paid_earned","tier_earned","cost_usd","reward_rate"]},"description":"Per-(date, earning entity) buckets for the period"},"perEntity":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date bucket (YYYY-MM-DD or hourly); empty string on rollup rows"},"entity_id":{"type":"string","description":"Earning entity id (BYOP app key or community model)"},"entity_name":{"type":"string","description":"Earning entity display name"},"source":{"type":"string","enum":["byop_markup","community_model"],"description":"Reward source, such as byop_markup or community_model"},"requests":{"type":"number","description":"Number of billed requests"},"paid_requests":{"type":"number","description":"Billed requests paid from paid balance"},"tier_requests":{"type":"number","description":"Billed requests paid from tier balance"},"baseline_price":{"type":"number","description":"Model cost before markup (sum over the bucket)"},"pollen_earned":{"type":"number","description":"Developer credit earned over the bucket"},"paid_earned":{"type":"number","description":"Developer credit earned from paid-balance spend"},"tier_earned":{"type":"number","description":"Developer credit earned from Quest Pollen spend"},"cost_usd":{"type":"number","description":"Reward basis total for the bucket; BYOP rows use payer charge, community model rows use model price"},"reward_rate":{"type":"number","description":"Average reward or markup rate applied"}},"required":["date","entity_id","entity_name","source","requests","paid_requests","tier_requests","baseline_price","pollen_earned","paid_earned","tier_earned","cost_usd","reward_rate"]},"description":"Per-earning-entity rollups for the period"}},"required":["daily","perEntity"]}}}},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied - API key missing `account:usage` permission"}},"parameters":[{"in":"query","name":"format","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"in":"query","name":"days","schema":{"default":90,"type":"integer","minimum":1,"maximum":365}},{"in":"query","name":"granularity","schema":{"type":"string","enum":["day","week","month"]}},{"in":"query","name":"period","schema":{"type":"string"}}]}},"/account/keys":{"get":{"operationId":"getAccountKeys","tags":["Account"],"summary":"List API Keys","description":"List all API keys for the current user. Requires `account:keys` permission when using API keys. Secret key values are never returned.","responses":{"200":{"description":"List of API keys"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}}},"post":{"operationId":"postAccountKeys","tags":["Account"],"summary":"Create API Key","description":"Create a new API key. To create an app key, use `type: \"publishable\"` with `redirectUris`. Publishable app keys default developer earnings off; send `earningsEnabled: true` to opt in. Requires `account:keys` permission when using API keys. The full key value is returned only once in the response. Child keys get the `keys` account permission only when `accountPermissions` requests it.","responses":{"200":{"description":"Created API key with full secret"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":253,"description":"Name for the API key"},"type":{"default":"secret","description":"Key type: secret (sk_) or publishable app key (pk_). Use publishable to create an app key.","type":"string","enum":["secret","publishable"]},"expiresIn":{"description":"Expiry in seconds from now","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allowedModels":{"description":"Model IDs this key can access. null = all models","anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"pollenBudget":{"description":"Pollen budget cap. Publishable keys accept only null, omission, or 0 and always use 0; secret keys use null for unlimited","type":["number","null"]},"accountPermissions":{"description":"Account permissions (e.g. [\"usage\"]). Include \"keys\" to let the new key create keys too, and \"machines\" to let it run hosted sandboxes.","anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"redirectUris":{"description":"Allowed OAuth redirect URIs for publishable app keys. Required for OAuth app flows. Must be https:// except http:// loopback URIs for local apps. Matching pins scheme, host, port, and path; one trailing slash is ignored. If the registered URI has no query, incoming query params are allowed; if it has a query, the query must match exactly. Loopback ports are matched port-agnostically.","type":"array","items":{"type":"string"}},"earningsEnabled":{"description":"Enable developer earnings for publishable app keys. Defaults to false; send true to opt in.","type":"boolean"}},"required":["name"]}}}},"x-codeSamples":[{"label":"Create app key","lang":"Shell","source":"curl https://gen.pollinations.ai/account/keys \\\n  -H \"Authorization: Bearer YOUR_SECRET_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"myapp\",\n    \"type\": \"publishable\",\n    \"redirectUris\": [\"https://myapp.com/callback\"]\n  }'"}]}},"/account/polli/harness-on":{"post":{"operationId":"postAccountPolliHarnessOn","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"harness":{"type":"string","pattern":"^[a-z0-9-]{1,32}$","example":"opencode"}},"required":["harness"]}}}},"responses":{"200":{}}}},"/account/keys/{id}":{"delete":{"operationId":"deleteAccountKeysById","tags":["Account"],"summary":"Revoke API Key","description":"Delete/revoke an API key. Requires `account:keys` permission when using API keys. Cannot revoke the key used to authenticate the request.","responses":{"200":{"description":"Key revoked"},"400":{"description":"Cannot revoke self"},"401":{"description":"Unauthorized"},"403":{"description":"Permission denied"},"404":{"description":"Key not found"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/account/key":{"get":{"operationId":"getAccountKey","tags":["Account"],"summary":"Get API Key Info","description":"Returns information about the API key used in the request: validity, type (secret/publishable), expiry, permissions, and remaining budget. Useful for validating keys without making generation requests.","responses":{"200":{"description":"API key status and information","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Opaque ID for editing this key in the owner’s account"},"valid":{"type":"boolean","description":"Whether the API key is valid and active"},"type":{"type":"string","enum":["publishable","secret"],"description":"Type of API key"},"name":{"description":"Display name of the API key","type":["string","null"]},"expiresAt":{"description":"Expiry timestamp in ISO 8601 format, null if never expires","type":["string","null"]},"expiresIn":{"description":"Seconds until expiry, null if never expires","type":["number","null"]},"permissions":{"type":"object","properties":{"models":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"List of allowed model IDs, null = all models allowed"},"account":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"List of account permissions, null = no account access"}},"required":["models","account"],"description":"API key permissions"},"pollenBudget":{"description":"Remaining pollen budget for this key, null = unlimited (uses user balance)","type":["number","null"]},"rateLimitEnabled":{"type":"boolean","description":"Whether rate limiting is enabled for this key"},"userId":{"description":"Stable id of the user that owns this key — server-attested.","type":["string","null"]},"byopApp":{"anyOf":[{"type":"object","properties":{"clientKeyId":{"type":"string","description":"Publishable app key (client id) that minted this key via the BYOP authorize flow."},"name":{"description":"Display name of the BYOP app.","type":["string","null"]},"appUser":{"description":"User id of the app account that owns the BYOP app key.","type":["string","null"]}},"required":["clientKeyId","name","appUser"]},{"type":"null"}],"description":"BYOP app attribution for keys minted through the BYOP authorize flow. Server-attested; null for non-BYOP keys."}},"required":["id","valid","type","name","expiresAt","expiresIn","permissions","pollenBudget","rateLimitEnabled","userId","byopApp"]},"example":{"valid":true,"type":"secret","name":"my-bot","expiresAt":null,"expiresIn":null,"permissions":{"models":null,"account":["usage"]},"pollenBudget":null,"rateLimitEnabled":false}}}},"401":{"description":"Invalid or missing API key"}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/account/key \\\n  -H \"Authorization: Bearer YOUR_API_KEY\""},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/account/key\",\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nkey_info = response.json()\nprint(f\"Valid: {key_info['valid']}, Type: {key_info['type']}\")"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/account/key\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst keyInfo = await response.json();\nconsole.log(`Valid: ${keyInfo.valid}, Type: ${keyInfo.type}`);"}]}},"/account/key/usage":{"get":{"operationId":"getAccountKeyUsage","tags":["Account"],"summary":"Get API Key Usage","description":"Returns usage history for the API key used in the request. No scope required — a key can always read its own usage. Use `before` with `before_event_id` for stable cursor-based pagination. For account-wide usage across all keys, use `/account/usage` with `account:usage`.","responses":{"200":{"description":"Usage records for this key","content":{"application/json":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"Request timestamp (YYYY-MM-DD HH:mm:ss format)"},"cursor_event_id":{"type":"string","description":"Event id used with `before_event_id` for stable pagination"},"type":{"type":"string","description":"Request type (e.g., 'generate.image', 'generate.text')"},"model":{"description":"Model used for generation","type":["string","null"]},"api_key_id":{"description":"API key id used for generation","type":["string","null"]},"api_key":{"description":"API key display name","type":["string","null"]},"api_key_type":{"description":"Type of API key ('secret', 'publishable')","type":["string","null"]},"meter_source":{"description":"Billing source: 'tier' = Quest Pollen balance, 'pack' = paid balance","type":["string","null"]},"input_text_tokens":{"type":"number","description":"Number of input text tokens"},"input_cached_tokens":{"type":"number","description":"Number of cached input tokens"},"input_audio_tokens":{"type":"number","description":"Number of input audio tokens"},"input_audio_seconds":{"type":"number","description":"Duration of input audio in seconds (for transcription/STT)"},"input_image_tokens":{"type":"number","description":"Number of input image tokens"},"output_text_tokens":{"type":"number","description":"Number of output text tokens"},"output_reasoning_tokens":{"type":"number","description":"Number of reasoning tokens (for models with chain-of-thought)"},"output_audio_tokens":{"type":"number","description":"Number of output audio tokens"},"output_audio_seconds":{"type":"number","description":"Duration of output audio in seconds (for TTS/music generation)"},"output_image_tokens":{"type":"number","description":"Number of output image tokens (1 per image)"},"output_video_seconds":{"type":"number","description":"Duration of output video in seconds"},"cost_usd":{"type":"number","description":"Cost in USD for this request"},"response_time_ms":{"description":"Response time in milliseconds","type":["number","null"]}},"required":["timestamp","cursor_event_id","type","model","api_key_id","api_key","api_key_type","meter_source","input_text_tokens","input_cached_tokens","input_audio_tokens","input_audio_seconds","input_image_tokens","output_text_tokens","output_reasoning_tokens","output_audio_tokens","output_audio_seconds","output_image_tokens","output_video_seconds","cost_usd","response_time_ms"]},"description":"Array of usage records"},"count":{"type":"number","description":"Number of records returned"}},"required":["usage","count"]}}}},"401":{"description":"API key required (this endpoint is key-auth only)"}},"parameters":[{"in":"query","name":"format","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"in":"query","name":"limit","schema":{"default":100,"type":"number","minimum":1,"maximum":50000}},{"in":"query","name":"before","schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]}},{"in":"query","name":"before_event_id","schema":{"type":"string"}},{"in":"query","name":"days","schema":{"default":30,"type":"integer","minimum":1,"maximum":90}},{"in":"query","name":"granularity","schema":{"type":"string","enum":["day","week","month"]}},{"in":"query","name":"period","schema":{"type":"string"}},{"in":"query","name":"api_key_ids","schema":{"type":"string"}},{"in":"query","name":"models","schema":{"type":"string"}}]}},"/quests/catalog":{"get":{"operationId":"getQuestsCatalog","tags":["Quests"],"summary":"Get Quest Catalog","security":[],"description":"Returns product quests and GitHub issue quest instances in one list.","responses":{"200":{"description":"Quest catalog","content":{"application/json":{"schema":{"type":"object","properties":{"quests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["setup","grow","build","contribute","community","easteregg"]},"state":{"type":"string","enum":["available","completed","coming_soon"]},"rewardAmount":{"type":"number"},"balanceBucket":{"type":"string","enum":["tier","pack"]},"goal":{"type":"object","properties":{"target":{"type":"number"},"unit":{"type":"string","enum":["pollen","users","days"]}},"required":["target","unit"]},"url":{"type":["string","null"]}},"required":["id","title","description","category","state","rewardAmount","balanceBucket","url"]}}},"required":["quests"]}}}}}}},"/v1/audio/voice-changer":{"post":{"operationId":"postV1AudioVoiceChanger","tags":["Audio"],"summary":"Transform a Voice","description":"Transform the speaker identity in an audio file while preserving its words, timing, emotion, and delivery. Accepts preset voice names or custom ElevenLabs voice IDs.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"model":{"type":"string","default":"elevenlabs/eleven-multilingual-sts-v2"},"file":{"type":"string","format":"binary","description":"Source audio, up to 50 MB. ElevenLabs supports clips up to five minutes. `audio` is accepted as an alias."},"voice":{"type":"string","default":"alloy","description":"Target preset voice name or custom ElevenLabs voice ID."},"response_format":{"type":"string","enum":["mp3","opus","aac","wav","pcm"],"default":"mp3"}}}}}},"responses":{"200":{"description":"Success - Returns transformed speech","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}},"audio/opus":{"schema":{"type":"string","format":"binary"}},"audio/aac":{"schema":{"type":"string","format":"binary"}},"audio/wav":{"schema":{"type":"string","format":"binary"}},"audio/pcm":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}}}},"/v1/audio/voice-isolator":{"post":{"operationId":"postV1AudioVoiceIsolator","tags":["Audio"],"summary":"Isolate Speech","description":"Remove music, ambient sound, and other background noise from an audio or video file while preserving spoken audio.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"model":{"type":"string","default":"elevenlabs/voice-isolator"},"file":{"type":"string","format":"binary","description":"Source audio or video, up to 50 MB and at least 4.6 seconds long. `audio` is accepted as an alias."}}}}}},"responses":{"200":{"description":"Success - Returns isolated speech as MP3 audio","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}}}},"/v1/audio/speech":{"post":{"operationId":"postV1AudioSpeech","tags":["Audio"],"summary":"Generate Audio (OpenAI-compatible)","description":"Generate speech, music, sound effects, or dialogue from text. Compatible with the OpenAI TTS API for JSON requests.\n\nSet `model` to `elevenlabs/music-v2`, `elevenlabs/music-v2.5`, `google/lyria-3-clip-preview`, `google/lyria-3.5`, `stability-ai/stable-audio-3-medium`, or `stability-ai/stable-audio-3` to generate music. Lyria Clip returns one fixed 30-second MP3 clip. For `google/lyria-3.5`, describe song structure and approximate length in the prompt; the output is MP3 and the `duration` parameter is not supported. Pass any publicly accessible audio URL as `reference_audio` to run audio-to-audio (style transfer) on `stability-ai/stable-audio-3-medium` or `stability-ai/stable-audio-3`, or reference-audio conditioning on either ElevenLabs Music model; for ElevenLabs inpainting, pass a `composition_plan`.\n\nFor multi-speaker audio, set `model` to `elevenlabs/eleven-v3:dialogue` and put one turn per line in `input` as `<voice>: <text>`. Voice labels may be preset names or ElevenLabs voice IDs; the top-level `voice` field is ignored for this model. Dialogue supports up to 10 unique voices and 2,000 total text characters.\n\n**Available voices:** alloy, echo, fable, onyx, nova, shimmer, ash, ballad, coral, sage, verse, rachel, domi, bella, elli, charlotte, dorothy, sarah, emily, lily, matilda, adam, antoni, arnold, josh, sam, daniel, charlie, james, fin, callum, liam, george, brian, bill, conversational_a, conversational_b, read_speech_a, read_speech_b, read_speech_c, read_speech_d, af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa, bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis, ef_dora, em_alex, em_santa, ff_siwis, hf_alpha, hf_beta, hm_omega, hm_psi, if_sara, im_nicola, jf_alpha, jf_gongitsune, jf_nezumi, jf_tebukuro, jm_kumo, pf_dora, pm_alex, pm_santa, zf_xiaobei, zf_xiaoni, zf_xiaoxiao, zf_xiaoyi, zm_yunjian, zm_yunxi, zm_yunxia, zm_yunyang, altair, ara, atlas, aurora, carina, castor, celeste, cosmo, eve, helios, helix, iris, kepler, leo, liora, lumen, luna, lux, naksh, orion, perseus, rex, rigel, sal, sirius, ursa, zagan, zenith, Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat\n\n**Output formats:** mp3 (default), opus, aac, flac, wav, pcm","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string"},"input":{"type":"string","minLength":1,"maxLength":10000,"description":"Text or prompt to generate. The `elevenlabs/eleven-v3:dialogue` model expects one `voice: text` turn per line."},"safe":{"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Optional safety features; accepts a comma-separated string or boolean shorthand."},"voice":{"type":"string","default":"alloy"},"response_format":{"type":"string","enum":["mp3","opus","aac","flac","wav","pcm"],"description":"Defaults to mp3 except Gemini TTS (wav). Gemini TTS supports wav or raw 24 kHz pcm and rejects other explicit formats."},"duration":{"type":"number","minimum":0.5,"maximum":300},"seconds":{"type":"number","minimum":1,"maximum":380},"steps":{"type":"integer","minimum":1,"maximum":100},"negative_prompt":{"type":"string"},"instrumental":{"type":"boolean"},"store_for_inpainting":{"type":"boolean"},"reference_audio":{"type":"string","format":"uri","description":"Public HTTP(S) URL for reference-audio conditioning or audio-to-audio generation."},"conditioning_ref":{"type":"object"},"composition_plan":{"type":"object"},"seed":{"type":"integer","minimum":0,"maximum":4294967295},"instructions":{"type":"string","description":"Emotion/style instruction for Gemini TTS and Qwen instruct speech."},"loop":{"type":"boolean"},"prompt_influence":{"type":"number","minimum":0,"maximum":1}}},"examples":{"dialogue":{"summary":"Multi-speaker dialogue","value":{"model":"elevenlabs/eleven-v3:dialogue","input":"rachel: Hello!\nadam: Hi!","voice":"alloy","response_format":"mp3"}}}}}},"responses":{"200":{"description":"Success - Returns audio data","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}},"audio/opus":{"schema":{"type":"string","format":"binary"}},"audio/aac":{"schema":{"type":"string","format":"binary"}},"audio/flac":{"schema":{"type":"string","format":"binary"}},"audio/wav":{"schema":{"type":"string","format":"binary"}},"audio/pcm":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/v1/audio/speech \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"input\": \"Hello world\", \"voice\": \"nova\"}' \\\n  -o speech.mp3"},{"label":"Python","lang":"Python","source":"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://gen.pollinations.ai/v1\",\n    api_key=\"YOUR_API_KEY\",\n)\n\nresponse = client.audio.speech.create(\n    model=\"elevenlabs/eleven-v3\",\n    voice=\"nova\",\n    input=\"Hello world\",\n)\nresponse.stream_to_file(\"speech.mp3\")"},{"label":"JavaScript","lang":"JavaScript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: \"https://gen.pollinations.ai/v1\",\n  apiKey: \"YOUR_API_KEY\",\n});\n\nconst response = await client.audio.speech.create({\n  model: \"elevenlabs/eleven-v3\",\n  voice: \"nova\",\n  input: \"Hello world\",\n});\nconst buffer = Buffer.from(await response.arrayBuffer());"}]}},"/v1/audio/speech/with-timestamps":{"post":{"operationId":"postV1AudioSpeechWithTimestamps","tags":["Audio"],"summary":"Generate Speech with Timestamps","description":"Generate base64-encoded speech with character-level timing for the original and normalized text. Supports `elevenlabs/eleven-v3`, `elevenlabs/eleven-flash-v2.5`, and `elevenlabs/eleven-multilingual-v2`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","default":"elevenlabs/eleven-v3","enum":["elevenlabs/eleven-v3","elevenlabs/eleven-flash-v2.5","elevenlabs/eleven-multilingual-v2"]},"input":{"type":"string","maxLength":10000,"description":"Text to synthesize and align."},"voice":{"type":"string","default":"alloy","description":"Preset voice name or custom ElevenLabs voice ID."},"response_format":{"type":"string","enum":["mp3","opus","aac","wav","pcm"],"default":"mp3","description":"Encoding used for audio_base64."},"seed":{"type":"integer","minimum":0,"maximum":4294967295}}}}}},"responses":{"200":{"description":"Success - Returns base64 audio and character timings","content":{"application/json":{"schema":{"type":"object","required":["audio_base64","alignment","normalized_alignment"],"properties":{"audio_base64":{"type":"string"},"alignment":{"type":"object","properties":{"characters":{"type":"array","items":{"type":"string"}},"character_start_times_seconds":{"type":"array","items":{"type":"number"}},"character_end_times_seconds":{"type":"array","items":{"type":"number"}}}},"normalized_alignment":{"type":"object","properties":{"characters":{"type":"array","items":{"type":"string"}},"character_start_times_seconds":{"type":"array","items":{"type":"number"}},"character_end_times_seconds":{"type":"array","items":{"type":"number"}}}}}}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}}}},"/v1/audio/transcriptions":{"post":{"operationId":"postV1AudioTranscriptions","tags":["Audio"],"summary":"Transcribe Audio","description":"Transcribe audio files to text. Compatible with the OpenAI Whisper API.\n\n**Supported audio formats:** mp3, mp4, mpeg, mpga, m4a, wav, webm\n\n**Models:**\n- `openai/whisper-large-v3` (default) — OpenAI Whisper via OVHcloud\n- `whisper-1` — Alias for `openai/whisper-large-v3`\n- `openai/gpt-transcribe` — Fast multilingual speech recognition with prompt context\n- `elevenlabs/scribe-v2` — ElevenLabs Scribe (90+ languages, word-level timestamps)\n- `x-ai/grok-transcribe` — xAI speech recognition with word timestamps, speaker labels, and text formatting\n- `google/gemini-3.5-transcribe` — Google speech recognition with word timestamps and speaker labels (wav, mp3, flac, m4a, ogg, webm, aac; `prompt` is ignored)\n- `assemblyai/universal-2` — AssemblyAI Universal-2 (99 languages)\n- `assemblyai/universal-3.5-pro` — AssemblyAI Universal-3.5 Pro (18 languages, code switching, prompting)","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The audio file to transcribe. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm."},"model":{"type":"string","default":"openai/whisper-large-v3","description":"The model to use. Options: `openai/whisper-large-v3`, `whisper-1`, `openai/gpt-transcribe`, `elevenlabs/scribe-v2`, `x-ai/grok-transcribe`, `google/gemini-3.5-transcribe`, `assemblyai/universal-2`, `assemblyai/universal-3.5-pro`."},"language":{"type":"string","description":"Language of the audio in ISO-639-1 format (e.g. `en`, `fr`). Improves accuracy."},"prompt":{"type":"string","description":"Optional text to guide the model's style or continue a previous segment."},"response_format":{"type":"string","enum":["json","text","srt","verbose_json","vtt","diarized_json"],"default":"json","description":"The format of the transcript output. Support is model-dependent: `srt` and `vtt` require a model that renders subtitles, and `diarized_json` a diarization-capable one. Unsupported combinations return 400 naming the formats that model accepts."},"temperature":{"type":"number","description":"Sampling temperature between 0 and 1. Lower is more deterministic."},"speakers_expected":{"type":"integer","minimum":1,"description":"Optional provider hint for the number of speakers. Only honored with `response_format=diarized_json`."}}}}}},"responses":{"200":{"description":"Success - Returns transcription","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"segments":{"type":"array","description":"OpenAI-compatible diarized segments. Present when `response_format=diarized_json`.","items":{"type":"object","properties":{"type":{"type":"string","enum":["transcript.text.segment"]},"id":{"type":"string"},"speaker":{"type":"string"},"text":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"}}}}}}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/v1/audio/transcriptions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -F file=@audio.mp3 \\\n  -F model=openai/whisper-large-v3"},{"label":"Python","lang":"Python","source":"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://gen.pollinations.ai/v1\",\n    api_key=\"YOUR_API_KEY\",\n)\n\nwith open(\"audio.mp3\", \"rb\") as f:\n    transcript = client.audio.transcriptions.create(\n        model=\"openai/whisper-large-v3\", file=f\n    )\nprint(transcript.text)"},{"label":"JavaScript","lang":"JavaScript","source":"import OpenAI from \"openai\";\nimport fs from \"fs\";\n\nconst client = new OpenAI({\n  baseURL: \"https://gen.pollinations.ai/v1\",\n  apiKey: \"YOUR_API_KEY\",\n});\n\nconst transcript = await client.audio.transcriptions.create({\n  model: \"openai/whisper-large-v3\",\n  file: fs.createReadStream(\"audio.mp3\"),\n});\nconsole.log(transcript.text);"}]}},"/alpha/audio/stem-separation":{"post":{"operationId":"postAlphaAudioStemSeparation","tags":["Audio"],"summary":"Separate Audio Stems","description":"Separate an uploaded audio file into vocals and instrumental, or vocals, drums, bass, guitar, piano, and other. Returns a ZIP of stereo 44.1 kHz MP3 files at 128 kbps. Pricing uses input duration and the selected stem variation; see /audio/models. This native alpha endpoint has no OpenAI-compatible equivalent; its request and response may change.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"model":{"type":"string","default":"elevenlabs/stem-separation"},"file":{"type":"string","format":"binary","description":"Source audio, up to 50 MB, with a readable duration."},"stem_variation_id":{"type":"string","enum":["two_stems_v1","six_stems_v1"],"default":"six_stems_v1"}}}}}},"responses":{"200":{"description":"ZIP containing the separated MP3 tracks","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"413":{"description":"The request payload is too large. Reduce its size and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":413},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"]},"message":{"anyOf":[{"type":"string","const":"The request payload is too large. Reduce its size and try again."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"502":{"description":"We couldn't reach our backend services. Please try again shortly.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":502},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_GATEWAY"]},"message":{"anyOf":[{"type":"string","const":"We couldn't reach our backend services. Please try again shortly."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}}}},"/models/status":{"get":{"operationId":"getModelsStatus","tags":["📊 Monitor"],"summary":"Model Health Status","description":"Pollinations-specific diagnostics, not part of the OpenAI-compatible surface. Returns the raw response of the public Tinybird `model_route_health` pipe: a `data` array of rows plus a `meta` array typing each column.\n\nEach model has one rollup row (`is_rollup` 1) counting the final outcome of every request, plus one row per execution route (`is_rollup` 0): the model's own primary and every fallback it fell through to, counting every attempt so a primary rescued by fallbacks cannot read as healthy. Routes that never fired have no row.\n\nCached for 60 seconds per window and traffic scope.","parameters":[{"name":"traffic","in":"query","required":false,"description":"Traffic population: all requests (default), or regular usage excluding legacy APIs and Pollinations-internal traffic.","schema":{"type":"string","enum":["all","regular"],"default":"all"}},{"name":"minutes","in":"query","required":false,"description":"Rolling window in minutes (default 60, maximum 10080).","schema":{"type":"integer","minimum":1,"maximum":10080,"default":60}}],"responses":{"200":{"description":"Raw Tinybird pipe response; upstream errors pass through with their status."}}}},"/v1/messages":{"post":{"operationId":"postV1Messages","tags":["Text"],"summary":"Create Message (Anthropic-compatible)","description":"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`.\nJSON request bodies may be up to 32 MiB, including inline images.\n\nRuns 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, system prompts, stop sequences, `cache_control`, and thinking. Thinking maps to `reasoning_effort`; provider reasoning returns as `thinking` blocks.\n\nErrors use Anthropic's error shape. `count_tokens`, batches, files, server tools, and `x-api-key` auth are not supported.","responses":{"200":{"description":"Message JSON or Messages SSE stream","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageResponse"}},"text/event-stream":{"schema":{"type":"string","description":"Messages events from message_start to message_stop, with ping keepalives. A failed stream ends with an error event."}}}},"default":{"description":"Anthropic-shaped error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}}}}},"/v1/models":{"get":{"operationId":"getV1Models","tags":["Models"],"summary":"List Models (OpenAI-compatible)","description":"Returns available models in the OpenAI-compatible format (`{object: \"list\", data: [...]}`), with Pollinations pricing and capability extensions. Official models are ordered by modality (text, image, video, 3D, audio, realtime, embedding), with each configured default first, followed by stable and then alpha/preview models from newest to oldest. Community models follow from newest to oldest. Use `/models`, `/text/models`, `/image/models`, `/audio/models`, or `/embeddings/models` for richer metadata. When authenticated: the owner's private community models are included, models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"created":{"type":"number"},"owned_by":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"community":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"description":"Filter tags in Open WebUI's model tag format: the model category, plus `community` for community models and `agent` for agents."},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"agent":{"type":"boolean"},"base_model":{"type":"string"},"pricing":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"capabilities":{"type":"array","items":{"type":"string"}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["id","object","created","owned_by","aliases","category","community","tags","title"],"description":"OpenAI-compatible model object with capability metadata"}}},"required":["object","data"],"description":"OpenAI-compatible list of available models."},"example":{"object":"list","data":[{"id":"openai/gpt-5.4-nano","object":"model","created":1700000000,"owned_by":"pollinations","aliases":[],"category":"text","community":false,"tags":[{"name":"text"}],"title":"OpenAI"},{"id":"anthropic/claude-sonnet-4.6","object":"model","created":1700000000,"owned_by":"pollinations","aliases":[],"category":"text","community":false,"tags":[{"name":"text"}],"title":"Claude"},{"id":"google/gemini-3.7-flash","object":"model","created":1700000000,"owned_by":"pollinations","aliases":[],"category":"text","community":false,"tags":[{"name":"text"}],"title":"Gemini"}]}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/v1/models"},{"label":"Python","lang":"Python","source":"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://gen.pollinations.ai/v1\",\n    api_key=\"YOUR_API_KEY\",\n)\n\nmodels = client.models.list()\nfor model in models.data:\n    print(model.id)"},{"label":"JavaScript","lang":"JavaScript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: \"https://gen.pollinations.ai/v1\",\n  apiKey: \"YOUR_API_KEY\",\n});\n\nconst models = await client.models.list();\nmodels.data.forEach((m) => console.log(m.id));"}]}},"/v1/models/{model}":{"get":{"operationId":"getV1ModelsByModel","tags":["Models"],"summary":"Retrieve Model (OpenAI-compatible)","description":"Returns a single model by ID or alias in the OpenAI-compatible format, resolved to its canonical ID with stable created timestamps and Pollinations pricing and capability extensions. Manual visibility, API-key model permissions, and paid-only rules match the list endpoint. Retrieval does not apply the automatic reliability filter. Metadata matches the `/v1/models?reliability=all` entry, including `health`. Returns 404 when the model does not exist or is not accessible to the caller.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"created":{"type":"number"},"owned_by":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"community":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"description":"Filter tags in Open WebUI's model tag format: the model category, plus `community` for community models and `agent` for agents."},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"agent":{"type":"boolean"},"base_model":{"type":"string"},"pricing":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"capabilities":{"type":"array","items":{"type":"string"}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["id","object","created","owned_by","aliases","category","community","tags","title"],"description":"OpenAI-compatible model object with capability metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"404":{"description":"Oh no, there's nothing here.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":404},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"anyOf":[{"type":"string","const":"Oh no, there's nothing here."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"model","required":true}]}},"/models":{"get":{"operationId":"getModels","tags":["Models"],"summary":"List Models","description":"Returns all available models with pricing, capabilities, and metadata. Official models are ordered by modality (text, image, video, 3D, audio, realtime, embedding), with each configured default first, followed by stable and then alpha/preview models from newest to oldest. Community models follow from newest to oldest. When authenticated: the owner's private community models are included, models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}]}},"/3d/models":{"get":{"operationId":"get3dModels","tags":["Models"],"summary":"List 3D Models","description":"Returns all available 3D model generation models with pricing, capabilities, and metadata. When authenticated: models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}]}},"/image/models":{"get":{"operationId":"getImageModels","tags":["Models"],"summary":"List Image & Video Models","description":"Returns all available image and video generation models with pricing, capabilities, and metadata. Video models are included here — check the `output_modalities` field to distinguish image vs video models. When authenticated: models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/image/models"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\"https://gen.pollinations.ai/image/models\");\nconst models = await response.json();\nmodels.forEach((m) => console.log(`${m.id}: ${m.description}`));"}]}},"/video/models":{"get":{"operationId":"getVideoModels","tags":["Models"],"summary":"List Video Models","description":"Returns all available video generation models with pricing, capabilities, and metadata. When authenticated: models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}]}},"/text/models":{"get":{"operationId":"getTextModels","tags":["Models"],"summary":"List Text Models (Detailed)","description":"Returns all available text generation and community text models with pricing, capabilities, and metadata including context window size, supported modalities, and tool support. When authenticated: the owner's private community models are included, models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/text/models"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\"https://gen.pollinations.ai/text/models\");\nconst models = await response.json();\nmodels.forEach((m) => console.log(`${m.id}: ${m.description}`));"}]}},"/audio/models":{"get":{"operationId":"getAudioModels","tags":["Models"],"summary":"List Audio Models","description":"Returns all available audio models (text-to-speech, music generation, and transcription) with pricing, capabilities, and metadata. When authenticated: models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/audio/models"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\"https://gen.pollinations.ai/audio/models\");\nconst models = await response.json();\nmodels.forEach((m) => console.log(`${m.id}: ${m.description}`));"}]}},"/embeddings/models":{"get":{"operationId":"getEmbeddingsModels","tags":["Embeddings"],"summary":"List Embedding Models","description":"Returns available embedding models with pricing, capabilities, and supported input modalities. When authenticated: models are filtered by API key permissions, and `paid_only` models are hidden if the account has no paid balance. Each entry includes a `health` field (`status`, `success_rate`, `requests`) summarizing the last 50 eligible final requests within seven days for community proxies and the last 24 hours for other models, refreshed roughly every 60s. Public community proxy models at or below 80% success are omitted from lists; official models, agents, and models without observations remain listed. Use `?reliability=all` to bypass this reliability filter. Pass `?community=false` to exclude community models or `?community=true` to return only community models.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string","enum":["text","image","audio","video","3d","embedding","realtime"]},"publisher":{"type":"string","description":"Human-readable model publisher, not the inference provider"},"brand_url":{"type":"string","format":"uri"},"brand_icon_url":{"type":"string"},"community":{"type":"boolean"},"agent":{"type":"boolean"},"base_model":{"type":"string"},"per_user_rpm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]},"pricing_variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["name","label","description","pricing"]}},"pricing_default_label":{"type":"string"},"pricing_dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Display values keyed by pricing variant name; the empty key is base pricing."}},"required":["key","label","values"]}},"pricing_adjustments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","const":"pollen"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"},"suffix":{"type":"string"},"option":{"type":"object","properties":{"group":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"default":{"type":"boolean"},"groupLabel":{"type":"string"},"valueLabel":{"type":"string"},"unit":{"type":"string"}},"required":["group","value","label"]}},"required":["name","label","kind","price","currency","quantity","unit"]}},"resolutions":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","audio","video","embedding","3d"]}},"required_safety":{"type":"array","items":{"type":"string","enum":["privacy","secrets","sexual","violence","shield"]}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"video_capabilities":{"type":"array","items":{"type":"string","enum":["start_frame","end_frame","keyframes","reference_images","reference_videos","reference_audios","audio_output"]}},"min_duration":{"type":"number","exclusiveMinimum":0},"max_duration":{"type":"number","exclusiveMinimum":0},"default_duration":{"type":"number","exclusiveMinimum":0},"allowed_durations":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"duration_step":{"type":"number","exclusiveMinimum":0},"max_reference_images":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_reference_videos":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string","enum":["tool_calling","reasoning","web_search","code_execution","pollinations_models"]}},"supported_parameters":{"description":"Controls honored by this model through `/v1/chat/completions`; omitted when unverified and not applicable to `/v1/responses`.","type":"array","items":{"type":"string"}},"tools":{"type":"boolean"},"supports_structured_output":{"description":"Whether JSON and JSON-schema output are supported; omitted when unverified.","type":"boolean"},"max_completion_tokens":{"description":"Maximum requested output tokens, including max_tokens, max_completion_tokens and max_output_tokens.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reasoning":{"type":"boolean"},"context_length":{"type":"number"},"voices":{"type":"array","items":{"type":"string"}},"is_specialized":{"type":"boolean"},"paid_only":{"type":"boolean"},"pending_change":{"type":"object","properties":{"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"paid_only":{"type":"boolean"},"pricing":{"allOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","properties":{"currency":{"type":"string","const":"pollen"}},"required":["currency"]}]}},"required":["effective_at","paid_only","pricing"]},"alpha":{"type":"boolean"},"flat_rate":{"type":"boolean"},"pricing_units":{"description":"Billed unit for pricing fields whose name does not describe it, keyed by pricing field. Rate per unit = pricing[field] × quantity, with quantity defaulting to 1. Example: qwen/qwen-image-2.1 bills completionImageTokens in millionths of a megapixel, so pricing.completionImageTokens 0.00000002 with { unit: megapixel, quantity: 1000000 } is 0.02 Pollen per megapixel.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"unit":{"type":"string","enum":["megapixel","token","byte"]},"quantity":{"description":"Usage units in one billed unit; defaults to 1.","type":"number","exclusiveMinimum":0}},"required":["unit"]}},"added_date":{"type":"number"},"health":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","down","unknown"],"description":"Healthy above 95% success, degraded above 80% through 95%, down at 80% or below, unknown with no measured requests."},"success_rate":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}],"description":"Success across the last 50 eligible final requests within seven days for community proxies, or the last 24 hours for other models; null with no measured requests."},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of eligible final responses in the health sample (at most 50 for community proxies)."}},"required":["status","success_rate","requests"],"description":"Recent gateway reliability: last 50 eligible final requests within seven days for community proxies, last 24 hours for other models. Refreshed roughly every 60s. Final 4xx are excluded; owner requests, monitor probes, and successful fallback rescues count. Not individual upstream health."}},"required":["name","aliases","category","publisher","community","pricing","title","capabilities"]},"description":"List of models with pricing and metadata"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."},{"in":"query","name":"source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"query","name":"community","schema":{"type":"string","enum":["0","1","true","false"]},"description":"Legacy source filter: `true`/`1` for community, `false`/`0` for official."},{"in":"query","name":"query","schema":{"type":"string"},"description":"Search the canonical name, aliases, title, description and publisher. Case-insensitive; every whitespace-separated word must match."},{"in":"query","name":"capabilities","schema":{"type":"string"},"description":"Comma-separated capabilities (tool_calling, reasoning, web_search, code_execution, pollinations_models). A model must have all of them."},{"in":"query","name":"agent","schema":{"type":"string","enum":["0","1","true","false"]},"description":"`true`/`1` returns only agents, `false`/`0` excludes agents. Omit for both."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":500},"description":"Return at most this many models (1-500), after every other filter and in catalog order."},{"in":"header","name":"pollinations-model-source","schema":{"type":"string","enum":["official","community"]},"description":"Filter by source. Omit for both official and community models."},{"in":"header","name":"pollinations-model-reliability","schema":{"type":"string","enum":["reliable","all"]},"description":"Defaults to reliable: public community proxy models need more than 80% success across the last 50 eligible requests within seven days, or no observations. Official models, agents, and private models are unaffected. Fallback rescues count as successes. Use all to bypass only this discovery filter; permissions and private visibility still apply. Exact-ID calls and fallback routing are unaffected."}]}},"/realtime":{"get":{"operationId":"getRealtime","tags":["Realtime"],"summary":"Realtime WebSocket","description":"OpenAI-compatible Realtime WebSocket for voice, multimodal, and transcription sessions.\n\nConnect with `wss://gen.pollinations.ai/realtime?model=openai/gpt-realtime-2.1` and send/receive OpenAI Realtime JSON events over the socket. Selecting `elevenlabs/scribe-v2-realtime` creates a transcription session automatically.\nServer clients can authenticate with `Authorization: Bearer <key>`. Browser WebSocket clients can use `?key=pk_...` because they cannot set custom authorization headers.\n\n**Models:** `openai/gpt-realtime-2.1`, `openai/gpt-realtime-2.1-mini`, `elevenlabs/scribe-v2-realtime`, `openai/gpt-live-transcribe`.\n\n**Billing:** requires a positive balance and settles one session total when the socket closes.","responses":{"101":{"description":"WebSocket connection established"},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"426":{"description":"This endpoint requires a WebSocket upgrade request.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":426},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UPGRADE_REQUIRED"]},"message":{"anyOf":[{"type":"string","const":"This endpoint requires a WebSocket upgrade request."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"503":{"description":"We're temporarily down for maintenance. Sorry about that!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":503},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["SERVICE_UNAVAILABLE"]},"message":{"anyOf":[{"type":"string","const":"We're temporarily down for maintenance. Sorry about that!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"model","schema":{"type":"string","enum":["openai/gpt-realtime-2.1","gpt-realtime-2.1","gpt-realtime-2","openai/gpt-realtime-2.1-mini","gpt-realtime-2.1-mini","elevenlabs/scribe-v2-realtime","scribe-realtime","openai/gpt-live-transcribe","gpt-live-transcribe"]},"description":"Realtime model to use. Supported models: openai/gpt-realtime-2.1, openai/gpt-realtime-2.1-mini, elevenlabs/scribe-v2-realtime, openai/gpt-live-transcribe."},{"in":"query","name":"key","schema":{"type":"string"},"description":"Pollinations API key. Useful for browser WebSocket clients that cannot set custom Authorization headers."}]}},"/v1/realtime":{"get":{"operationId":"getV1Realtime","tags":["Realtime"],"summary":"Realtime WebSocket","description":"OpenAI-compatible Realtime WebSocket for voice, multimodal, and transcription sessions.\n\nConnect with `wss://gen.pollinations.ai/v1/realtime?model=openai/gpt-realtime-2.1` and send/receive OpenAI Realtime JSON events over the socket. Selecting `elevenlabs/scribe-v2-realtime` creates a transcription session automatically.\nServer clients can authenticate with `Authorization: Bearer <key>`. Browser WebSocket clients can use `?key=pk_...` because they cannot set custom authorization headers.\n\n**Models:** `openai/gpt-realtime-2.1`, `openai/gpt-realtime-2.1-mini`, `elevenlabs/scribe-v2-realtime`, `openai/gpt-live-transcribe`.\n\n**Billing:** requires a positive balance and settles one session total when the socket closes.","responses":{"101":{"description":"WebSocket connection established"},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"426":{"description":"This endpoint requires a WebSocket upgrade request.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":426},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UPGRADE_REQUIRED"]},"message":{"anyOf":[{"type":"string","const":"This endpoint requires a WebSocket upgrade request."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"503":{"description":"We're temporarily down for maintenance. Sorry about that!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":503},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["SERVICE_UNAVAILABLE"]},"message":{"anyOf":[{"type":"string","const":"We're temporarily down for maintenance. Sorry about that!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"query","name":"model","schema":{"type":"string","enum":["openai/gpt-realtime-2.1","gpt-realtime-2.1","gpt-realtime-2","openai/gpt-realtime-2.1-mini","gpt-realtime-2.1-mini","elevenlabs/scribe-v2-realtime","scribe-realtime","openai/gpt-live-transcribe","gpt-live-transcribe"]},"description":"Realtime model to use. Supported models: openai/gpt-realtime-2.1, openai/gpt-realtime-2.1-mini, elevenlabs/scribe-v2-realtime, openai/gpt-live-transcribe."},{"in":"query","name":"key","schema":{"type":"string"},"description":"Pollinations API key. Useful for browser WebSocket clients that cannot set custom Authorization headers."}]}},"/v1/chat/completions":{"post":{"operationId":"postV1ChatCompletions","tags":["Text"],"summary":"Chat Completions","description":"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`.\n\nSupports streaming, function calling, vision (image input), structured outputs, and reasoning/thinking modes depending on the model.\nJSON 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.\n\nSuccessful text JSON responses contain usage. Text streams contain a usage chunk before `[DONE]`; missing text-provider usage fails the response.\n\nMetadata is passed unchanged to endpoint agents; see the agent’s documentation for supported keys.\n\nMedia 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.","responses":{"200":{"description":"Chat completion JSON or SSE stream","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"finish_reason":{"type":["string","null"]},"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"message":{"type":"object","properties":{"content":{"type":["string","null"]},"tool_calls":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}},{"type":"null"}]},"role":{"type":"string","const":"assistant"},"function_call":{"anyOf":[{"type":"object","properties":{"arguments":{"type":"string"},"name":{"type":"string"}},"required":["arguments","name"]},{"type":"null"}]},"content_blocks":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"type":"string","enum":["auto","low","high"]},"mime_type":{"type":"string"}},"required":["url"]},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"]},{"type":"object","properties":{"type":{"type":"string","const":"redacted_thinking"},"data":{"type":"string"}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}]}},{"type":"null"}]},"audio":{"anyOf":[{"type":"object","properties":{"transcript":{"type":"string"},"data":{"type":"string"},"id":{"type":"string"},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["transcript","data"]},{"type":"null"}]},"reasoning_content":{"type":["string","null"]}},"required":["role"]},"logprobs":{"anyOf":[{"anyOf":[{"type":"object","properties":{"content":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]}},"required":["token","logprob","bytes"]}}},"required":["token","logprob","bytes","top_logprobs"]}},{"type":"null"}]}},"required":["content"]},{"type":"null"}]},{"type":"null"}]},"content_filter_results":{"anyOf":[{"$ref":"#/components/schemas/ContentFilterResult"},{"type":"null"}]}}}},"prompt_filter_results":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"prompt_index":{"type":"integer","minimum":0,"maximum":9007199254740991},"content_filter_results":{"$ref":"#/components/schemas/ContentFilterResult"}},"required":["prompt_index"]}},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model":{"type":"string"},"system_fingerprint":{"type":["string","null"]},"object":{"type":"string","const":"chat.completion"},"usage":{"$ref":"#/components/schemas/CompletionUsage"},"citations":{"type":"array","items":{"type":"string"}}},"required":["id","choices","created","object","usage"]},{"$ref":"#/components/schemas/MediaChatCompletion"}]},"example":{"id":"chatcmpl-abc123","object":"chat.completion","created":1700000000,"model":"openai/gpt-5.4-nano","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! How can I help you today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":12,"total_tokens":22}}},"text/event-stream":{"schema":{"type":"string","description":"OpenAI-compatible Chat Completions SSE events ending with data: [DONE]. Text models include a usage chunk; media models omit it."}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"413":{"description":"The request payload is too large. Reduce its size and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":413},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"]},"message":{"anyOf":[{"type":"string","const":"The request payload is too large. Reduce its size and try again."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"502":{"description":"We couldn't reach our backend services. Please try again shortly.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":502},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_GATEWAY"]},"message":{"anyOf":[{"type":"string","const":"We couldn't reach our backend services. Please try again shortly."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"system"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"developer"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"user"},"name":{"type":"string"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},{"type":"null"}]},"role":{"type":"string","const":"assistant"},"name":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}},"function_call":{"anyOf":[{"type":"object","properties":{"arguments":{"type":"string"},"name":{"type":"string"}},"required":["arguments","name"]},{"type":"null"}]},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["role"],"additionalProperties":{}},{"type":"object","properties":{"role":{"type":"string","const":"tool"},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},{"type":"null"}]},"tool_call_id":{"type":"string"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["role","content","tool_call_id"],"additionalProperties":{}},{"type":"object","properties":{"role":{"type":"string","const":"function"},"content":{"type":["string","null"]},"name":{"type":"string"}},"required":["role","content","name"],"additionalProperties":{}}]}},"model":{"default":"openai/gpt-5.4-nano","description":"AI model for text generation. See /v1/models for full list.","type":"string"},"metadata":{"description":"Passed unchanged to endpoint agents. Each agent documents the metadata keys it accepts.","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"modalities":{"type":"array","items":{"type":"string","enum":["text","audio"]}},"audio":{"type":"object","properties":{"voice":{"type":"string","enum":["alloy","echo","fable","onyx","nova","shimmer","coral","verse","ballad","ash","sage","amuch","dan"]},"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"]}},"required":["voice","format"]},"frequency_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"repetition_penalty":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"logit_bias":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"max_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"presence_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"response_format":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"json_schema"},"json_schema":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"default":false,"type":["boolean","null"]}},"required":["schema"]}},"required":["type","json_schema"]},{"type":"object","properties":{"type":{"type":"string","const":"json_object"}},"required":["type"]}]},"seed":{"anyOf":[{"type":"integer","minimum":-1,"maximum":2147483647},{"type":"null"}]},"stop":{"anyOf":[{"type":["string","null"]},{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string"}}]},"stream":{"default":false,"type":["boolean","null"]},"stream_options":{"anyOf":[{"type":"object","properties":{"include_usage":{"type":"boolean"}}},{"type":"null"}]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"Requests reasoning depth for models that support adjustable reasoning. \"none\" requests no reasoning."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"]}},"required":["search_context_size"],"description":"Perplexity Sonar search context size: how much page content each web search reads. Larger sizes use more input tokens."},"temperature":{"description":"Sampling controls are ignored for model families that do not consistently support them, regardless of reasoning mode.","anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"top_p":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"default":false,"type":["boolean","null"]}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","enum":["code_execution","google_search","google_maps","url_context","computer_use","file_search"]}},"required":["type"]}]}},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object","properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["type","function"]}]},"parallel_tool_calls":{"type":"boolean"},"user":{"type":"string"},"prompt_cache_key":{"type":"string"},"prompt_cache_options":{"$ref":"#/components/schemas/PromptCacheOptions"},"prompt_cache_retention":{"type":"string","enum":["in_memory","24h"]},"function_call":{"anyOf":[{"type":"string","enum":["none","auto"]},{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}]},"functions":{"minItems":1,"maxItems":128,"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name"],"additionalProperties":false}}},"required":["messages"],"additionalProperties":{}}}}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"openai/gpt-5.4-nano\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'"},{"label":"Python","lang":"Python","source":"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://gen.pollinations.ai/v1\",\n    api_key=\"YOUR_API_KEY\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"openai/gpt-5.4-nano\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\nprint(response.choices[0].message.content)"},{"label":"JavaScript","lang":"JavaScript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: \"https://gen.pollinations.ai/v1\",\n  apiKey: \"YOUR_API_KEY\",\n});\n\nconst response = await client.chat.completions.create({\n  model: \"openai/gpt-5.4-nano\",\n  messages: [{ role: \"user\", content: \"Hello!\" }],\n});\nconsole.log(response.choices[0].message.content);"}]}},"/alpha/decisions":{"post":{"operationId":"postAlphaDecisions","tags":["Text"],"summary":"Create Decision","description":"Answer typed questions about a state and get calibrated probabilities instead of free text. Request-compatible with the OpenRouter decisions API.\n\nEach question is one of three types. `choice` selects among named options and returns the chosen key with per-option probabilities. `score` rates on an ordered scale and returns a fractional position plus a `legend` mapping each index back to its rung — read the legend before interpreting the score. `noul` returns the probability that a yes/no proposition is true.\n\nQuestions are answered independently and returned under the keys you supplied. `state`, `instructions`, and criteria values accept a string or arbitrary JSON.\n\nConfidence can stay high when facts are missing, so supply the facts that matter. Counting, arithmetic, and date comparisons belong in your code, not in a question.\n\nModels that support this endpoint list `/alpha/decisions` in `supported_endpoints`. The response is JSON only; there is no streaming.","responses":{"200":{"description":"Decision answers with token usage","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string","description":"The model that answered."},"provider":{"type":"string","description":"Publisher of the model that answered.","example":"TypeSafe"},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"choice"},"choice":{"type":"string","description":"The selected criteria key."},"probabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Probability assigned to each option."},"confidence":{"type":"number"}},"required":["type","choice","probabilities","confidence"]},{"type":"object","properties":{"type":{"type":"string","const":"score"},"score":{"type":"number","description":"Position on the criteria scale. Fractional: 2.72 sits between the rungs at index 2 and 3."},"legend":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Maps each scale index back to its criteria entry. Read it before interpreting the score."},"probabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"confidence":{"type":"number"}},"required":["type","score","legend","probabilities","confidence"]},{"type":"object","properties":{"type":{"type":"string","const":"noul"},"noul":{"type":"number","description":"Probability that the proposition is true, 0 to 1."}},"required":["type","noul"]}],"description":"Answer for one question, matching the question's type. Score answers carry a legend; choice and score answers carry per-option probabilities and a confidence."},"description":"One answer per question, under the same key."},"usage":{"type":"object","properties":{"input_tokens":{"type":"number"},"output_tokens":{"type":"number"}},"required":["input_tokens","output_tokens"],"description":"Token usage for the decision. Jev bills input tokens only."}},"required":["id","model","provider","answers","usage"]}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"502":{"description":"We couldn't reach our backend services. Please try again shortly.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":502},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_GATEWAY"]},"message":{"anyOf":[{"type":"string","const":"We couldn't reach our backend services. Please try again shortly."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"description":"Decision model to use. Defaults to `jev`. See the `/models` endpoint for models that list `/alpha/decisions` in `supported_endpoints`.","example":"jev","type":"string"},"state":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}],"description":"The facts to decide on. Confidence can stay high when facts are missing, so supply what is relevant rather than everything.","example":"My payouts have been failing for 3 days."},"questions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"choice"},"instructions":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}],"description":"What to decide.","example":"Which team should handle this?"},"criteria":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},{"type":"null"}]},"description":"Selectable options mapped to what each one means. The answer returns one of these keys.","example":{"billing":"Payment issues","technical":"Product failures"}}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","const":"score"},"instructions":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}],"description":"What to rate.","example":"How urgent is follow-up?"},"criteria":{"minItems":2,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},"description":"Ordered rungs from lowest to highest. The answer's score is a position on this scale, and its legend maps each index back to the rung.","example":["none","low","medium","high"]}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","const":"noul"},"instructions":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}],"description":"The yes/no proposition to evaluate.","example":"Does this convey urgency?"},"criteria":{"description":"Optional descriptions of what true and false mean for this proposition.","type":"object","properties":{"true":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]},"false":{"anyOf":[{"type":"string"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"array","items":{}}]}}}},"required":["type","instructions"]}],"description":"A `choice` between named options, a `score` on an ordered scale, or a `noul` probability for a yes/no proposition."},"description":"Questions to answer about the state, keyed by a name you choose. Each question is evaluated independently and answered under the same key."}},"required":["state","questions"]}}}}}},"/v1/responses":{"post":{"operationId":"postV1Responses","tags":["Text"],"summary":"Create Response","description":"Generate a stateless OpenAI-compatible Response through a model that advertises `/v1/responses` in `supported_endpoints`.\nJSON request bodies may be up to 32 MiB, including inline images.\n\nBuilt-in models use their configured Responses URL. Community text models and endpoint agents registered with the Responses API use their selected URL for both Responses and adapted Chat requests. Managed prompt agents serialize Responses JSON and SSE around their configured prompt and MCP tool loop. Built-in Chat routes may use a separate upstream API.\n\nOpenAI prompt_cache_options and prompt_cache_breakpoint controls pass through direct Responses requests and Chat requests adapted to Responses. Managed prompt agents preserve caller breakpoints or apply an explicit breakpoint after their configured static prompt.\n\nResponse storage, previous response IDs, conversations, background execution, and encrypted or referenced state are not supported. Prompt agents execute their configured MCP tools on the server and return caller-supplied function calls for the client to execute. Replay output items with matching function_call_output results to continue. Completed MCP pairs are history, not client tool requests. Caller tool names must not start with mcp__; tool_choice supports only auto.\n\nSuccessful text JSON responses and terminal streaming events contain usage; missing text-provider usage fails the response.\n\nMetadata is passed unchanged to endpoint agents; see the agent’s documentation for supported keys.\n\nMedia 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.","responses":{"200":{"description":"Responses JSON or semantic Responses SSE","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateResponseResponse"},{"$ref":"#/components/schemas/MediaResponse"}]}},"text/event-stream":{"schema":{"type":"string","description":"Responses API SSE events ending with response.completed, response.incomplete, or response.failed. Text models include usage; media models return usage: null. A data: [DONE] marker may follow."}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"413":{"description":"The request payload is too large. Reduce its size and try again.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":413},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"]},"message":{"anyOf":[{"type":"string","const":"The request payload is too large. Reduce its size and try again."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"502":{"description":"We couldn't reach our backend services. Please try again shortly.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":502},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_GATEWAY"]},"message":{"anyOf":[{"type":"string","const":"We couldn't reach our backend services. Please try again shortly."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"default":"openai/gpt-5.4-nano","type":"string"},"input":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{}}]},"instructions":{"type":["string","null"]},"reasoning":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"max_output_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_tool_calls":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"stream":{"default":false,"type":"boolean"},"stream_options":{"anyOf":[{"type":"object","properties":{"include_obfuscation":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"store":{"default":false,"type":"boolean","const":false},"previous_response_id":{"type":"null"},"conversation":{"type":"null"},"background":{"anyOf":[{"type":"boolean","const":false},{"type":"null"}]},"include":{"anyOf":[{"type":"array","items":{"type":"string","enum":["web_search_call.action.sources","code_interpreter_call.outputs","computer_call_output.output.image_url","file_search_call.results","message.input_image.image_url","message.output_text.logprobs"]}},{"type":"null"}]},"context_management":{"anyOf":[{"maxItems":0,"type":"array","items":{"not":{}}},{"type":"null"}]},"prompt":{"type":"null"},"text":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function"},"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"type":["boolean","null"]}},"required":["type","name"],"additionalProperties":{}}},"tool_choice":{},"parallel_tool_calls":{"type":"boolean"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"user":{"type":"string"},"safety_identifier":{"type":"string","maxLength":64},"prompt_cache_key":{"type":"string"},"prompt_cache_options":{"$ref":"#/components/schemas/PromptCacheOptions"},"prompt_cache_retention":{"type":"string","enum":["in_memory","24h"]},"service_tier":{"type":"string"},"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"top_p":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"top_logprobs":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"frequency_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"presence_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"truncation":{"anyOf":[{"type":"string","enum":["auto","disabled"]},{"type":"null"}]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]}},"required":["input"],"additionalProperties":false}}}},"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl https://gen.pollinations.ai/v1/responses \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"openai\",\"input\":\"Hello!\",\"store\":false}'"},{"label":"Streaming","lang":"Shell","source":"curl -N https://gen.pollinations.ai/v1/responses \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"openai\",\"input\":\"Hello!\",\"store\":false,\"stream\":true}'"},{"label":"Python","lang":"Python","source":"from openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://gen.pollinations.ai/v1\",\n    api_key=\"YOUR_API_KEY\",\n)\nresponse = client.responses.create(\n    model=\"openai\", input=\"Hello!\", store=False,\n)\nprint(response.output_text)"},{"label":"JavaScript","lang":"JavaScript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: \"https://gen.pollinations.ai/v1\",\n  apiKey: \"YOUR_API_KEY\",\n});\nconst response = await client.responses.create({\n  model: \"openai\", input: \"Hello!\", store: false,\n});\nconsole.log(response.output_text);"}]}},"/v1/embeddings":{"post":{"operationId":"postV1Embeddings","tags":["Embeddings"],"summary":"Create Embeddings","description":"Generate vector embeddings with an OpenAI-compatible response format.\n\n**Models:** `google/gemini-embedding-2` supports text, image, audio, and video. `cohere/embed-v4.0` supports text and one image. OpenAI and Qwen embedding models are text-only.\n\n**Input:** Pass a string, an array of up to 32 strings, or supported multimodal content parts (`text`, `image_url`, `input_audio`, `video_url`) in the `input` field.\n\n**Retrieval roles:** Use `task_type` with Gemini text input; it is converted to the model's recommended prompt instruction. Use `input_type` (`query` or `document`) with Cohere.\n\n**Billing:** Gemini task instructions count toward prompt token usage. Cohere image requests expose one combined usage count, so text accompanying an image is billed at the image-input rate.\n\n**Gemini migration:** `google/gemini-embedding-2` uses the GA embedding space. Do not mix preview-era and GA vectors; re-embed stored `google/gemini-embedding-2` data before comparing it with new results.\n\n**Dimensions:** Defaults are model-specific. Qwen supports up to 4096; Gemini and OpenAI large up to 3072; OpenAI small up to 1536; Cohere supports 256, 512, 1024, or 1536.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmbeddingResponse"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmbeddingRequest"}}}}}},"/text":{"post":{"operationId":"postText","tags":["Text"],"summary":"Text Generation With Messages","description":"Generate text from an OpenAI-style messages array and return the assistant content directly.\n\nUse `/v1/chat/completions` when you need the full OpenAI-compatible JSON response.","responses":{"200":{"description":"Generated text response, audio bytes, JSON message object, or SSE when stream=true"},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"system"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"developer"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},"role":{"type":"string","const":"user"},"name":{"type":"string"}},"required":["content","role"],"additionalProperties":{}},{"type":"object","properties":{"content":{"anyOf":[{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},{"type":"null"}]},"role":{"type":"string","const":"assistant"},"name":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}},"function_call":{"anyOf":[{"type":"object","properties":{"arguments":{"type":"string"},"name":{"type":"string"}},"required":["arguments","name"]},{"type":"null"}]},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["role"],"additionalProperties":{}},{"type":"object","properties":{"role":{"type":"string","const":"tool"},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MessageContentPart"}}]},{"type":"null"}]},"tool_call_id":{"type":"string"},"name":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}},"required":["role","content","tool_call_id"],"additionalProperties":{}},{"type":"object","properties":{"role":{"type":"string","const":"function"},"content":{"type":["string","null"]},"name":{"type":"string"}},"required":["role","content","name"],"additionalProperties":{}}]}},"model":{"default":"openai/gpt-5.4-nano","description":"AI model for text generation. See /v1/models for full list.","type":"string"},"metadata":{"description":"Passed unchanged to endpoint agents. Each agent documents the metadata keys it accepts.","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"modalities":{"type":"array","items":{"type":"string","enum":["text","audio"]}},"audio":{"type":"object","properties":{"voice":{"type":"string","enum":["alloy","echo","fable","onyx","nova","shimmer","coral","verse","ballad","ash","sage","amuch","dan"]},"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"]}},"required":["voice","format"]},"frequency_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"repetition_penalty":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"logit_bias":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]},"logprobs":{"type":["boolean","null"]},"top_logprobs":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"max_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"presence_penalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"response_format":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"json_schema"},"json_schema":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"default":false,"type":["boolean","null"]}},"required":["schema"]}},"required":["type","json_schema"]},{"type":"object","properties":{"type":{"type":"string","const":"json_object"}},"required":["type"]}]},"seed":{"anyOf":[{"type":"integer","minimum":-1,"maximum":2147483647},{"type":"null"}]},"stop":{"anyOf":[{"type":["string","null"]},{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string"}}]},"stream":{"default":false,"type":["boolean","null"]},"stream_options":{"anyOf":[{"type":"object","properties":{"include_usage":{"type":"boolean"}}},{"type":"null"}]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"Requests reasoning depth for models that support adjustable reasoning. \"none\" requests no reasoning."},"web_search_options":{"type":"object","properties":{"search_context_size":{"type":"string","enum":["low","medium","high"]}},"required":["search_context_size"],"description":"Perplexity Sonar search context size: how much page content each web search reads. Larger sizes use more input tokens."},"temperature":{"description":"Sampling controls are ignored for model families that do not consistently support them, regardless of reasoning mode.","anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"top_p":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"strict":{"default":false,"type":["boolean","null"]}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","enum":["code_execution","google_search","google_maps","url_context","computer_use","file_search"]}},"required":["type"]}]}},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object","properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["type","function"]}]},"parallel_tool_calls":{"type":"boolean"},"user":{"type":"string"},"prompt_cache_key":{"type":"string"},"prompt_cache_options":{"$ref":"#/components/schemas/PromptCacheOptions"},"prompt_cache_retention":{"type":"string","enum":["in_memory","24h"]},"function_call":{"anyOf":[{"type":"string","enum":["none","auto"]},{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}]},"functions":{"minItems":1,"maxItems":128,"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name"],"additionalProperties":false}}},"required":["messages"],"additionalProperties":{}}}}}}},"/text/{prompt}":{"get":{"operationId":"getTextByPrompt","tags":["Text"],"summary":"Simple Text Generation","description":"Generate text from a prompt via a simple GET request. Returns plain text.\n\nThis is a simplified alternative to the OpenAI-compatible `/v1/chat/completions` endpoint — ideal for quick prototyping or simple integrations.","responses":{"200":{"description":"Generated text response","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"prompt","schema":{"type":"string","minLength":1,"example":"Write a haiku about coding"},"required":true,"description":"Text prompt for generation"},{"in":"query","name":"model","schema":{"default":"openai/gpt-5.4-nano","type":"string"},"description":"Text model to use. See /v1/models or /text/models for the full list of available models."},{"in":"query","name":"seed","schema":{"type":"integer","minimum":-1,"maximum":9007199254740991},"description":"Optional seed for reproducible results on models that support it. Omitted by default. -1 maps to the stable compatibility seed."},{"in":"query","name":"system","schema":{"type":"string"},"description":"System prompt to set the model's behavior and context. Acts as initial instructions before the user prompt."},{"in":"query","name":"json","schema":{"type":"boolean"},"description":"When true, the model returns valid JSON. Useful for structured data extraction."},{"in":"query","name":"temperature","schema":{"type":"number"},"description":"Controls randomness. Lower values (e.g. 0.2) produce more focused output, higher values (e.g. 1.5) produce more creative output. Range: 0.0 to 2.0. Sampling controls are ignored for model families that do not consistently support them, regardless of reasoning mode."},{"in":"query","name":"top_p","schema":{"type":"number"}},{"in":"query","name":"presence_penalty","schema":{"type":"number"}},{"in":"query","name":"frequency_penalty","schema":{"type":"number"}},{"in":"query","name":"repetition_penalty","schema":{"type":"number"}},{"in":"query","name":"max_tokens","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"in":"query","name":"max_completion_tokens","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"in":"query","name":"reasoning_effort","schema":{"type":"string"}},{"in":"query","name":"voice","schema":{"type":"string"}},{"in":"query","name":"stream","schema":{"type":"boolean"},"description":"Stream the response as it's generated, using Server-Sent Events (SSE). Each chunk contains partial text."},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://gen.pollinations.ai/text/Write%20a%20haiku?model=openai\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\""},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/text/Write a haiku\",\n    params={\"model\": \"openai/gpt-5.4-nano\"},\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nprint(response.text)"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/text/Write%20a%20haiku?model=openai\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconsole.log(await response.text());"}]}},"/image/{prompt}":{"get":{"operationId":"getImageByPrompt","tags":["Image"],"summary":"Generate Image","description":"Generate an image from a text prompt. Returns JPEG, PNG, or SVG depending on the selected model.\n\n**Available models:** `krea/krea-2-medium`, `krea/krea-2-medium:replicate`, `lykon/dreamshaper-8-lcm`, `black-forest-labs/flux.1-kontext-pro`, `black-forest-labs/flux.1-kontext-pro:replicate`, `black-forest-labs/flux.1.1-pro`, `black-forest-labs/flux.1.1-pro:azure:sweden`, `black-forest-labs/flux.2-pro`, `black-forest-labs/flux.2-pro:replicate`, `black-forest-labs/flux-3-image`, `black-forest-labs/flux.2-flex`, `black-forest-labs/flux.2-max`, `black-forest-labs/flux.2-max:openrouter`, `microsoft/mai-image-2.6-flash`, `microsoft/mai-image-2.6`, `google/gemini-2.5-flash-image`, `google/gemini-2.5-flash-image:openrouter:vertex-global`, `google/gemini-3.1-flash-image`, `google/gemini-3.1-flash-image:openrouter:vertex-global`, `google/gemini-3.1-flash-lite-image`, `google/gemini-3.1-flash-lite-image:openrouter:vertex-global`, `google/gemini-3-pro-image`, `google/gemini-3-pro-image:openrouter:ai-studio-global`, `bytedance/seedream-5.0-lite`, `bytedance/seedream-5.0-lite:fal`, `bytedance/seedream-5.0-flash`, `bytedance/seedream-5.0-pro`, `bytedance/seedream-4.0`, `bytedance/seedream-4.5`, `ideogram-ai/ideogram-v4-turbo`, `ideogram-ai/ideogram-v4-balanced`, `ideogram-ai/ideogram-v4-quality`, `openai/gpt-image-1-mini`, `openai/gpt-image-1-mini:openai`, `openai/gpt-image-1.5`, `openai/gpt-image-1.5:openai`, `openai/gpt-image-2`, `openai/gpt-image-2:openai`, `openai/gpt-image-2.5-flare`, `openai/gpt-image-2.5-flare:openai`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-sunburst:openai`, `black-forest-labs/flux.1-schnell`, `black-forest-labs/flux.1-schnell:deepinfra`, `tongyi-mai/z-image-turbo`, `tongyi-mai/z-image-turbo:fal`, `alibaba/wan-2.7-image`, `alibaba/wan-2.7-image:replicate`, `alibaba/wan-2.7-image-pro`, `qwen/qwen-image`, `qwen/qwen-image-2.1`, `qwen/qwen-image-3`, `qwen/qwen-image-3:fal`, `qwen/qwen-image-3:replicate`, `x-ai/grok-imagine-image`, `x-ai/grok-imagine-image-quality`, `x-ai/grok-imagine-image-2.0`, `recraft/recraft-v4.1-vector`, `recraft/recraft-v4.1-flash`, `black-forest-labs/flux.2-klein-4b`, `prunaai/p-image`, `prunaai/p-image-edit`, `prunaai/p-image-edit:replicate`, `inferenceport-ai/lightning-image-turbo`. `tongyi-mai/z-image-turbo` is the default.\n\nBrowse all available models and their capabilities at [`/image/models`](https://gen.pollinations.ai/image/models).","responses":{"200":{"description":"Success - Returns the generated image","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"prompt","schema":{"type":"string","minLength":1,"example":"a beautiful sunset over mountains"},"required":true,"description":"Text description of the image to generate"},{"in":"query","name":"model","schema":{"default":"tongyi-mai/z-image-turbo","type":"string","minLength":1},"description":"Model to use. See /image/models for the current canonical IDs and aliases."},{"in":"query","name":"width","schema":{"default":1024,"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Width in pixels. For images, exact pixels; `flux-2-pro`, `flux-2-flex`, and `microsoft/mai-image-2.6-flash` require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). `black-forest-labs/flux.1.1-pro` requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use `resolution` to select a resolution tier."},{"in":"query","name":"height","schema":{"default":1024,"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Height in pixels. For images, exact pixels; `flux-2-pro`, `flux-2-flex`, and `microsoft/mai-image-2.6-flash` require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). `black-forest-labs/flux.1.1-pro` requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use `resolution` to select a resolution tier."},{"in":"query","name":"seed","schema":{"default":0,"type":"integer","minimum":-1,"maximum":2147483647},"description":"Seed for reproducible results. Use -1 for random. Supported by: black-forest-labs/flux.1-schnell, black-forest-labs/flux.1.1-pro, tongyi-mai/z-image-turbo, bytedance/seedream-4.0, black-forest-labs/flux.2-klein-4b, bytedance/seedance-2.0. Other models ignore this parameter."},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."},{"in":"query","name":"quality","schema":{"default":"medium","type":"string","enum":["low","medium","high","hd"]},"description":"Image quality level. Supported by `gptimage`, `gptimage-large`, `gpt-image-2`, and `grok-imagine-image-2.0`."},{"in":"query","name":"image","schema":{"type":"string"},"description":"Reference image URL(s) for image editing or video generation. Separate multiple URLs with `|` or `,`. **Image models:** Used for editing or style reference. **Video models:** `image[0]` is the starting frame; `image[1]` is the optional ending frame. See `video_capabilities` and `max_reference_images` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_images","schema":{"type":"string"},"description":"Video models only: public HTTP(S) image URLs for visual guidance, separate from first/last-frame controls. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_videos","schema":{"type":"string"},"description":"Video models only: public HTTP(S) video URLs for motion or style guidance. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_audios","schema":{"type":"string"},"description":"Video models only: public HTTP(S) audio URLs for audio-driven generation. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"transparent","schema":{"default":false,"type":"boolean"},"description":"Generate image with transparent background. Only supported by `gptimage` and `gptimage-large`."},{"in":"query","name":"resolution","schema":{"type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"description":"Output resolution for image and video models that advertise `resolutions` in `/models`. The first advertised resolution is the default; requested tiers bill at their listed rate."},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"maximum":120},"description":"Video duration in seconds. Only applies to video models. Community models may omit this if the provider reports generated seconds; billing prefers reported duration and otherwise uses this value. `google/gemini-omni-1.1-flash`: 3-10s. `veo`: 4, 6, or 8s. `seedance-pro`: 2-10s. `seedance-2.0`: 4-15s; Mini: 4-10s; Fast: 4-5s. `seedance-2.5`: exactly 4s. `minimax-h3`: exactly 5s. `minimax/minimax-h3-max` and `minimax/minimax-h3-max-turbo`: 5, 10, or 15s. `wan`: 2-15s. `wan-3.0`: exactly 5s."},{"in":"query","name":"aspectRatio","schema":{"type":"string"},"description":"Aspect ratio. For `bytedance/seedream-5.0-flash`, overrides width/height; `adaptive` lets the provider choose. For video models, if not set, determined by explicit width/height; `veo`, `google/gemini-omni-1.1-flash`, `seedance-2.5`, `minimax/minimax-h3-max`, and `minimax/minimax-h3-max-turbo` otherwise default to `16:9`. Most video models support `16:9` or `9:16`; `minimax-h3` supports only `16:9`, while `minimax/minimax-h3-max` and `minimax/minimax-h3-max-turbo` also support `21:9`, `4:3`, `1:1`, and `3:4`."},{"in":"query","name":"audio","schema":{"type":"boolean"},"description":"Generate audio for the video. Only applies to video models. `veo` generates and bills audio only when set to `true`. `seedance-2.0`, `seedance-2.0-mini`, `seedance-2.0-fast`, `seedance-2.5`, and `wan-3.0` generate audio unless set to `false`. `wan2.6`, `wan-2.7`, `grok-imagine-video-1.5`, `google/gemini-omni-1.1-flash`, `minimax-h3`, `minimax/minimax-h3-max`, and `minimax/minimax-h3-max-turbo` always generate audio regardless of this flag."}],"x-codeSamples":[{"label":"HTML","lang":"HTML","source":"<!-- No code needed — use as an image URL -->\n<img src=\"https://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux\" />"},{"label":"cURL","lang":"Shell","source":"# Generate an image\ncurl \"https://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o image.jpg\n\n# Generate a video\ncurl \"https://gen.pollinations.ai/image/a%20sunset%20timelapse?model=veo&duration=4\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o video.mp4"},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/image/a cat in space\",\n    params={\"model\": \"black-forest-labs/flux.1-schnell\"},\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nwith open(\"image.jpg\", \"wb\") as f:\n    f.write(response.content)"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst blob = await response.blob();"}]}},"/video/{prompt}":{"get":{"operationId":"getVideoByPrompt","tags":["Video"],"summary":"Generate Video","description":"Generate a video from a text prompt. Returns MP4.\n\n**Available models:** `google/veo-3.1-fast`, `google/veo-3.1-fast:replicate`, `google/gemini-omni-1.1-flash`, `bytedance/seedance-1-pro-fast`, `bytedance/seedance-1-pro-fast:fal`, `bytedance/seedance-2.0`, `bytedance/seedance-2.0-mini`, `bytedance/seedance-2.0-fast`, `alibaba/wan-2.6`, `alibaba/wan-2.6:replicate`, `alibaba/wan-2.6:fal`, `alibaba/wan-2.2-fast`, `alibaba/wan-2.2-fast:fal`, `alibaba/wan-2.7`, `alibaba/wan-3.0`, `alibaba/wan-3.0:fal`, `x-ai/grok-imagine-video`, `x-ai/grok-imagine-video:openrouter`, `x-ai/grok-imagine-video-1.5`, `x-ai/grok-imagine-video-1.5:fal`, `bytedance/seedance-2.5`, `alibaba/happyhorse-1.1`, `heygen/heygen-video-1`, `minimax/minimax-h3`, `minimax/minimax-h3-max`, `minimax/minimax-h3-max-turbo`, `prunaai/p-video`.\n\nUse `duration` to set video length, `aspectRatio` for orientation, and `audio` where the selected model supports audio output.\n\nYou can pass reference images via the `image` parameter: `image[0]` is the start frame, and `image[1]` is the end frame for models with `end_frame` in `video_capabilities`.\n\nSeedance 2.0, Seedance 2.5, Wan 3.0, and MiniMax H3 Max also accept `reference_images`, `reference_videos`, and `reference_audios` for guidance distinct from frame controls. Separate URLs with `|`; commas inside URLs are preserved.\n\nBrowse all available models and their `video_capabilities` at [`/image/models`](https://gen.pollinations.ai/image/models).","responses":{"200":{"description":"Success - Returns the generated video","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"prompt","schema":{"type":"string","minLength":1,"example":"a sunset timelapse over the ocean"},"required":true,"description":"Text description of the video to generate"},{"in":"query","name":"model","schema":{"default":"google/veo-3.1-fast","type":"string","minLength":1},"description":"Model to use. See /image/models for the current canonical IDs and aliases."},{"in":"query","name":"width","schema":{"default":1024,"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Width in pixels. For images, exact pixels; `flux-2-pro`, `flux-2-flex`, and `microsoft/mai-image-2.6-flash` require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). `black-forest-labs/flux.1.1-pro` requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use `resolution` to select a resolution tier."},{"in":"query","name":"height","schema":{"default":1024,"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Height in pixels. For images, exact pixels; `flux-2-pro`, `flux-2-flex`, and `microsoft/mai-image-2.6-flash` require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). `black-forest-labs/flux.1.1-pro` requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use `resolution` to select a resolution tier."},{"in":"query","name":"seed","schema":{"default":0,"type":"integer","minimum":-1,"maximum":2147483647},"description":"Seed for reproducible results. Use -1 for random. Supported by: black-forest-labs/flux.1-schnell, black-forest-labs/flux.1.1-pro, tongyi-mai/z-image-turbo, bytedance/seedream-4.0, black-forest-labs/flux.2-klein-4b, bytedance/seedance-2.0. Other models ignore this parameter."},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."},{"in":"query","name":"quality","schema":{"default":"medium","type":"string","enum":["low","medium","high","hd"]},"description":"Image quality level. Supported by `gptimage`, `gptimage-large`, `gpt-image-2`, and `grok-imagine-image-2.0`."},{"in":"query","name":"image","schema":{"type":"string"},"description":"Reference image URL(s) for image editing or video generation. Separate multiple URLs with `|` or `,`. **Image models:** Used for editing or style reference. **Video models:** `image[0]` is the starting frame; `image[1]` is the optional ending frame. See `video_capabilities` and `max_reference_images` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_images","schema":{"type":"string"},"description":"Video models only: public HTTP(S) image URLs for visual guidance, separate from first/last-frame controls. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_videos","schema":{"type":"string"},"description":"Video models only: public HTTP(S) video URLs for motion or style guidance. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"reference_audios","schema":{"type":"string"},"description":"Video models only: public HTTP(S) audio URLs for audio-driven generation. Separate multiple URLs with `|`; commas inside URLs are preserved. See `video_capabilities` on `/image/models` or `/models` for per-model support."},{"in":"query","name":"transparent","schema":{"default":false,"type":"boolean"},"description":"Generate image with transparent background. Only supported by `gptimage` and `gptimage-large`."},{"in":"query","name":"resolution","schema":{"type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"description":"Output resolution for image and video models that advertise `resolutions` in `/models`. The first advertised resolution is the default; requested tiers bill at their listed rate."},{"in":"query","name":"duration","schema":{"type":"integer","minimum":1,"maximum":120},"description":"Video duration in seconds. Only applies to video models. Community models may omit this if the provider reports generated seconds; billing prefers reported duration and otherwise uses this value. `google/gemini-omni-1.1-flash`: 3-10s. `veo`: 4, 6, or 8s. `seedance-pro`: 2-10s. `seedance-2.0`: 4-15s; Mini: 4-10s; Fast: 4-5s. `seedance-2.5`: exactly 4s. `minimax-h3`: exactly 5s. `minimax/minimax-h3-max` and `minimax/minimax-h3-max-turbo`: 5, 10, or 15s. `wan`: 2-15s. `wan-3.0`: exactly 5s."},{"in":"query","name":"aspectRatio","schema":{"type":"string"},"description":"Aspect ratio. For `bytedance/seedream-5.0-flash`, overrides width/height; `adaptive` lets the provider choose. For video models, if not set, determined by explicit width/height; `veo`, `google/gemini-omni-1.1-flash`, `seedance-2.5`, `minimax/minimax-h3-max`, and `minimax/minimax-h3-max-turbo` otherwise default to `16:9`. Most video models support `16:9` or `9:16`; `minimax-h3` supports only `16:9`, while `minimax/minimax-h3-max` and `minimax/minimax-h3-max-turbo` also support `21:9`, `4:3`, `1:1`, and `3:4`."},{"in":"query","name":"audio","schema":{"type":"boolean"},"description":"Generate audio for the video. Only applies to video models. `veo` generates and bills audio only when set to `true`. `seedance-2.0`, `seedance-2.0-mini`, `seedance-2.0-fast`, `seedance-2.5`, and `wan-3.0` generate audio unless set to `false`. `wan2.6`, `wan-2.7`, `grok-imagine-video-1.5`, `google/gemini-omni-1.1-flash`, `minimax-h3`, `minimax/minimax-h3-max`, and `minimax/minimax-h3-max-turbo` always generate audio regardless of this flag."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://gen.pollinations.ai/video/a%20sunset%20timelapse?model=veo&duration=4\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o video.mp4"},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/video/a sunset timelapse\",\n    params={\"model\": \"google/veo-3.1-fast\", \"duration\": 4},\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nwith open(\"video.mp4\", \"wb\") as f:\n    f.write(response.content)"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/video/a%20sunset%20timelapse?model=veo&duration=4\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst blob = await response.blob();"}]}},"/3d/{prompt}":{"get":{"operationId":"get3dByPrompt","tags":["3D"],"summary":"Generate 3D Model","description":"Generate a 3D model from a text prompt or reference image(s). Returns GLB by default. `nvidia/asset-harvester` returns PLY.\n\n**Available models:** `microsoft/trellis-2`, `microsoft/trellis-2:fal`, `nvidia/asset-harvester`, `hyper3d/rodin-2.5`. `microsoft/trellis-2` is the default.\n\nPass reference image URL(s) via the `image` parameter for image-to-3D models (`microsoft/trellis-2`, `nvidia/asset-harvester`). Separate multiple URLs with `|` or `,`. `hyper3d/rodin-2.5` accepts both images and a text prompt.\n\nBrowse all available models and their input requirements at [`/3d/models`](https://gen.pollinations.ai/3d/models).","responses":{"200":{"description":"Success - Returns the generated 3D model","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"model/gltf-binary":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"prompt","schema":{"type":"string","minLength":1,"example":"a low-poly treasure chest"},"required":true,"description":"Text description of the 3D model to generate (required for text-to-3D models such as Hyper3D Rodin; ignored by image-only models such as Trellis 2)"},{"in":"query","name":"model","schema":{"default":"microsoft/trellis-2","type":"string","enum":["microsoft/trellis-2","microsoft/trellis-2:fal","nvidia/asset-harvester","hyper3d/rodin-2.5","trellis-2-low","trellis-2-medium","trellis-2-high","trellis-2","rodin","hyper3d-rodin"]},"description":"Model to use. See /3d/models for the full list and per-model input requirements."},{"in":"query","name":"resolution","schema":{"type":"string","enum":["low","medium","high"]},"description":"Output detail for `microsoft/trellis-2`. Defaults to `low`."},{"in":"query","name":"image","schema":{"type":"string"},"description":"Reference image URL(s) for image-to-3D generation. Separate multiple URLs with `|` or `,`. Required for image-only models (e.g. `trellis`, `triposr`, `sf3d`)."},{"in":"query","name":"seed","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Seed for varied generations. Passed through to models that support it (`hyper3d/rodin-2.5`); otherwise only affects the media-cache key, so a new seed forces a fresh generation for the same prompt/image."},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."}]},"post":{"operationId":"post3dByPrompt","tags":["3D"],"summary":"Generate 3D Model With JSON","description":"Generate a 3D model from a text prompt or reference image using JSON parameters. `microsoft/trellis-2` supports `low`, `medium`, and `high` resolution with variable pricing. `nvidia/asset-harvester` returns PLY.","responses":{"200":{"description":"Success - Returns the generated 3D model","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"model/gltf-binary":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"prompt","schema":{"type":"string","minLength":1,"example":"a low-poly treasure chest"},"required":true,"description":"Text description of the 3D model to generate (required for text-to-3D models; ignored by image-only models)"},{"in":"query","name":"key","schema":{"type":"string"},"description":"API key (alternative to Authorization header)"},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"default":"microsoft/trellis-2","description":"Model to use for 3D generation. See /3d/models for the full list and per-model input requirements.","type":"string","enum":["microsoft/trellis-2","microsoft/trellis-2:fal","nvidia/asset-harvester","hyper3d/rodin-2.5","trellis-2-low","trellis-2-medium","trellis-2-high","trellis-2","rodin","hyper3d-rodin"]},"image":{"description":"Reference image URL or array of URLs for image-to-3D generation, optionally guided by the path prompt on supported models. A string is treated as one complete URL.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"resolution":{"default":"low","description":"Output voxel-grid resolution for `microsoft/trellis-2`: `low` (512³), `medium` (1024³), or `high` (1536³). Higher resolutions add detail, take longer, and cost more.","type":"string","enum":["low","medium","high"]},"seed":{"description":"Seed for varied generations. Passed to models that support it.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}}}}}},"/audio/{text}":{"get":{"operationId":"getAudioByText","tags":["Audio"],"summary":"Generate Audio","description":"Generate speech, dialogue, music, or sound effects from text via a simple GET request.\n\n**Text-to-speech (default):** Returns spoken audio in the selected voice and format.\n\n**Known voice presets:** alloy, echo, fable, onyx, nova, shimmer, ash, ballad, coral, sage, verse, rachel, domi, bella, elli, charlotte, dorothy, sarah, emily, lily, matilda, adam, antoni, arnold, josh, sam, daniel, charlie, james, fin, callum, liam, george, brian, bill, conversational_a, conversational_b, read_speech_a, read_speech_b, read_speech_c, read_speech_d, af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa, bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis, ef_dora, em_alex, em_santa, ff_siwis, hf_alpha, hf_beta, hm_omega, hm_psi, if_sara, im_nicola, jf_alpha, jf_gongitsune, jf_nezumi, jf_tebukuro, jm_kumo, pf_dora, pm_alex, pm_santa, zf_xiaobei, zf_xiaoni, zf_xiaoxiao, zf_xiaoyi, zm_yunjian, zm_yunxi, zm_yunxia, zm_yunyang, altair, ara, atlas, aurora, carina, castor, celeste, cosmo, eve, helios, helix, iris, kepler, leo, liora, lumen, luna, lux, naksh, orion, perseus, rex, rigel, sal, sirius, ursa, zagan, zenith, Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat. ElevenLabs models also accept a custom voice ID.\n\n**Output formats:** Model-dependent. Defaults to mp3 except Gemini TTS (wav); Gemini TTS supports wav and raw 24 kHz pcm and rejects other explicit formats. Other available formats include opus, aac, and flac.\n\n**Dialogue:** Set `model=elevenlabs/eleven-v3:dialogue`; provide one `<voice>: <text>` turn per line.\n\n**Music generation:** Set `model=elevenlabs/music-v2`, `elevenlabs/music-v2.5`, `google/lyria-3-clip-preview`, `google/lyria-3.5`, `stability-ai/stable-audio-3-medium`, or `stability-ai/stable-audio-3` to generate music instead of speech. `google/lyria-3.5` returns MP3 songs with approximate length described in the prompt and does not accept `duration`; `google/lyria-3-clip-preview` returns a fixed 30-second MP3 clip; the ElevenLabs Music models support `duration` (3-300 seconds) and `instrumental` mode; the Stable Audio models support `seconds` (1-380), `steps`, `seed`, and `negative_prompt`. Pass any publicly accessible audio URL as `reference_audio` to `POST /v1/audio/speech`.","responses":{"200":{"description":"Success - Returns audio data","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"429":{"description":"You're making requests too quickly. Please slow down a bit.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":429},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"anyOf":[{"type":"string","const":"You're making requests too quickly. Please slow down a bit."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"parameters":[{"in":"path","name":"text","schema":{"type":"string","minLength":1,"example":"Hello, welcome to Pollinations!"},"required":true,"description":"Text or prompt to generate. Dialogue operation expects one `voice: text` turn per line."},{"in":"query","name":"voice","schema":{"default":"alloy","example":"nova","type":"string","minLength":1},"description":"Voice preset or custom provider voice ID. Dialogue voices come from labels in the text."},{"in":"query","name":"response_format","schema":{"example":"mp3","type":"string","enum":["mp3","opus","aac","flac","wav","pcm"]},"description":"Audio output format. Defaults to mp3 except Gemini TTS (wav). Gemini TTS supports wav and raw 24 kHz pcm; other explicit formats are rejected. Grok TTS supports mp3, wav, and pcm; Fish Audio supports mp3 and pcm; CSM and Kokoro support mp3, opus, flac, wav, and pcm; Qwen TTS currently returns WAV regardless of this setting; `google/lyria-3.5`, `google/lyria-3-clip-preview`, and `elevenlabs/eleven-text-to-sound-v2` support mp3 only."},{"in":"query","name":"model","schema":{"example":"elevenlabs/eleven-v3","type":"string"},"description":"Audio model for speech, dialogue, music, or sound-effect generation"},{"in":"query","name":"duration","schema":{"example":"30","type":"string"},"description":"Output duration in seconds for music and sound effects. Each model lists its range as `min_duration` and `max_duration`, or `allowed_durations`, in `/audio/models`."},{"in":"query","name":"seconds","schema":{"example":"30","type":"number","minimum":0.5,"maximum":380},"description":"Alias for `duration`."},{"in":"query","name":"steps","schema":{"example":"8","type":"integer","minimum":1,"maximum":100},"description":"Sampling steps (`stability-ai/stable-audio-3-medium` 1-100, `stability-ai/stable-audio-3` 4-8)"},{"in":"query","name":"negative_prompt","schema":{"example":"distortion, vocals","type":"string"},"description":"Negative prompt for `stability-ai/stable-audio-3`"},{"in":"query","name":"instrumental","schema":{"example":"false","default":"false","type":"string","enum":["true","false"]},"description":"If true, guarantees instrumental output (`elevenlabs/music-v2` and `elevenlabs/music-v2.5` only)"},{"in":"query","name":"instructions","schema":{"example":"speak softly and warmly","type":"string"},"description":"Emotion/style instruction (Gemini TTS and `qwen/qwen3-tts-instruct-flash`)"},{"in":"query","name":"loop","schema":{"example":"false","type":"string","enum":["true","false"]},"description":"Loop the generated sound effect (`elevenlabs/eleven-text-to-sound-v2` only)"},{"in":"query","name":"prompt_influence","schema":{"example":"0.3","type":"string"},"description":"How strictly to follow the prompt, 0-1 (`elevenlabs/eleven-text-to-sound-v2` only)"},{"in":"query","name":"seed","schema":{"example":"42","type":"integer","minimum":-1,"maximum":4294967295},"description":"Seed passed to the model. Same seed + parameters return the same cached result while available."},{"in":"query","name":"key","schema":{"type":"string"},"description":"API key (alternative to Authorization header)"},{"in":"query","name":"safe","schema":{"type":["string","boolean"]},"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off."}],"x-codeSamples":[{"label":"cURL","lang":"Shell","source":"# Text-to-speech\ncurl \"https://gen.pollinations.ai/audio/Hello%20world?voice=nova\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o speech.mp3\n\n# Generate music (ElevenLabs)\ncurl \"https://gen.pollinations.ai/audio/upbeat%20jazz?model=elevenmusic&duration=30\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o music.mp3"},{"label":"Python","lang":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://gen.pollinations.ai/audio/Hello world\",\n    params={\"voice\": \"nova\"},\n    headers={\"Authorization\": \"Bearer YOUR_API_KEY\"},\n)\nwith open(\"speech.mp3\", \"wb\") as f:\n    f.write(response.content)"},{"label":"JavaScript","lang":"JavaScript","source":"const response = await fetch(\n  \"https://gen.pollinations.ai/audio/Hello%20world?voice=nova\",\n  { headers: { Authorization: \"Bearer YOUR_API_KEY\" } },\n);\nconst audio = await response.blob();"}]}},"/v1/images/generations":{"post":{"operationId":"postV1ImagesGenerations","tags":["Image"],"summary":"Generate Image (OpenAI-compatible)","description":"OpenAI-compatible image generation endpoint.\n\nGenerate images from text prompts. Supports `response_format: \"url\"` (returns the stored media URL; fetching it never generates an image) or `\"b64_json\"` (returns base64-encoded image data, default).\n\n**Authentication:** Include your API key as `Authorization: Bearer YOUR_API_KEY`.","responses":{"200":{"description":"Success","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImageResponse"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImageRequest"}}}}}},"/v1/images/edits":{"post":{"operationId":"postV1ImagesEdits","tags":["Image"],"summary":"Edit Image (OpenAI-compatible)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"A text description of the desired edit"},"image":{"anyOf":[{"type":"string","description":"Image URL"},{"type":"array","items":{"type":"object","properties":{"image_url":{"type":"string","description":"URL or base64 data URI of the source image"}},"required":["image_url"]}}],"description":"Source image(s). A URL string, or an array of {image_url} objects (OpenAI format)"},"model":{"default":"black-forest-labs/flux.1-schnell","description":"The model to use for image generation","type":"string"},"n":{"default":1,"description":"Number of images to generate (currently max 1)","type":"integer","minimum":1,"maximum":1},"size":{"description":"Image size as WIDTHxHEIGHT (e.g., 1024x1024, 512x512)","type":"string"},"quality":{"default":"medium","description":"Image quality. OpenAI 'standard'/'hd' mapped to Pollinations equivalents","type":"string","enum":["standard","hd","low","medium","high"]},"response_format":{"default":"b64_json","description":"Return format. \"url\" returns a stored media.pollinations.ai URL, \"b64_json\" returns base64-encoded image data","type":"string","enum":["url","b64_json"]},"resolution":{"description":"Output resolution for resolution-priced image and video models (Pollinations extension)","type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]}},"required":["prompt","image"],"additionalProperties":{},"$id":"CreateImageEditRequest"}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Provide source files or URLs using image or image[]. Repeat either field for multiple images.","anyOf":[{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"A text description of the desired edit"},"model":{"default":"black-forest-labs/flux.1-schnell","description":"The model to use for image generation","type":"string"},"size":{"description":"Image size as WIDTHxHEIGHT (e.g., 1024x1024, 512x512)","type":"string"},"quality":{"default":"medium","description":"Image quality. OpenAI 'standard'/'hd' mapped to Pollinations equivalents","type":"string","enum":["standard","hd","low","medium","high"]},"response_format":{"default":"b64_json","description":"Return format. \"url\" returns a stored media.pollinations.ai URL, \"b64_json\" returns base64-encoded image data","type":"string","enum":["url","b64_json"]},"resolution":{"description":"Output resolution for resolution-priced image and video models (Pollinations extension)","type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]},"image":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"string"},{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"string"}]}}]}},"required":["prompt","image"]},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"A text description of the desired edit"},"model":{"default":"black-forest-labs/flux.1-schnell","description":"The model to use for image generation","type":"string"},"size":{"description":"Image size as WIDTHxHEIGHT (e.g., 1024x1024, 512x512)","type":"string"},"quality":{"default":"medium","description":"Image quality. OpenAI 'standard'/'hd' mapped to Pollinations equivalents","type":"string","enum":["standard","hd","low","medium","high"]},"response_format":{"default":"b64_json","description":"Return format. \"url\" returns a stored media.pollinations.ai URL, \"b64_json\" returns base64-encoded image data","type":"string","enum":["url","b64_json"]},"resolution":{"description":"Output resolution for resolution-priced image and video models (Pollinations extension)","type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]},"image[]":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"string"},{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"string"}]}}]}},"required":["prompt","image[]"]}]}}}},"description":"OpenAI-compatible image editing endpoint.\n\nEdit images using a text prompt and one or more source images.\nAccepts JSON with image URLs or multipart/form-data with file uploads.\nSet response_format to \"url\" for a stored media URL, or \"b64_json\" for base64 image data (default).\nCommunity image models forward edits to the registrant's OpenAI-compatible endpoint as multipart form data.\n\n**Authentication:** Include your API key as `Authorization: Bearer YOUR_API_KEY`.","responses":{"200":{"description":"Success","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImageResponse"}}}},"400":{"description":"Something was wrong with the input data, check the details for more info.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":400},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","content_blocked","failed_to_download_image","invalid_image_url","image_too_large","unsupported_image_media_type"]},"message":{"anyOf":[{"type":"string","const":"Something was wrong with the input data, check the details for more info."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ValidationErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"401":{"description":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":401},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"anyOf":[{"type":"string","const":"Authentication required. Please provide an API key via Authorization header (Bearer token) or ?key= query parameter."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"402":{"description":"Insufficient pollen balance or API key budget exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":402},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYMENT_REQUIRED","KEY_BUDGET_EXHAUSTED","INSUFFICIENT_BALANCE"]},"message":{"anyOf":[{"type":"string","const":"Insufficient pollen balance or API key budget exhausted."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"403":{"description":"Access denied! You don't have the required permissions for this resource or model.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":403},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"anyOf":[{"type":"string","const":"Access denied! You don't have the required permissions for this resource or model."},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}},"500":{"description":"Oh snap, something went wrong on our end. We're on it!","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number","const":500},"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR"]},"message":{"anyOf":[{"type":"string","const":"Oh snap, something went wrong on our end. We're on it!"},{"type":"string"}]},"timestamp":{"type":"string"},"details":{"$ref":"#/components/schemas/ErrorDetails"},"requestId":{"type":"string"}},"required":["code","message","timestamp","details"]}},"required":["status","success","error"]}}}}}}},"/upload":{"post":{"operationId":"postUpload","tags":["Media Storage"],"summary":"Upload media","description":"Upload an image, audio, or video file via multipart/form-data (field `file`), application/json (base64 `data`), or a raw file body with its media MIME type and Content-Length headers. Multipart and raw uploads stream to storage up to 400 MiB; JSON uploads remain limited to 100 MiB because base64 decoding buffers in Worker memory. Raw uploads receive a random, unlisted ID. Returns an id and its retrieval URL. Omit `id` for a new random ID, or supply a case-sensitive ID scoped to your account. Custom IDs require a user-owned API key; the returned id includes an opaque account prefix. Existing files or gallery entries return 409 without being replaced, including on retries. Untagged files cannot be deleted. Files expire after 30 days; GET refreshes retention once a file is at least 15 days old.\n\n**Tags publish.** An optional `tags` field publishes the upload into each tag's public gallery (GET /media?tag=…), where anyone can see it. Untagged uploads stay unlisted, but all retrieval URLs are public. Knowing one custom URL makes other predictable names in that account guessable. **Alpha:** the publish tagging is new and may still change.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"id":{"type":"string","description":"Optional case-sensitive ID, scoped to your account. The returned id includes an opaque account prefix. Existing IDs return 409; omit for a random ID.","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"file":{"type":"string","format":"binary","description":"The media file to upload."},"tags":{"type":"string","description":"Comma-separated tags. Tagging publishes the upload to those tags' public galleries."}}}},"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Optional case-sensitive ID, scoped to your account. The returned id includes an opaque account prefix. Existing IDs return 409; omit for a random ID.","type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"data":{"type":"string","minLength":1,"description":"Base64-encoded file bytes (with or without a data: prefix)."},"contentType":{"description":"MIME type; defaults to application/octet-stream.","type":"string"},"name":{"description":"Filename; used for the download Content-Disposition.","type":"string"},"tags":{"description":"Tags (publish the upload to those tags' public galleries): a comma-separated string or an array of strings.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["data"],"additionalProperties":false}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Upload successful","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique media id (also the retrieval id)"},"url":{"type":"string","description":"Public retrieval URL"},"contentType":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"File size in bytes"},"tags":{"description":"Tags the upload was published with; present only when tagged","type":"array","items":{"type":"string"}}},"required":["id","url","contentType","size"]}}}},"400":{"description":"No/empty file, invalid JSON/base64, invalid ID/tags, or custom ID/tags on a key with no user account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The custom ID already has a file or gallery entry; nothing was replaced","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"File too large for the selected upload format","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Upload failed. The file may already have been stored, so retrying a custom ID can return 409.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"servers":[{"url":"https://media.pollinations.ai"}]},"/media":{"get":{"operationId":"getMedia","tags":["Media Storage"],"summary":"List a public tag gallery","description":"List the public gallery for a tag: every published item carrying that tag, any owner, newest first. Tagging an upload is what publishes it, so galleries are fully public — no API key needed. `tag` is required.\n\nItems reference storage with a 30-day lifecycle. A GET refreshes the lifecycle once an object is at least 15 days old. An expired item keeps its catalog entry, but its url 404s. **Alpha:** this endpoint is new and its API may still change.","security":[],"responses":{"200":{"description":"Page of media items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Catalog item id"},"url":{"type":"string","description":"Public retrieval URL"},"contentType":{"type":"string"},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"File size in bytes"},"tags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","description":"ISO-8601 timestamp"}},"required":["id","url","contentType","size","tags","createdAt"]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next page, null when exhausted. Treat it as a token: pass it back verbatim as `?cursor=` to fetch the next page — do not parse or construct it."},"hasMore":{"type":"boolean","description":"true when more pages exist (nextCursor is non-null). Loop while hasMore is true."}},"required":["items","nextCursor","hasMore"]}}}},"400":{"description":"Missing/empty tag, or invalid cursor or limit","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"in":"query","name":"tag","schema":{"type":"string"},"required":true,"description":"Required. The public gallery to list: items carrying this tag, any owner."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Page size, 1–100. Omitted → 20."},{"in":"query","name":"cursor","schema":{"type":"string"},"description":"Opaque pagination cursor from a previous response's nextCursor."}]},"servers":[{"url":"https://media.pollinations.ai"}]},"/media/{id}":{"delete":{"operationId":"deleteMediaById","tags":["Media Storage"],"summary":"Delete media","description":"Delete a published media item you own: the file, its catalog entry, and all its tags are removed, so it disappears from galleries and its URL 404s. Requires your **secret (`sk_`)** API key. Untagged uploads were never published, have no catalog entry, and can't be deleted — they use the same 30-day lifecycle, refreshed by a GET once they are at least 15 days old. **Alpha:** this endpoint is new and its API may still change.","parameters":[{"name":"id","in":"path","required":true,"description":"Media id (from the upload response or GET /media).","schema":{"type":"string"}}],"responses":{"200":{"description":"Item deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"id":{"type":"string","description":"Id of the deleted media item"}},"required":["deleted","id"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Key is not a secret (`sk_`) key, is not attached to a user account, or the item belongs to someone else","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No published media item with this id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"servers":[{"url":"https://media.pollinations.ai"}]},"/{id}":{"get":{"operationId":"getById","tags":["Media Storage"],"summary":"Retrieve media","description":"Get a file by its id. Retrieving the body refreshes its 30-day retention once the file is at least 15 days old. HEAD requests do not refresh retention.","security":[],"responses":{"200":{"description":"File content with appropriate Content-Type","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"head":{"operationId":"headById","tags":["Media Storage"],"summary":"Retrieve media","description":"Get a file by its id. Retrieving the body refreshes its 30-day retention once the file is at least 15 days old. HEAD requests do not refresh retention.","security":[],"responses":{"200":{"description":"File content with appropriate Content-Type","headers":{"Link":{"description":"Public stored-file URL with rel=\"enclosure\". Fetching it never generates media; expired files return 404. Also included when the file is wrapped in URL or base64 JSON.","schema":{"type":"string"},"example":"<https://media.pollinations.ai/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef>; rel=\"enclosure\""}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"servers":[{"url":"https://media.pollinations.ai"}]},"/{id}/metadata":{"get":{"operationId":"getByIdMetadata","tags":["Media Storage"],"summary":"Get file metadata","description":"Return file metadata (id, content type, size, upload timestamp) as JSON without downloading the file body.","security":[],"responses":{"200":{"description":"File metadata","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique media id"},"contentType":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"File size in bytes"},"uploadedAt":{"description":"ISO-8601 upload timestamp, when recorded","type":"string"}},"required":["id","contentType","size"]}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"servers":[{"url":"https://media.pollinations.ai"}]}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"pollinations.ai API key (pk_ or sk_)"}},"schemas":{"ValidationErrorDetails":{"type":"object","properties":{"name":{"type":"string"},"formErrors":{"type":"array","items":{"type":"string"}},"fieldErrors":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["name","formErrors","fieldErrors"]},"ErrorDetails":{"type":"object","properties":{"name":{"type":"string"},"upstreamStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upstreamHost":{"type":"string"},"upstreamBody":{"type":"string","description":"Original provider response body, without redaction or truncation."}},"required":["name"]},"CreateMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"message"},"role":{"type":"string","const":"assistant"},"model":{"type":"string"},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","text"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","id","name","input"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"redacted_thinking"},"data":{"type":"string"}},"required":["type","data"],"additionalProperties":{}}]}},"stop_reason":{"type":["string","null"]},"stop_sequence":{"type":["string","null"]},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_read_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_creation_input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens"]}},"required":["id","type","role","model","content","stop_reason","stop_sequence","usage"]},"MessagesError":{"type":"object","properties":{"type":{"type":"string","const":"error"},"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"]}},"required":["type","error"]},"CreateMessageRequest":{"type":"object","properties":{"model":{"type":"string","description":"Pollinations text model. Models that support this endpoint list `/v1/messages` in `supported_endpoints`."},"max_tokens":{"type":"integer","minimum":1,"maximum":9007199254740991},"messages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","text"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"image"},"source":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"base64"},"media_type":{"type":"string"},"data":{"type":"string"}},"required":["type","media_type","data"]},{"type":"object","properties":{"type":{"type":"string","const":"url"},"url":{"type":"string"}},"required":["type","url"]}]},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","source"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","id","name","input"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"tool_result"},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","text"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"image"},"source":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"base64"},"media_type":{"type":"string"},"data":{"type":"string"}},"required":["type","media_type","data"]},{"type":"object","properties":{"type":{"type":"string","const":"url"},"url":{"type":"string"}},"required":["type","url"]}]},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","source"],"additionalProperties":{}}]}}]},"is_error":{"type":"boolean"},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","tool_use_id"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"redacted_thinking"},"data":{"type":"string"}},"required":["type","data"],"additionalProperties":{}}]}}]}},"required":["role","content"],"additionalProperties":{}}},"system":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","const":"ephemeral"}},"required":["type"],"additionalProperties":{}}},"required":["type","text"],"additionalProperties":{}}}]},"stream":{"type":"boolean"},"stop_sequences":{"type":"array","items":{"type":"string"}},"temperature":{"type":"number"},"top_p":{"type":"number"},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name"],"additionalProperties":{}}},"tool_choice":{"type":"object","properties":{"type":{"type":"string","enum":["auto","any","tool","none"]},"name":{"type":"string"},"disable_parallel_tool_use":{"type":"boolean"}},"required":["type"]},"thinking":{"type":"object","properties":{"type":{"type":"string"},"budget_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type"],"additionalProperties":{}},"output_config":{"type":"object","properties":{"effort":{"type":"string"}},"additionalProperties":{}}},"required":["model","max_tokens","messages"],"additionalProperties":{}},"CacheControl":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]}},"required":["type"],"description":"Marks the end of a static prompt prefix to cache (Gemini, Claude, and Nova models). Place on the final content block of the prefix; repeat requests bill the cached prefix at ~10% of the input rate. See Text Generation → Prompt caching."},"PromptCacheBreakpoint":{"description":"Marks the end of a static prompt prefix when prompt_cache_options.mode is explicit.","type":"object","properties":{"mode":{"type":"string","const":"explicit"}},"required":["mode"],"additionalProperties":false},"ContentFilterSeverity":{"type":"string","enum":["safe","low","medium","high"]},"ContentFilterResult":{"type":"object","properties":{"hate":{"type":"object","properties":{"filtered":{"type":"boolean"},"severity":{"$ref":"#/components/schemas/ContentFilterSeverity"}},"required":["filtered","severity"]},"self_harm":{"type":"object","properties":{"filtered":{"type":"boolean"},"severity":{"$ref":"#/components/schemas/ContentFilterSeverity"}},"required":["filtered","severity"]},"sexual":{"type":"object","properties":{"filtered":{"type":"boolean"},"severity":{"$ref":"#/components/schemas/ContentFilterSeverity"}},"required":["filtered","severity"]},"violence":{"type":"object","properties":{"filtered":{"type":"boolean"},"severity":{"$ref":"#/components/schemas/ContentFilterSeverity"}},"required":["filtered","severity"]},"jailbreak":{"type":"object","properties":{"filtered":{"type":"boolean"},"detected":{"type":"boolean"}},"required":["filtered","detected"]},"protected_material_text":{"type":"object","properties":{"filtered":{"type":"boolean"},"detected":{"type":"boolean"}},"required":["filtered","detected"]},"protected_material_code":{"type":"object","properties":{"filtered":{"type":"boolean"},"detected":{"type":"boolean"}},"required":["filtered","detected"]}}},"CompletionUsage":{"type":"object","properties":{"cached_input_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_creation_input_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_read_input_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"completion_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion_tokens_details":{"anyOf":[{"type":"object","properties":{"accepted_prediction_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"audio_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"reasoning_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"rejected_prediction_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"prompt_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"prompt_tokens_details":{"anyOf":[{"type":"object","properties":{"audio_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_write_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cached_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_creation_input_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_type":{"type":["string","null"]},"image_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"reasoning_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"total_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["completion_tokens","prompt_tokens","total_tokens"]},"MediaChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"finish_reason":{"type":["string","null"]},"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"message":{"type":"object","properties":{"content":{"type":["string","null"]},"tool_calls":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}},{"type":"null"}]},"role":{"type":"string","const":"assistant"},"function_call":{"anyOf":[{"type":"object","properties":{"arguments":{"type":"string"},"name":{"type":"string"}},"required":["arguments","name"]},{"type":"null"}]},"content_blocks":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"type":"string","enum":["auto","low","high"]},"mime_type":{"type":"string"}},"required":["url"]},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"]},{"type":"object","properties":{"type":{"type":"string","const":"redacted_thinking"},"data":{"type":"string"}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}]}},{"type":"null"}]},"audio":{"anyOf":[{"type":"object","properties":{"transcript":{"type":"string"},"data":{"type":"string"},"id":{"type":"string"},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["transcript","data"]},{"type":"null"}]},"reasoning_content":{"type":["string","null"]}},"required":["role"]},"logprobs":{"anyOf":[{"anyOf":[{"type":"object","properties":{"content":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]},"top_logprobs":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number"},"bytes":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"type":"null"}]}},"required":["token","logprob","bytes"]}}},"required":["token","logprob","bytes","top_logprobs"]}},{"type":"null"}]}},"required":["content"]},{"type":"null"}]},{"type":"null"}]},"content_filter_results":{"anyOf":[{"$ref":"#/components/schemas/ContentFilterResult"},{"type":"null"}]}}}},"prompt_filter_results":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"prompt_index":{"type":"integer","minimum":0,"maximum":9007199254740991},"content_filter_results":{"$ref":"#/components/schemas/ContentFilterResult"}},"required":["prompt_index"]}},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model":{"type":"string"},"system_fingerprint":{"type":["string","null"]},"object":{"type":"string","const":"chat.completion"},"citations":{"type":"array","items":{"type":"string"}}},"required":["id","choices","created","object"]},"MessageContentPart":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"type":"string","enum":["auto","low","high"]},"mime_type":{"type":"string"}},"required":["url"]},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","const":"video_url"},"video_url":{"type":"object","properties":{"url":{"type":"string"},"mime_type":{"type":"string"}},"required":["url"]}},"required":["type","video_url"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string","enum":["wav","mp3","flac","opus","pcm16"]}},"required":["data","format"]},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"file"},"file":{"type":"object","properties":{"file_data":{"type":"string"},"file_id":{"type":"string"},"file_name":{"type":"string"},"file_url":{"type":"string"},"mime_type":{"type":"string"}}},"cache_control":{"$ref":"#/components/schemas/CacheControl"},"prompt_cache_breakpoint":{"$ref":"#/components/schemas/PromptCacheBreakpoint"}},"required":["type","file"]},{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}]},"PromptCacheOptions":{"type":"object","properties":{"mode":{"type":"string","enum":["implicit","explicit"]},"ttl":{"type":"string","const":"30m"}},"additionalProperties":false},"CreateResponseResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model":{"type":"string"},"status":{"type":"string","enum":["completed","failed","in_progress","cancelled","queued","incomplete"]},"output":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}},"usage":{"anyOf":[{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"input_tokens_details":{"anyOf":[{"type":"object","properties":{"cached_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cache_write_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"audio_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"image_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"video_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"additionalProperties":{}},{"type":"null"}]},"output_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"output_tokens_details":{"anyOf":[{"type":"object","properties":{"reasoning_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"audio_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"image_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"accepted_prediction_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"rejected_prediction_tokens":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"additionalProperties":{}},{"type":"null"}]},"total_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["input_tokens","output_tokens","total_tokens"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","object","model","status","output","usage"],"additionalProperties":{}},"MediaResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model":{"type":"string"},"status":{"type":"string","enum":["completed","failed","in_progress","cancelled","queued","incomplete"]},"output":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}},"usage":{"type":"null"}},"required":["id","object","model","status","output","usage"],"additionalProperties":{}},"CreateEmbeddingResponse":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","const":"embedding"},"embedding":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"string"}],"description":"Embedding vector — array of floats, or base64-encoded Float32 (little-endian) when `encoding_format=base64`."},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Index of the embedding in the list"}},"required":["object","embedding","index"]}},"model":{"type":"string"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["prompt_tokens","total_tokens"]}},"required":["object","data","model","usage"]},"CreateEmbeddingRequest":{"type":"object","properties":{"model":{"default":"openai/text-embedding-3-small","description":"Embedding model to use","example":"google/gemini-embedding-2","type":"string"},"input":{"anyOf":[{"type":"string"},{"maxItems":32,"type":"array","items":{"type":"string"}},{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"Image URL or base64 data URI","example":"https://example.com/image.jpg"}},"required":["url"]}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string","description":"Base64-encoded audio data. Max 180s."},"format":{"type":"string","description":"Audio format (e.g. mp3, wav)","example":"mp3"}},"required":["data","format"]}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"video_url"},"video_url":{"type":"object","properties":{"url":{"type":"string","description":"Video URL or base64 data URI. Supports mp4 and mpeg. Max 120s.","example":"https://example.com/video.mp4"},"mime_type":{"description":"Video MIME type (auto-detected if omitted). Supported: video/mp4, video/mpeg.","example":"video/mp4","type":"string"}},"required":["url"]}},"required":["type","video_url"]}]},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"image_url"},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"Image URL or base64 data URI","example":"https://example.com/image.jpg"}},"required":["url"]}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","const":"input_audio"},"input_audio":{"type":"object","properties":{"data":{"type":"string","description":"Base64-encoded audio data. Max 180s."},"format":{"type":"string","description":"Audio format (e.g. mp3, wav)","example":"mp3"}},"required":["data","format"]}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","const":"video_url"},"video_url":{"type":"object","properties":{"url":{"type":"string","description":"Video URL or base64 data URI. Supports mp4 and mpeg. Max 120s.","example":"https://example.com/video.mp4"},"mime_type":{"description":"Video MIME type (auto-detected if omitted). Supported: video/mp4, video/mpeg.","example":"video/mp4","type":"string"}},"required":["url"]}},"required":["type","video_url"]}]}}],"description":"Input text or content parts to embed. Supports strings, arrays of strings (max 32 inputs), or multimodal content parts (text, image_url, input_audio, video_url). Gemini supports every listed modality; Cohere Embed v4 supports text and one image per input.","example":"Hello world"},"dimensions":{"description":"Output embedding dimensions (128-4096). Model-specific limits apply; Cohere supports 256, 512, 1024, or 1536.","example":768,"type":"integer","minimum":128,"maximum":4096},"task_type":{"description":"Gemini text-specific task hint, converted to the model's recommended prompt instruction","example":"RETRIEVAL_QUERY","type":"string","enum":["SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","RETRIEVAL_DOCUMENT","RETRIEVAL_QUERY","CODE_RETRIEVAL_QUERY","QUESTION_ANSWERING","FACT_VERIFICATION"]},"input_type":{"description":"Cohere-specific input role for retrieval. Use document when indexing and query when searching.","example":"query","type":"string","enum":["query","document"]},"encoding_format":{"default":"float","description":"Output encoding for the embedding vector. `base64` packs Float32 little-endian like OpenAI.","example":"float","type":"string","enum":["float","base64"]}},"required":["input"]},"CreateImageResponse":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"b64_json":{"type":"string"},"media_type":{"description":"MIME type, included for URL responses and non-raster output","type":"string"},"revised_prompt":{"type":"string"}}}},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"total_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"input_tokens_details":{"type":"object","properties":{"text_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"image_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["text_tokens","image_tokens"]}},"required":["input_tokens","output_tokens","total_tokens","input_tokens_details"]}},"required":["created","data","usage"]},"CreateImageRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":32000,"description":"A text description of the desired image(s)"},"model":{"default":"black-forest-labs/flux.1-schnell","description":"The model to use for image generation","type":"string"},"n":{"default":1,"description":"Number of images to generate (currently max 1)","type":"integer","minimum":1,"maximum":1},"size":{"default":"1024x1024","description":"Image size as WIDTHxHEIGHT (e.g., 1024x1024, 512x512)","type":"string"},"quality":{"default":"medium","description":"Image quality. OpenAI 'standard'/'hd' mapped to Pollinations equivalents","type":"string","enum":["standard","hd","low","medium","high"]},"response_format":{"default":"b64_json","description":"Return format. \"url\" returns a stored media.pollinations.ai URL, \"b64_json\" returns base64-encoded image data","type":"string","enum":["url","b64_json"]},"user":{"description":"End-user identifier for abuse tracking","type":"string"},"image":{"description":"Reference image URL(s) for image-to-image generation (Pollinations extension)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"reference_images":{"not":{}},"reference_videos":{"not":{}},"reference_audios":{"not":{}},"resolution":{"description":"Output resolution for resolution-priced image and video models (Pollinations extension)","type":"string","enum":["1k","2k","360p","480p","720p","768p","1080p","4k"]},"safe":{"description":"Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.","type":["string","boolean"]}},"required":["prompt"],"additionalProperties":{}}}},"tags":[{"name":"Quick Start","description":"### Text (Python, OpenAI SDK)\n\n```python\nfrom openai import OpenAI\nclient = OpenAI(base_url=\"https://gen.pollinations.ai/v1\", api_key=\"YOUR_API_KEY\")\nresponse = client.chat.completions.create(model=\"openai/gpt-5.4-nano\", messages=[{\"role\": \"user\", \"content\": \"Hello!\"}])\nprint(response.choices[0].message.content)\n```\n\n### Image (URL — no code needed)\n\n```plaintext\nhttps://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux\n```\n\n### Audio (cURL)\n\n```bash\ncurl \"https://gen.pollinations.ai/audio/Hello%20world?voice=nova\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o speech.mp3\n```\n\n### 3D (cURL)\n\n```bash\ncurl \"https://gen.pollinations.ai/3d/no_prompt_for_trellis_needed?image=https://inferenceport.ai/img/trellis.jpg&model=microsoft%2Ftrellis-2&resolution=low\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" -o model.glb\n```\n\n### Embeddings (OpenAI-compatible)\n\n```bash\ncurl https://gen.pollinations.ai/v1/embeddings \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"openai/text-embedding-3-small\",\"input\":\"Hello world\",\"dimensions\":512}'\n```\n\nSee `GET /v1/models` for every text, image, audio, video, and embedding model available."},{"name":"Authentication","description":"All generation requests require an API key from [enter.pollinations.ai](https://enter.pollinations.ai/keys). Model listing endpoints work without authentication.\n\n| Type | Prefix | Use case | Rate limits | Description |\n|------|--------|----------|-------------|-------------|\n| Secret | `sk_` | Server-side apps | None | Personal developer key. Never expose in client-side code. |\n| App Key (Connect User Wallets) | `pk_` with redirect URIs | Client apps via OAuth / device flow | None on the App Key itself | Publishable App Key used as the OAuth `client_id`. Users authorize; your app receives a scoped `sk_`. |\n| Raw publishable | `pk_` with no app binding | Legacy direct spend | 1 pollen / IP / hour | Retained for existing integrations. Do not mint new ones. |\n\n> **Note:** Raw publishable keys (`pk_` used as a generation key in browsers) are **legacy**, not beta. New frontend and mobile apps should use **Connect User Wallets**, also called BYOP (Bring Your Own Pollen): register an App Key at [enter.pollinations.ai/keys](https://enter.pollinations.ai/keys), then run the OAuth authorization-code flow with PKCE (or the device flow) to obtain a temporary user-authorized secret key (`sk_`). The legacy fragment redirect and device flow remain supported.\n\nTwo ways to authenticate generation requests:\n\n- Header: `Authorization: Bearer YOUR_API_KEY`\n- Query param: `?key=YOUR_API_KEY`\n\nFor detailed integration guidance on user-pays authorization, including OAuth discovery and token exchange, see [Connect User Wallets](https://github.com/pollinations/pollinations/blob/main/BRING_YOUR_OWN_POLLEN.md)."},{"name":"Connect User Wallets","description":"Connect User Wallets—also called BYOP (Bring Your Own Pollen)—lets your users authorize your app to spend their own Pollen on Pollinations requests. Your publishable App Key (`pk_...`) identifies the app; after approval, Pollinations returns a scoped user key (`sk_...`) for API calls.\n\nUsers stay in control of their balance, budgets, and revocation; your app never has to pay for their usage.\n\n## 🗝️ App Key\n\nAn **App Key** (`pk_...`) is the publishable key your app sends users to Pollinations with. Without one, the consent screen falls back to the redirect hostname and traffic isn't attributed to your account.\n\nTo create one, go to [enter.pollinations.ai](https://enter.pollinations.ai/keys) → **Create New App Key**:\n\n<p align=\"left\"><img src=\"https://media.pollinations.ai/28716f8fb8677eff\" alt=\"Edit App Key\" width=\"420\"></p>\n\nSet the **Name** (shows on the consent screen). For web apps, add at least one **Redirect URI** (your exact callback URL). The key you get back is your `client_id` (a `pk_...` publishable key; the legacy name `app_key` is still accepted).\n\nWhen a user lands on the consent screen signed-out, they're prompted to continue with GitHub:\n\n<p align=\"left\"><img src=\"https://media.pollinations.ai/f9fd70e72156ddec\" alt=\"Authorize — signed out\" width=\"420\"></p>\n\nOnce signed in, they review the requested access and confirm:\n\n<p align=\"left\"><img src=\"https://media.pollinations.ai/2ab9b5e0a2408e93\" alt=\"Authorize — signed in\" width=\"420\"></p>\n\n## Developer Earnings\n\nDeveloper earnings are opt-in per App Key. When enabled, users pay 25% over base rates. The markup credits to your balance.\n\n```text\nBase request cost: 1.00 pollen\nUser pays:         1.25 pollen\nYou receive:       0.25 pollen\n```\n\nCredits land in the same balance type the user paid from: Quest Pollen when the request used Quest Pollen, Paid Pollen when it used Paid Pollen.\n\nPass `earningsEnabled: true` when creating an App Key via the API, or toggle it later from the dashboard:\n\n```bash\ncurl -X POST https://gen.pollinations.ai/account/keys \\\n  -H 'Authorization: Bearer sk_yoursecretkey' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"name\":\"my-app\",\"type\":\"publishable\",\"redirectUris\":[\"https://myapp.com/callback\"],\"earningsEnabled\":true}'\n```\n\n## ⚙️ Web Apps (OAuth Code Flow)\n\nUse the OAuth authorization-code flow with PKCE for new web integrations. It keeps the `sk_...` key out of the browser callback URL and works with standard OAuth clients.\n\nDiscovery is available at:\n\n```text\nhttps://enter.pollinations.ai/.well-known/oauth-authorization-server\n```\n\n### 1. Build the Auth Link\n\nGenerate a fresh PKCE verifier and S256 challenge, then send the user to `/authorize`:\n\n```text\nhttps://enter.pollinations.ai/authorize\n  ?response_type=code\n  &client_id=pk_yourkey\n  &redirect_uri=https://myapp.com/callback\n  &scope=profile%20usage\n  &state=random-csrf-token\n  &code_challenge=BASE64URL_SHA256_VERIFIER\n  &code_challenge_method=S256\n```\n\nWith restrictions:\n```text\nhttps://enter.pollinations.ai/authorize?response_type=code&redirect_uri=https://myapp.com/callback&client_id=pk_yourkey&scope=usage&models=black-forest-labs/flux.1-schnell,openai/gpt-5.4-nano&expiry=7&budget=10&state=random&code_challenge=...&code_challenge_method=S256\n```\n\n| Param | What it does | Example |\n|-------|-------------|---------|\n| `client_id` | Your publishable key — shows app name + author on consent screen, tracks traffic and developer earnings | `pk_abc123` |\n| `redirect_uri` | Where users return after authorizing — must exactly match a Redirect URI on the App Key, query string included (loopback `http://localhost` matches any port) | `https://myapp.com/callback` |\n| `response_type` | Use `code` for the OAuth authorization-code flow | `code` |\n| `state` | Opaque value echoed back on the callback for CSRF protection | `any-random-string` |\n| `code_challenge` | Base64url SHA-256 of your PKCE verifier | `abc...` |\n| `code_challenge_method` | Must be `S256` | `S256` |\n| `scope` | Account access (space or comma separated) | `usage keys` |\n| `models` | Restrict to specific models | `black-forest-labs/flux.1-schnell,openai/gpt-5.4-nano,openai/gpt-image-1-mini` |\n| `budget` | Numeric Pollen cap. Defaults to `5`; users can clear the budget field on the consent screen for unlimited. | `10` |\n| `expiry` | User-authorized key lifetime in days (default: 7) | `7` |\n\nLegacy names `app_key`, `redirect_url`, and `permissions` are still accepted for backwards compatibility.\n\n### 2. Handle the Redirect\n\nUser comes back with a short-lived code:\n\n```text\nhttps://myapp.com/callback?code=oauth_code&state=random-csrf-token\n```\n\nValidate `state`, then exchange the code at the token endpoint. Server-backed apps\ncall it from their backend; static browser apps can call it directly, because PKCE\nreplaces the client secret:\n\n```bash\ncurl -X POST https://enter.pollinations.ai/api/oauth/token \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'grant_type=authorization_code' \\\n  -d 'code=oauth_code' \\\n  -d 'client_id=pk_yourkey' \\\n  -d 'redirect_uri=https://myapp.com/callback' \\\n  -d 'code_verifier=YOUR_PKCE_VERIFIER'\n# → { \"access_token\": \"sk_...\", \"token_type\": \"bearer\", \"expires_in\": 604800, \"scope\": \"profile usage\" }\n```\n\nThe authorization code is single-use and expires after 10 minutes. Token responses use RFC 6749 error objects such as `invalid_grant`, `invalid_request`, and `unsupported_grant_type`.\n\nScopes: `profile` (name + email), `usage` (account balance + usage), `keys` (account admin — create/list/revoke keys). The response's `scope` echoes what the user actually granted, which may be narrower than requested. Generation needs no scope — spending is bounded by the budget and expiry the user approved. There are no refresh tokens; re-run the flow when the key expires. Issued keys appear in the user's dashboard like any other API key and can be edited or revoked there at any time — revocation is immediate.\n\n**Browser-only apps.** The same request works from `fetch`:\n\n```javascript\nconst res = await fetch('https://enter.pollinations.ai/api/oauth/token', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n  body: new URLSearchParams({\n    grant_type: 'authorization_code',\n    code,                                        // From the callback URL\n    client_id: 'pk_yourkey',\n    redirect_uri: 'https://myapp.com/callback',  // Exact registered URI\n    code_verifier,                               // The verifier you saved\n  }),\n});\nconst { access_token } = await res.json();\n```\n\nKeep the token in memory, or `sessionStorage` if a callback page must hand it back within the same tab. Never put it in `localStorage`, a URL, analytics, or logs.\n\n### 3. Call Pollinations\n\nUse the returned `access_token` as the API key:\n\n```javascript\nfetch('https://gen.pollinations.ai/v1/chat/completions', {\n  method: 'POST',\n  headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' },\n  body: JSON.stringify({ model: 'openai/gpt-5.4-nano', messages: [{ role: 'user', content: 'yo' }] })\n});\n```\n\nExamples: [browser-only](https://github.com/pollinations/pollinations/tree/main/apps/oauth-client-demo) ·\n[existing user database](https://github.com/pollinations/pollinations/tree/main/apps/oauth-account-linking-demo)\n\n## ⚙️ Legacy Web Apps (Fragment Flow)\n\nThe older BYOP redirect flow is still supported. It returns the user-authorized key directly in the URL fragment and does not use PKCE.\n\n```text\nhttps://enter.pollinations.ai/authorize?redirect_uri=https://myapp.com/callback&client_id=pk_yourkey&scope=usage\n```\n\nUser comes back with the key in the URL fragment:\n\n```text\nhttps://myapp.com/callback#api_key=sk_abc123xyz\n```\n\nFragment, not query param — never hits server logs. 🔒 If you passed `state`, it's echoed back: `#api_key=sk_...&state=...`. On denial the fragment is `#error=access_denied&state=...`.\n\n### Code\n\n```javascript\n// Send user to auth\nconst params = new URLSearchParams({\n  redirect_uri: location.href,\n  client_id: 'pk_yourkey',\n});\nwindow.location.href = `https://enter.pollinations.ai/authorize?${params}`;\n\n// Grab key from URL after redirect\nconst apiKey = new URLSearchParams(location.hash.slice(1)).get('api_key');\n\n// Use their pollen\nfetch('https://gen.pollinations.ai/v1/chat/completions', {\n  method: 'POST',\n  headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' },\n  body: JSON.stringify({ model: 'openai/gpt-5.4-nano', messages: [{ role: 'user', content: 'yo' }] })\n});\n```\n\n## 🖥️ CLIs & Headless Apps (Device Flow)\n\nSame authorize screen, but the user opens a browser separately. Your CLI polls for the key.\n\nUse this for CLIs, bots, extensions, and other apps that cannot show the authorization page themselves.\n\n```bash\n# 1. request a device code (pass your app_key as client_id for attribution)\ncurl -X POST https://enter.pollinations.ai/api/device/code \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"client_id\": \"pk_yourkey\"}'\n# → { \"device_code\": \"...\", \"user_code\": \"ABCD-1234\",\n#     \"verification_uri\": \"https://enter.pollinations.ai/device\",\n#     \"verification_uri_complete\": \"https://enter.pollinations.ai/device?user_code=ABCD-1234\",\n#     \"expires_in\": 1800, \"interval\": 5 }\n\n# 2. give the user verification_uri_complete to open directly,\n#    or show verification_uri and user_code\n\n# 3. poll for the key (every 5s)\ncurl -X POST https://enter.pollinations.ai/api/device/token \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"device_code\": \"...\"}'\n# pending → { \"error\": \"authorization_pending\" }\n# done    → { \"access_token\": \"sk_...\", \"token_type\": \"bearer\" }\n```\n\nThe same device-code exchange is also available through the standard token endpoint:\n\n```bash\ncurl -X POST https://enter.pollinations.ai/api/oauth/token \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'grant_type=urn:ietf:params:oauth:grant-type:device_code' \\\n  -d 'device_code=...'\n```\n\n## 👤 Who's Using This Key?\n\nOnce you have the user-authorized `sk_...` key, you can check who it belongs to:\n\n```bash\ncurl https://enter.pollinations.ai/api/device/userinfo \\\n  -H 'Authorization: Bearer sk_...'\n# → { \"sub\": \"user-id\", \"preferred_username\": \"voodoohop\", \"picture\": \"...\" }\n# with the `profile` scope, also: \"name\": \"Thomas\", \"email\": \"...\"\n```\n\n`/api/oauth/userinfo` returns the same standard OIDC userinfo shape. `name` and `email` are included only when the key carries the `profile` scope.\n\n---\n\n🕐 User-authorized keys default to 7 days. Users can revoke anytime from the dashboard.\n\n[edit this doc](https://github.com/pollinations/pollinations/edit/main/BRING_YOUR_OWN_POLLEN.md) · *h/t [Puter.js](https://docs.puter.com/user-pays-model/) for the idea*"},{"name":"Publish a Model","description":"Publishing a model lets you connect an endpoint to Pollinations and call it through `gen.pollinations.ai` under an `community/owner/model` id. Pollinations handles authentication, Pollen billing, model discovery, and routing; the model continues to run on infrastructure you control.\n\nModel publishing and [connecting user wallets](./BRING_YOUR_OWN_POLLEN.md) solve different problems. Model publishing supplies a model to the Pollinations catalog. The wallet flow lets users authorize an app to spend their own Pollen. An app can use either or both.\n\n## Supported Models\n\n| Model family | Required upstream endpoint | Pollinations endpoint |\n|---|---|---|\n| Text: Chat Completions | One exact Chat Completions endpoint URL | `POST /v1/chat/completions` |\n| Text: Responses | One exact Responses endpoint URL | `POST /v1/responses` and `POST /v1/chat/completions` |\n| Image | `POST /v1/images/generations` | `GET /image/{prompt}` or `POST /v1/images/generations` |\n| Image editing | `POST /v1/images/edits` in addition to image generation | `POST /v1/images/edits` |\n| Video | Exact endpoint URL entered at registration | `GET /video/{prompt}`, `GET /image/{prompt}`, or `POST /v1/images/generations` |\n| Speech to text | `POST /v1/audio/transcriptions` | `POST /v1/audio/transcriptions` |\n| Text to speech | `POST /v1/audio/speech` | `POST /v1/audio/speech` |\n| Embeddings | `POST /v1/embeddings` | `POST /v1/embeddings` |\n\nImage providers must return `b64_json`. During testing, Pollinations checks whether an image provider supports edits and whether it reports OpenAI image-token usage.\n\nVideo generation is synchronous. Pollinations calls the exact URL entered at registration. `duration` is optional; when omitted, your endpoint chooses its default:\n\n```json\n{\n  \"prompt\": \"A green sprout moving in the breeze\",\n  \"duration\": 4,\n  \"image\": [\"https://example.com/start.jpg\", \"https://example.com/end.jpg\"],\n  \"reference_images\": [\"https://example.com/style.jpg\"],\n  \"reference_videos\": [\"https://example.com/motion.mp4\"],\n  \"reference_audios\": [\"https://example.com/audio.mp3\"]\n}\n```\n\nOnly supplied fields are included. In `image`, the first URL is the start frame and the second is the end frame. The `reference_*` arrays are general guidance rather than frame controls. Publishers select the accepted image, video, and audio input types when registering the model; unsupported combinations should return an error.\n\nReturn one completed MP4 within 300 seconds as `b64_json` or a public `url`, with the generated duration in seconds in `usage.duration`:\n\n```json\n{\n  \"data\": [\n    {\n      \"url\": \"https://video-provider.example/output/clip.mp4\"\n    }\n  ],\n  \"usage\": { \"duration\": 4 }\n}\n```\n\nPollinations sends no upstream model id. Billing uses `usage.duration` when reported, otherwise the requested duration. Report a positive number of generated seconds to support requests without a duration. Invalid reported usage, or no duration from either source, fails the request. Inline and downloaded responses are limited to 20 MB. Do not return an async job id; polling must finish inside the publisher endpoint before it responds.\n\nText-to-speech is synchronous and OpenAI-shaped. Pollinations calls your `/v1/audio/speech` with `{ model, input, voice, response_format }` and streams the returned binary audio back to the caller with its content type preserved. Registration sends a short sample and accepts any non-empty `audio/*` response. Billing charges the input text by character against your per-1M completion-audio price. Voice cloning, speech-to-speech, and timestamps are out of scope.\n\nRealtime and 3D endpoints cannot currently be registered through this workflow.\n\n## Private and Public Models\n\nAny signed-in user can register and call a private model. Private models are owner-only, do not appear in the public catalog, and are free at the Pollinations layer.\n\nPublishing a model requires account-level community publisher access while community model publishing is in alpha. Submit a [publisher access request](https://github.com/pollinations/pollinations/issues/new?template=community-model-allowlist.yml); the request enables public publishing for the account but does not register a model for you.\n\nPublic models appear in the model catalog and can be called by other Pollinations users. Owners set public pricing:\n\n- Text models use the token categories reported by the upstream endpoint.\n- Image models use per-token pricing when the registration test finds valid OpenAI image usage; otherwise they use a fixed price per generated image.\n- Video models are priced from reported generated seconds, falling back to the requested duration when usage is missing.\n- Transcription models are priced from reported audio duration.\n- Embedding models use the prompt-token count reported by the upstream endpoint.\n- A zero price makes the public model free.\n\nOwners receive 75% of the Pollen spent on their models. Paid and Quest Pollen earnings remain in their respective wallet buckets. Cash payouts are not currently available.\n\n## Register in the Dashboard\n\n1. Open [My Models](https://enter.pollinations.ai/my-models).\n2. Choose **Add model**.\n3. For text, choose **Chat Completions** or **Responses** and enter that API's exact endpoint URL, model id, and bearer token. Other model families use a base URL; video uses an exact generation URL.\n4. Run the endpoint test before publishing. Model discovery is optional; Responses endpoints do not need `/models` or a Chat Completions endpoint.\n5. Save the model as private, then call its `community/owner/model` id through the normal Pollinations endpoint.\n6. If your account has publisher access, change visibility to public and set prices when it is ready for other users.\n\n### Model names\n\nChoose a short, stable slug for the model ID (`owner/slug`) and a clear title for the catalog. Keep details that may change, such as price, hosting provider, routing, or context size, out of the slug. Use the description to identify the upstream model or explain what a router or rebranded model does. For example, use `owner/llama-3.1-8b` with the title `Llama 3.1 8B` and the description `Direct proxy to Meta Llama 3.1 8B via Groq`, or `owner/fast-router` with the title `Fast Chat Router` and the description `Routes between Llama and Mistral based on latency`.\n\nThe upstream credential is used by Pollinations to proxy requests to your endpoint. Do not place it in a model name, description, public URL, or example.\n\n## Register with the CLI\n\nThe CLI manages text, image, video, transcription, and embedding model registrations. Sign in, test the endpoint, then create the model:\n\n```bash\nnpx @pollinations/cli auth login\n\nnpx @pollinations/cli my-models test \\\n  --modality image \\\n  --base-url https://api.example.com/v1 \\\n  --bearer-token \"$UPSTREAM_API_KEY\" \\\n  --model image-v1\n\nnpx @pollinations/cli my-models create \\\n  --name my-image \\\n  --title \"My Image\" \\\n  --modality image \\\n  --image-pricing request \\\n  --completion-image-price 0.01 \\\n  --input-modalities text,image \\\n  --base-url https://api.example.com/v1 \\\n  --bearer-token \"$UPSTREAM_API_KEY\" \\\n  --upstream-model image-v1\n```\n\nUse `polli my-models list`, `update`, and `delete` for the rest of the lifecycle. API keys used for model management require the `account:keys` permission.\n\nText models use `--api responses --url https://api.example.com/v1/responses` or `--api chat_completions --url https://api.example.com/v1/chat/completions` instead of `--base-url`. Supply both flags when changing an existing text target. The selected URL is used exactly, including query parameters. The text endpoint test checks JSON and streaming responses for valid usage.\n\nEmbedding models use `--modality embedding`. For example, `--prompt-text-price 0.000001` charges 1 Pollen per 1M input tokens.\n\n## Publishing Controls\n\nPublic models support these owner controls in the dashboard or Account API:\n\n- `paidOnly` restricts calls to Paid Pollen.\n- `perUserRpm` limits each Pollinations user; `null` removes the limit.\n- Text models can declare `advertised.contextLength` and the `tool_calling` or `reasoning` capabilities.\n- The provider profile at `POST /account/my-models/provider` sets the public provider name and service URL shared by your models.\n- Owners can make a model private without deleting it. Its prices and fallbacks are saved for later publication.\n\nToken prices cannot exceed 50 Pollen per 1M tokens. Fixed image prices cannot exceed 0.25 Pollen per image, video prices cannot exceed 0.5 Pollen per generated second, and transcription prices cannot exceed 0.012 Pollen per minute. See the [Community Models API reference](https://gen.pollinations.ai/docs#tag/community-models) for the exact fields.\n\n## Call Your Model\n\nUse the generated `community/owner/model` id anywhere the corresponding Pollinations endpoint accepts a model:\n\n```bash\ncurl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"community/owner/my-model\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n  }'\n```\n\nAuthenticated model-list requests include your own private models. Public discovery endpoints accept `community=true` to return only community models.\n\nEach text registration declares one upstream API with `{ \"api\": \"responses\" | \"chat_completions\", \"url\": \"https://…\" }`. A Responses model advertises both `/v1/responses` and `/v1/chat/completions` in `supported_endpoints`. Responses calls go to the registered URL; Chat Completions calls use that same upstream through Pollinations' stateless adapter. A Chat Completions registration advertises only Chat Completions. Both paths require valid terminal usage for billing; missing or malformed usage fails the request and produces no charge for that model request.\n\nEndpoint agents also select one upstream API and exact URL. Managed prompt agents use Pollinations' Responses runtime and have no publisher-configured endpoint URL. Both kinds of agent use the outer request ID to group child model and tool calls: the outer wrapper is free, and each completed child operation is billed once even if a later step fails.\n\n## Fallbacks and Health\n\nPublic and private community models can nominate up to three compatible community fallbacks. Fallbacks are tried in order and must use the same model family. They must not cost more than the primary model; image fallbacks must also match its pricing mode and support image input when the primary model does. A fallback cannot require Paid Pollen unless the primary model does too.\n\nPublic model lists show community proxies with more than 80% success across their last 50 eligible final requests within seven days. Fallback rescues, owner requests, and monitor probes count. Final 4xx are excluded. There is no minimum sample size, and models without recent data remain listed. Private models remain visible to their owners.\n\nModels filtered for reliability still work by exact ID and can serve as fallbacks. Use `?reliability=all` on a model-list endpoint to include them. Private models remain owner-only; this option does not bypass access controls.\n\nThe monitor helps diagnose issues and selectively probes text/image models, normally no more than once every four hours with longer gaps after repeated failures. It no longer hides or relists models. Listing visibility updates automatically as new requests change the sample. View time-windowed diagnostics at [model-monitor.pollinations.ai](https://model-monitor.pollinations.ai).\n\n## Trust Boundary\n\nCommunity models run on the owner's infrastructure, not Pollinations infrastructure. Prompts, input media, and other request content are sent to that upstream provider. Do not send credentials or sensitive information to a community model unless you trust its owner and data handling.\n\nFor complete `/account/my-models` request and response schemas, use the [Community Models API reference](https://gen.pollinations.ai/docs#tag/community-models)."},{"name":"Community Models","description":"Register, test, update, and remove community models owned by the authenticated account."},{"name":"Publish an Agent","description":"Publishing an agent creates a reusable text model that Pollinations runs for you. A prompt agent combines instructions, a base model, and optional MCP tools. A code agent deploys one self-contained `agent.ts` file from a public GitHub repository.\n\nThis is different from hosting your own OpenAI-compatible model endpoint. It is also different from [connecting user wallets](./BRING_YOUR_OWN_POLLEN.md), which lets an app ask its users to pay for their own generations.\n\n## Create an agent in the dashboard\n\n1. Open [My Models](https://enter.pollinations.ai/my-models).\n2. Add an agent and choose **Prompt agent** or **Code agent**.\n3. Configure a prompt and base model, or enter a public GitHub repository.\n4. Save it. The dashboard creates the agent configuration and registers its callable model name.\n\nA linked GitHub username is required to create an agent. Private agents are visible and callable only by their owner. Public listings require [community publisher access](https://github.com/pollinations/pollinations/issues/new?template=community-model-allowlist.yml).\n\n## Prompt agent configuration\n\nAn agent combines catalog fields with its runtime configuration:\n\n| Field | Required | Description |\n| --- | --- | --- |\n| `name` | Yes | Callable model name used in `<github-username>/<name>`. |\n| `title` | Yes | Display title shown in the model catalog. |\n| `description` | No | Catalog description. |\n| `visibility` | No | `private` by default, or `public` with publisher access. |\n| `systemPrompt` | Yes | Instructions for the agent, from 1 to 8,000 characters. |\n| `baseModel` | Yes | A text model ID from [`GET /v1/models`](https://gen.pollinations.ai/v1/models). |\n| `mcpServers` | No | Any of `pollinations`, `ffmpeg`, `exa`, `composio`, `computer`. Details: [`GET /mcp`](https://gen.pollinations.ai/mcp). |\n\nExample `agent.json`:\n\n```json\n{\n  \"systemPrompt\": \"You are a concise research assistant. Cite the sources you use.\",\n  \"baseModel\": \"openai\",\n  \"mcpServers\": [\"pollinations\"]\n}\n```\n\nUpdates replace the runtime configuration, so include `systemPrompt` and `baseModel`; include `mcpServers` if tools should remain enabled. You can also change the name, title, description, or visibility.\n\nThe `composio` server uses each caller's connections from **Account → MCP Connectors**. Public agents never receive or use the agent owner's app credentials.\n\n### Tips\n\n- `computer` gives each caller a private, persistent filesystem under `/workspace`. `/tmp` is emptied after every call, so keep memory files under `/workspace`.\n- `computer` has one `bash` tool. Write literal commands, put file content in the tool's `stdin` field, and end each appended line with a newline. There is no nested `bash -c`.\n- `computer` can also clone and push [collective memory](https://github.com/pollinations/collective-memory), a public repository shared by all agents. Give your agent a reason to leave something there for others to find: a game move, a post, an answer.\n- Gen caches responses to identical requests. When testing memory or game state, change the wording of each test message.\n\n## Code agent configuration\n\nA code agent uses a public GitHub repository as its source of truth. Put one self-contained `agent.ts` at the repository root. Pollinations removes TypeScript syntax when deploying it; type errors do not block deployment, and plain JavaScript is valid in the same file. The repository name becomes the model ID and title, and its description becomes the catalog description. Repository visibility and agent visibility are independent: a private agent is owner-only even though its source repository is public.\n\nThe runtime bundles the actual Vercel AI SDK: `ai` version `7.0.66` and `@ai-sdk/openai-compatible` version `3.0.30`. Import their standard exports directly; repository `package.json` files and arbitrary npm dependencies are not installed.\n\n```ts\nimport { stepCountIs } from \"ai\";\n\nexport default async function ({ model, respond, mcp }) {\n    return respond({\n        model: model(\"openai-fast\"),\n        instructions: \"Answer the user, using tools when needed.\",\n        tools: await mcp.tools(\"pollinations\"),\n        stopWhen: stepCountIs(4),\n    });\n}\n```\n\n`model(id)` creates an SDK language model already connected to Pollinations; select IDs from [the model catalog](https://gen.pollinations.ai/v1/models). `respond(config)` runs the SDK tool loop and returns Responses JSON or SSE, including tool results and usage. It accepts SDK agent settings such as `instructions`, `tools`, and `stopWhen`, defaults to eight steps, and does not retry model requests. `mcp.tools(server)` provides executable SDK tools, limited to sixteen calls per request.\n\nThe callback also receives `request`, `pollinations(path, init)`, `mcp.listTools(server)`, and `mcp(server, tool, arguments)` for direct request and tool handling. It must return a `Response`; ordinary Worker APIs, including timers and streams, remain available. Platform model and MCP helpers use the caller's Pollen and permissions without exposing a reusable API key. `respond` does not emit the Vercel UI protocol or introduce a separate endpoint.\n\nExample `code-agent.json`:\n\n```json\n{\n  \"type\": \"code_agent\",\n  \"repository\": \"https://github.com/your-name/your-agent\"\n}\n```\n\nCreate it with `npx @pollinations/cli agents create --config code-agent.json`. Add `--visibility public` to publish after your account has community publisher access. The API stores the GitHub-derived listing fields, repository, and deployed commit SHA—not the source code. The repository binding and model ID are fixed after creation; syncing refreshes the code, title, and description.\n\nTo deploy the newest default-branch revision after a push, add this step to a GitHub Action (replace `AGENT_ID`):\n\n```yaml\n- run: curl --fail --retry 2 --retry-delay 30 -X POST https://gen.pollinations.ai/account/agents/AGENT_ID/sync\n```\n\nThe sync route needs no secret and cannot change which repository is deployed. It redeploys the current commit with the latest bundled runtime even when the source is unchanged, and is limited to once every 30 seconds.\n\n## Code agent examples\n\nFork an example, then enter **your fork's URL** when creating a code agent in the dashboard. Each example is a separate repository with `agent.ts` at its root:\n\n- [MCP tool loop](https://github.com/pollinations/pollinations-code-agent-example) — a model that can call Pollinations MCP tools using the AI SDK.\n- [Model router](https://github.com/pollinations/pollinations-router-agent) — selects a model for each request and forwards the conversation unchanged.\n- [Streaming timer](https://github.com/pollinations/pollinations-timer-agent) — streams a countdown without calling an AI model.\n\n[Browse the example repositories](https://github.com/orgs/pollinations/repositories?q=topic%3Apollinations-code-agent-example).\n\nEdit `agent.ts` in your fork to customize it. For automatic sync after a push, enable GitHub Actions and set the repository variable `POLLINATIONS_SYNC_URL` to `https://gen.pollinations.ai/account/agents/YOUR_AGENT_ID/sync` (use `https://staging.gen.pollinations.ai` for staging). Without the variable, the example workflows skip deployment.\n\n## Create with the CLI\n\nCreate a prompt agent and its callable model listing in one command:\n\n```bash\nnpx @pollinations/cli agents create \\\n  --config agent.json \\\n  --name research-assistant \\\n  --title \"Research Assistant\"\n```\n\nThe callable model ID is `<your-github-username>/research-assistant`. Code agents derive their name, title, and description from GitHub; these cannot be overridden through either management API. An empty `description` is accepted and ignored. Add `--visibility public` to publish after your account has community publisher access. Managed agents are always text-only and free: they cannot set prices, fallbacks, or a per-user request limit.\n\n## Call an agent\n\nOnce registered, call the agent exactly like any other text model:\n\n```bash\ncurl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"your-github-username/research-assistant\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Summarize this topic.\"}]\n  }'\n```\n\nManaged agents also expose the stateless Responses API:\n\n```bash\ncurl https://gen.pollinations.ai/v1/responses \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"your-github-username/research-assistant\",\n    \"input\": \"Summarize this topic.\",\n    \"store\": false\n  }'\n```\n\nResponses requests run the same configured prompt and MCP tools as Chat Completions. They do not store response state, and caller-supplied tools are not added to a managed agent. Streaming emits Responses API events, a terminal response event containing usage, and one `data: [DONE]` marker.\n\nThe agent listing itself has no owner-set price. The caller still pays for the selected base model and MCP usage at the rates shown in the catalog. The catalog presents the base model's pricing and capabilities, plus the capabilities enabled by the agent's tools.\n\n## Manage the lifecycle\n\n```bash\nnpx @pollinations/cli agents list\nnpx @pollinations/cli agents get <agent-id>\nnpx @pollinations/cli agents update <agent-id> --config agent.json\nnpx @pollinations/cli agents sync <agent-id>\nnpx @pollinations/cli agents delete <agent-id>\n```\n\nDeleting an agent also deletes its model listing. Prompt-agent updates can change its runtime configuration and listing. Code-agent updates can change visibility and safety policy; `sync` deploys new code and refreshes GitHub metadata.\n\nThe Account API exposes the same operations under `/account/agents`. API keys need the `account:keys` permission. See the [Community Agents API reference](https://gen.pollinations.ai/docs#tag/community-agents) for request and response schemas."},{"name":"Community Agents","description":"Create, inspect, update, and remove managed agents owned by the authenticated account."},{"name":"CLI","description":"The Pollinations CLI — for humans, AI agents, and everything in between.\n\nGenerate text, images, audio, video from the terminal. Backed by the [Pollinations API](https://gen.pollinations.ai).\n\n## First result\n\n```bash\nnpm install -g @pollinations/cli\npolli auth login\npolli gen text \"Say hello in one sentence\" --model openai/gpt-5.4-nano\n```\n\nDevice login opens a browser for approval. The last command prints a short, low-cost result in your terminal. To try an image next, run `polli gen image \"a cat in space\" --output cat.png` and check that `cat.png` was saved.\n\n<video src=\"https://github.com/user-attachments/assets/c3ff5c45-672c-4c45-9027-7743d32f9785\" controls muted loop playsinline width=\"720\">\n  <a href=\"https://github.com/user-attachments/assets/c3ff5c45-672c-4c45-9027-7743d32f9785\">▶️ Watch the demo</a>\n</video>\n\n## For AI agents\n\nPoint your coding agent (Claude Code, Cursor, Windsurf, Codex) at the skill file and it gets the full usage map — flags, stdin conventions, `--json` output shape, error codes, the lot:\n\n> Read https://raw.githubusercontent.com/pollinations/pollinations/main/packages/polli-cli/SKILL.md and follow the instructions to generate media with the `polli` CLI.\n\nThe skill also ships inside the package: `node_modules/@pollinations/cli/SKILL.md`.\n\nEvery command is agent-friendly:\n\n- `--json` — structured stdout, human messages to stderr. Safe to parse.\n- Exit code `0` on success, non-zero on error.\n- A 402 error links to your balance, Quests, and top-up options.\n- `polli auth status --json` (or `polli whoami --json`) exposes everything about the current session.\n\n## Other ways to start\n\n```bash\nprintf '%s' \"$POLLINATIONS_API_KEY\" | polli auth login --with-token\n```\n\nCredentials land at `~/.pollinations/credentials.json`. For one-off runs pass `--key sk_...`. Get keys at [enter.pollinations.ai](https://enter.pollinations.ai/keys).\n\nSet `POLLINATIONS_ENV=staging` to use the staging API, with a separate login stored in `~/.pollinations/credentials.staging.json`. `polli upload` has no staging.\n\n```bash\npolli update    # npm install -g @pollinations/cli@latest, if installed globally\n```\n\nFor npx or a local/project install, `update` prints instructions instead of creating a second global install.\n\nInteractive commands show an occasional update notice without waiting for the network. Set `NO_UPDATE_NOTIFIER=1` to disable it. Notices are skipped for scripts, pipes, and `--json`; updates are never installed automatically. Updating leaves credentials and harness settings untouched.\n\n## Generate\n\n```bash\npolli gen text \"Explain quantum tunneling in one sentence\"\npolli gen text \"Summarize this\" < notes.md          # stdin becomes context\necho \"context\" | polli gen text \"question\"\n\npolli gen image \"cyberpunk city at night\" --model flux --output city.png\npolli gen image \"enhance this\" --image https://media.pollinations.ai/abc --model gptimage\n\npolli gen audio \"Hello world\" --voice nova --output speech.mp3\npolli gen audio \"read it to me\" --play                # plays back after saving (blocks until done)\npolli gen audio \"Hello world\" --timestamps            # also saves speech.mp3.json with character timings\npolli gen video \"a waterfall in slow motion\" --duration 5 --output clip.mp4\npolli gen 3d \"a red fox\" --output fox.glb\npolli gen 3d --image https://media.pollinations.ai/abc --resolution high\npolli gen embeddings \"first text\" \"second text\"        # one vector per line\npolli gen voice-change talk.mp3 --voice nova\npolli gen isolate interview.mp4                        # strip music/noise, keep speech\npolli gen transcribe speech.mp3\n\npolli gen chat --model openai                         # interactive multi-turn\n```\n\n`gen text` streams by default. File-output commands pick a sensible default path if `--output` is omitted.\n\n## Discover\n\n```bash\npolli models                 # all models\npolli models --type image    # filter (text, image, audio, video, 3d, embedding)\npolli models --stats         # health + perf (last 60m)\npolli docs                   # full API reference in the terminal\npolli docs /image            # one endpoint\npolli docs --open            # open in browser\npolli quests                 # public quest catalog\npolli quests --claimed       # already-completed and earned quest status\n```\n\n## Account\n\nTwo kinds of keys:\n\n- **Secret (`sk_`)** — backend use, full access. Default.\n- **Publishable (`pk_`)** — safe to ship in frontend code.\n\n```bash\npolli keys list\npolli keys create --name mybot --budget 100                    # secret (default)\npolli keys create --name myapp --type publishable              # API publishable\npolli keys create --name myapp --type publishable \\            # 3rd-party app key\n  --redirect-uri https://myapp.com/callback --earnings\npolli keys revoke <id>\n```\n\nKeys can't be edited — to change a name, budget, or model list, revoke and recreate. Publishable app keys default developer earnings off; pass `--earnings` to enable them.\n\n```bash\npolli usage                  # pollen balance\npolli usage --history        # recent requests\npolli usage --daily          # daily spend\npolli usage --daily --key polli-harness-claude --days 1   # what one harness key cost in the last day\npolli earnings               # developer earnings (default 30 days, --days <n>)\npolli quests --claimable     # only rewards ready to claim\npolli agents list            # managed prompt agents\npolli my-models list         # invite-only community text, image, and transcription models\n```\n\nManage agents with API-shaped JSON config files:\n\n```bash\npolli agents get <id>\npolli agents create --config agent.json --name my-agent --title \"My Agent\"\npolli agents create --config code-agent.json\npolli agents update <id> --config agent.json\npolli agents delete <id>\n```\n\n`agent.json` contains the complete configuration:\n\n```json\n{\n  \"systemPrompt\": \"You are a concise research assistant.\",\n  \"baseModel\": \"openai\",\n  \"mcpServers\": [\"pollinations\"]\n}\n```\n\nCreating an agent also creates its callable model listing. See [Publish an Agent](https://github.com/pollinations/pollinations/blob/main/BUILD_YOUR_OWN_AGENT.md) for visibility, billing, and lifecycle details.\n\n`polli auth login` creates a key with all account permissions Polli needs: `profile`, `usage`, `keys`, and `machines`. Use `account:usage` for narrow read-only account state like usage and quests. Use `account:keys` to manage keys and, where invite-only My Models access is enabled, my-models. Quest claiming remains in the dashboard.\n\n## Coding harnesses\n\nPoint an agentic coding tool at Pollinations. `on` logs in if needed, mints a\nkey for the harness, backs up its config, and writes the provider; `off`\nrestores the backup.\n\nThe default is `openai/gpt-6-sol`; pass `--model <id>` to choose another model.\nBloom is key-only and keeps its own model selection.\n\n```bash\npolli harness --help              # supported harnesses\npolli harness bloom on            # creates a dedicated key for Bloom CLI\npolli harness dsh on              # DeepSeek Harness → Pollinations\npolli harness dsh on --model moonshotai/kimi-k2.6\npolli harness dsh on --no-mcp     # skip MCP tool configuration\npolli harness hermes on           # adds the Pollinations provider + Polli skill to Hermes Agent\npolli harness hermes on --model deepseek/deepseek-v4-flash\npolli harness opencode on         # enables the Pollinations OpenCode plugin + default model\npolli harness openclaw on         # adds the Pollinations provider + Polli skill to OpenClaw\npolli harness pi on               # native provider, key, startup model, and Polli skill\npolli harness prime on            # native Prime Agent provider support\npolli harness tgpt on             # authenticated Pollinations text models in tgpt\npolli harness <harness> status\npolli harness <harness> off\n```\n\nBloom stores its dedicated key in `$BLOOM_HOME/.env` (default `~/.bloom/.env`).\ntgpt stores its provider, dedicated key, and model in `~/.config/tgpt/config.conf`.\nThe DSH adapter configures the Pollinations provider, hosted Pollinations MCP,\nand Polli CLI skill globally under `$DSH_HOME` (default `~/.dsh`). Hermes Agent\nstores its provider and skill under `$HERMES_HOME` (default `~/.hermes`, or\n`%LOCALAPPDATA%\\hermes` on Windows) and discovers the live Pollinations models;\ninstall its hosted MCP servers with `polli mcp install hermes --all`. OpenCode uses\nits official plugin; OpenClaw uses `openclaw.json`, while Pi and Prime Agent use\ntheir native `models.json` provider support.\nPi 0.99+ also supports `polli mcp install pi --all` for native hosted MCP\nservers. Run `/reload` in Pi afterward; remove them with `polli mcp remove pi`.\nModel setup remains compatible with older Pi versions.\n\nSee [Coding Harnesses](https://github.com/pollinations/pollinations/blob/main/CODING_HARNESSES.md) for what each profile changes and how to add one.\n\n## Sandboxes\n\nLinux VMs from E2B, paid from your wallet (alpha).\n\n```bash\npolli sandbox create              # prints the id and sets up ssh\nssh <id>.polli                    # scp and rsync work too\npolli sandbox timeout <id> 14400  # keep it running 4 hours without ssh\npolli sandbox kill <id>\n```\n\nThe default template comes logged in with the coding harnesses installed; the first interactive `ssh` connects them. See [Sandboxes](https://gen.pollinations.ai/docs#tag/sandboxes) for cost, limits, and using E2B's own CLI and SDKs.\n\n## Links\n\n- [gen.pollinations.ai](https://gen.pollinations.ai) — API\n- [enter.pollinations.ai](https://enter.pollinations.ai) — dashboard, keys, billing\n- [API docs](https://gen.pollinations.ai/docs)\n- [Source](https://github.com/pollinations/pollinations/tree/main/packages/polli-cli)\n- [Discord](https://discord.gg/pollinations-ai-885844321461485618)\n\n## License\n\nMIT"},{"name":"Coding Harnesses","description":"Use `polli harness` to connect a supported coding harness to Pollinations. It handles Polli login, a dedicated API key, model setup, and any Pollinations capabilities supported by that harness.\n\n> **Available now:** Bloom CLI, Claude Code, Codex (through Codex Router), DeepSeek Harness, Hermes Agent, OpenCode, OpenClaw, Pi, Prime Agent, and tgpt are integrated `polli harness` profiles.\n\n## Use a harness\n\nEvery integrated harness follows the same lifecycle:\n\n```bash\npolli harness --help\npolli harness <harness> on\npolli harness <harness> status\npolli harness <harness> off\n```\n\n- `on` first checks that the harness can be launched, then connects it to Pollinations.\n- `status` shows whether the harness is ready to use Pollinations.\n- `off` removes only the Pollinations setup and preserves unrelated configuration.\n\nIf a harness cannot be launched, `on` stops before login, key creation, or configuration and shows its official installation command. If Polli is not installed yet, run the first setup through `npx @pollinations/cli@latest`. Login uses the browser device flow by default. Each harness receives its own API key instead of reusing the account key stored by `polli auth login`.\n\n## Update a harness\n\nPolli configures harnesses; it does not update their installations. Use the harness's updater (or the package manager you installed it with), then rerun `polli harness <harness> on` to refresh the model catalog and configuration.\n\n```bash\nnpm install -g @pollinations/cli@latest\nuv tool upgrade bloom-cli\nclaude update\n# Codex Router: rerun its official installer/update flow\nnpx @deepseek-ai/dsh@latest web\nhermes update\nopencode upgrade\nopenclaw update\npi update self\nprime-agent update\n```\n\nCurrent OpenClaw requires Node `>=24.16.0 <25` or `>=26.1.0`; Pi requires Node `>=22.19.0`. Upgrade Node before updating either harness if needed. Bloom requires Python 3.12 or newer. Stop a running DSH server before launching its replacement, and back up saved sessions before a major harness upgrade.\n\n## Harnesses\n\nPolli defaults to `openai/gpt-6-sol` unless you pass `--model <id>`. Bloom is key-only: Polli does not change Bloom's model selection.\n\n| Harness | Status | What is unique |\n| --- | --- | --- |\n| [Bloom CLI](https://github.com/Ilm-Alan/bloom-cli) | **Available now** — `polli harness bloom on` | Creates a dedicated key for Bloom's existing Pollinations integration. |\n| [Claude Code](https://claude.com/claude-code) | **Available now** — `polli harness claude-code on` | Writes a separate settings file for gen's Anthropic Messages API, leaving the native Claude login and settings alone; runs Claude Code itself for a `pong` smoke and verifies dedicated-key usage. |\n| [Codex](https://github.com/openai/codex) + [Codex Router](https://github.com/duolahypercho/codex-router) | **Available now** — `polli harness codex on` | Uses Codex Router's generic-provider/curation path, protected credential storage and compatibility probe; native Codex ChatGPT login is left untouched. |\n| [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) | **Available now** — `polli harness dsh on` | Adds the Pollinations provider, hosted Pollinations MCP, and Polli skill. Uses `openai/gpt-6-sol` by default. Its official launch uses `npx`, so no separate global DSH installation is required. |\n| [Hermes Agent](https://github.com/NousResearch/hermes-agent) | **Available now** — `polli harness hermes on` | Adds the Pollinations provider, a dedicated key, and the Polli skill, discovering models from the live catalog. Install the hosted MCP servers with `polli mcp install hermes`. Defaults to `openai/gpt-6-sol`. |\n| [OpenCode](https://opencode.ai) | **Available now** — `polli harness opencode on` | Uses the existing [Pollinations OpenCode plugin](https://github.com/fkom13/opencode-pollinations-plugin) for models, media tools, usage, and quests. Defaults to `openai/gpt-6-sol`. |\n| [OpenClaw](https://github.com/openclaw/openclaw) | **Available now** — `polli harness openclaw on` | Adds the Pollinations provider, a dedicated key, and the Polli skill, pulling models from the live catalog. Defaults to `openai/gpt-6-sol`. |\n| [Pi](https://github.com/earendil-works/pi) | **Available now** — `polli harness pi on` | Uses Pi's native provider support and the Polli skill. Add hosted MCP servers with `polli mcp install pi --all` (Pi 0.99+). Defaults to `openai/gpt-6-sol`. |\n| [Prime Agent](https://github.com/PrimeIntellect-ai/prime-agent) | **Available now** — `polli harness prime on` | Uses native provider support and the Polli skill while preserving memories, sessions, and unrelated configuration. |\n| [tgpt](https://github.com/aandrew-me/tgpt) | **Available now** — `polli harness tgpt on` | Configures tgpt's existing Pollinations provider with a dedicated key and authenticated text model. |\n\n## Bloom CLI\n\n```bash\nuv tool install --python 3.12 bloom-cli\npolli harness bloom on\nbloom\n```\n\nBloom already uses Pollinations for its models. `on` creates a dedicated key and stores it in `~/.bloom/.env` (or `$BLOOM_HOME/.env`); `off` restores the previous file or removes only that key if the file changed later.\n\n## Claude Code\n\n```bash\npolli harness claude-code on\nclaude --settings ~/.pollinations/claude-code.json\npolli harness claude-code status\npolli harness claude-code off\n```\n\nClaude Code talks to gen's Anthropic Messages API (`/v1/messages`) directly. `on` writes `~/.pollinations/claude-code.json`, a Claude Code settings file whose `env` sets `ANTHROPIC_BASE_URL`, the dedicated key as `ANTHROPIC_AUTH_TOKEN`, and the model as `ANTHROPIC_MODEL` and every model alias (`haiku`, `sonnet`, `opus`, `fable`), so background requests and subagents also use Pollinations. Claude Code reads the file only when launched with `--settings`; plain `claude` keeps your native login and `~/.claude` settings.\n\nChoose another model with `--model <id>`. Before `on` succeeds, Polli runs `claude -p --settings ~/.pollinations/claude-code.json` with a one-word `pong` prompt and confirms activity for the dedicated key; if that fails, the previous file is restored. `off` deletes only that file.\n\ngen does not serve `/v1/messages/count_tokens`, so `/context` shows estimated counts. Claude Code warns that a Pollinations model id is not in its catalog and compacts at 200K tokens.\n\n## Codex through Codex Router\n\n```bash\n# Install/update Codex Router using its official installer:\n# https://github.com/duolahypercho/codex-router#install-everything-recommended\npolli harness codex on\npolli harness codex status\npolli harness codex off\n```\n\n`on` requires Codex and Codex Router `>=0.6.0`. Polli drives Codex Router's generic-provider, protected-credential, model-curation, and compatibility-test paths rather than pointing Codex directly at Pollinations. It creates an owned `pollinations` provider, stores the dedicated child key in the router's protected credential store, and curates the selected live Pollinations model. Native Codex ChatGPT login and unrelated Codex/router configuration are preserved.\n\nChoose the routed model with `--model <id>`. Before setup succeeds, Codex Router runs its compatibility smoke and Polli verifies dedicated-key activity. `status` reports client/router/provider/key/model readiness. `off` removes only Polli-owned provider, credential, and routed model state; it never removes Codex Router itself. Foreign provider state is never overwritten.\n\n## tgpt\n\n```bash\nbrew install tgpt # or use another official installation method\npolli harness tgpt on\ntgpt \"Hello\"\n```\n\ntgpt already includes a Pollinations provider. `on` selects it for text generation and writes a dedicated key and model to `~/.config/tgpt/config.conf`, making tgpt use the authenticated `gen.pollinations.ai` endpoint. Choose another model with `--model <id>`; `off` restores the previous file or removes only the Pollinations values if the file changed later.\n\nThe default model is `openai/gpt-6-sol`. Polli clears any generic `AI_API_KEY` from this file so it cannot override the dedicated `POLLINATIONS_API_KEY`; the original file is backed up. Exported environment variables, a local `config.conf`, or `--config` can override this user-level setup. `off` does not revoke the account key.\n\n## DeepSeek Harness\n\n```bash\nnpx @pollinations/cli@latest harness dsh on\npolli harness dsh status\npolli harness dsh off\n```\n\nDeepSeek Harness is officially run with `npx @deepseek-ai/dsh@latest web`. The explicit `@latest` selects the current release rather than a local installation. `on` verifies that `npx` is available before changing configuration. Choose another default model with `--model <id>`. Add `--no-mcp` if you do not want the hosted Pollinations media tools.\n\n## Hermes Agent\n\n```bash\nnpx @pollinations/cli@latest harness hermes on\npolli harness hermes status\npolli harness hermes off\n```\n\n`on` requires Hermes Agent to be installed with its official installer (`curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash` on Linux/macOS/WSL, or `iex (irm https://hermes-agent.nousresearch.com/install.ps1)` on native Windows). It registers a `pollinations` provider in `$HERMES_HOME/config.yaml` (`~/.hermes/config.yaml`, or `%LOCALAPPDATA%\\hermes\\config.yaml` on native Windows), stores a dedicated key in `$HERMES_HOME/.env` as `POLLI_HERMES_API_KEY`, and installs the Polli skill under `skills/polli/`. Hermes discovers the current Pollinations models from the provider endpoint rather than a bundled list, so there is no second model catalog to keep in sync. Choose the default with `--model <id>` and switch later with `hermes model`. To add the hosted Pollinations MCP servers, run `polli mcp install hermes --all` (or pick server ids from `polli mcp list`). `off` restores the previous files byte-for-byte, or (if you edited them) removes only the Pollinations provider, key, and skill, leaving your other providers, fallbacks, memories, and skills untouched.\n\n## OpenCode\n\n```bash\nnpx @pollinations/cli@latest harness opencode on\npolli harness opencode status\npolli harness opencode off\n```\n\n`on` requires OpenCode to be installed (`curl -fsSL https://opencode.ai/install | bash`, `npm i -g opencode-ai`, or your package manager). It enables the existing [Pollinations OpenCode plugin](https://github.com/fkom13/opencode-pollinations-plugin) in `~/.config/opencode/opencode.json` (or `$OPENCODE_CONFIG` / `$OPENCODE_CONFIG_DIR`), stores a dedicated Pollinations API key in the plugin's own `config.json` (so no second login inside OpenCode is needed), and sets the default model to `pollinations/enter/openai/gpt-6-sol`. The plugin then serves the current Pollinations model catalog, media tools, usage, and `/poll quests` inside OpenCode. Choose another default with `--model <id>`; `off` removes only the plugin entry, the default model, and the stored key, leaving the rest of your OpenCode configuration untouched.\n\n## OpenClaw\n\n```bash\nnpx @pollinations/cli@latest harness openclaw on\npolli harness openclaw status\npolli harness openclaw off\n```\n\n`on` requires OpenClaw to be installed (`curl -fsSL https://openclaw.ai/install.sh | bash`, or `openclaw.ai/install`). For a fresh install, it first creates OpenClaw's baseline config and workspace. It then adds a `pollinations` provider under `models.providers` in `~/.openclaw/openclaw.json` (or `$OPENCLAW_CONFIG_PATH` / `$OPENCLAW_STATE_DIR` / `$OPENCLAW_HOME`), stores a dedicated Pollinations API key in `env.vars` and references it from the provider with OpenClaw's own `${VAR}` substitution, and sets the default model to `pollinations/openai/gpt-6-sol` in `agents.defaults.model.primary`. The model list is pulled live from the Pollinations catalog (`--model <id>` to choose a different default). The Polli skill is installed under `~/.openclaw/skills/polli/` so the agent can generate images, audio, and video. Choose another default with `--model <id>`; `off` restores the previous config byte-for-byte, or (if you edited it) removes only the Pollinations provider, the key, a `pollinations/*` default model, and the skill, leaving unrelated settings untouched.\n\n## Pi\n\n```bash\nnpx @pollinations/cli@latest harness pi on\npolli harness pi status\npolli harness pi off\n```\n\n`on` requires Pi to be installed with its official npm command: `npm install -g --ignore-scripts @earendil-works/pi-coding-agent`. It registers the current compatible Pollinations model catalog in `~/.pi/agent/models.json`, stores a dedicated key in `auth.json`, selects the startup model in `settings.json`, and installs the Polli skill under `skills/polli/`. Choose another default with `--model <id>`. This setup works with Pi 1.0 and older versions without separate configuration formats.\n\nPi 0.99+ includes native MCP. Run `polli mcp install pi --all` (or choose servers from `polli mcp list`) to configure the hosted servers in `~/.pi/agent/mcp.json`. Both commands honor `PI_CODING_AGENT_DIR`. Run `/reload` in Pi after installation. MCP setup checks the Pi version before creating a key; upgrade older installations with `npm install -g --ignore-scripts @earendil-works/pi-coding-agent@latest`. MCP has its own lifecycle: `polli mcp status pi` and `polli mcp remove pi`; `polli harness pi off` leaves it unchanged.\n\n## Prime Agent\n\n```bash\nnpx @pollinations/cli@latest harness prime on\npolli harness prime status\npolli harness prime off\n```\n\n`on` requires Prime Agent to be installed with its official installer. It registers the current compatible Pollinations model catalog in `~/.prime/agent/models.json`, stores a dedicated key in `auth.json`, selects the startup model in `settings.json`, and installs the Polli skill under `skills/polli/`. Choose another default with `--model <id>`."},{"name":"MCP Servers","description":"Use Pollinations-hosted MCP servers from any\n[Model Context Protocol](https://modelcontextprotocol.io) client that supports\nStreamable HTTP.\n\n### Quick start\n\nGet an API key from [enter.pollinations.ai](https://enter.pollinations.ai/keys),\nthen choose a server:\n\n| Server | Endpoint | Use it for | Details |\n| --- | --- | --- | --- |\n| Pollinations | `https://gen.pollinations.ai/mcp/pollinations` | Discover and use models, generate text and media, create embeddings and 3D models, and inspect model status and account balance | [README](https://github.com/pollinations/pollinations/blob/main/packages/mcp/README.md) |\n| Ask Jev | `https://gen.pollinations.ai/mcp/ask-jev` | Evaluate state with typed choice, score, and probability questions | [Source](https://github.com/pollinations/pollinations/tree/main/apps/ask-jev-mcp) |\n| FFmpeg | `https://gen.pollinations.ai/mcp/ffmpeg` | Trim, convert, resize, compress, and remix audio and video | [Source](https://github.com/pollinations/pollinations/tree/main/apps/ffmpeg-mcp) |\n| Exa Search | `https://gen.pollinations.ai/mcp/exa` | Search the live web and fetch clean page content | [Source](https://github.com/pollinations/pollinations/tree/main/apps/exa-mcp) |\n| Connectors | `https://gen.pollinations.ai/mcp/composio` | Read Gmail, search GitHub, update Sheets, and post to Slack through Composio | [Source](https://github.com/pollinations/pollinations/tree/main/apps/composio-mcp) |\n| Computer | `https://gen.pollinations.ai/mcp/computer` | Keep files and run bash in a private computer that persists between runs | [Source](https://github.com/pollinations/pollinations/tree/main/apps/computer-mcp) |\n\nSend the key with every request:\n\n```http\nAuthorization: Bearer YOUR_KEY\n```\n\nGet current endpoints and pricing from the live catalog:\n\n```bash\ncurl https://gen.pollinations.ai/mcp\n```\n\n### Install into coding agents with the Polli CLI\n\nThe [Polli CLI](https://www.npmjs.com/package/@pollinations/cli) wires the\ncatalog into coding agents and IDEs for you. It fetches the live server list,\nmints a dedicated API key per client, and merges the entries into the client's\nconfig without touching your other MCP servers:\n\n```bash\nnpx @pollinations/cli mcp list                  # live server catalog\nnpx @pollinations/cli mcp install cursor --all  # every server into Cursor\nnpx @pollinations/cli mcp install claude-code pollinations ffmpeg\nnpx @pollinations/cli mcp status                # what each client has\nnpx @pollinations/cli mcp remove cursor ffmpeg  # remove selected entries\nnpx @pollinations/cli mcp remove cursor         # remove all Pollinations entries\n```\n\nSupported clients: Claude Code, Codex CLI, VS Code, Cursor, OpenCode, Gemini\nCLI, GitHub Copilot CLI, Windsurf, Cline, Amp, Kiro, Zed, Warp, Hermes Agent,\nand Pi (0.99+).\n\nKeys are stored locally in plaintext in client configs and reused on reinstall.\nCodex instead references `POLLI_MCP_CODEX_API_KEY` in `~/.codex/.env`.\nFiles written by Polli use owner-only permissions on Unix. Do not share or commit\nconfigs containing keys. Removal only deletes Pollinations entries; other servers\nare left untouched.\n\n### Use with hosted agents\n\nAdd MCP servers to an agent in\n[My Models](https://enter.pollinations.ai/my-models).\n\n### Connect a client\n\nThe official TypeScript client handles initialization and tool discovery:\n\n```ts\nimport {\n  Client,\n  StreamableHTTPClientTransport,\n} from \"@modelcontextprotocol/client\";\n\nconst client = new Client({ name: \"my-app\", version: \"1.0.0\" });\nconst transport = new StreamableHTTPClientTransport(\n  new URL(\"https://gen.pollinations.ai/mcp/pollinations\"),\n  {\n    requestInit: {\n      headers: {\n        Authorization: `Bearer ${process.env.POLLINATIONS_API_KEY}`,\n      },\n    },\n  },\n);\n\nawait client.connect(transport);\nconst { tools } = await client.listTools();\n```\n\nOther clients use the same endpoint and bearer header; only their configuration\nformat differs.\n\n#### Claude Code\n\n```bash\nclaude mcp add --transport http pollinations \\\n  https://gen.pollinations.ai/mcp/pollinations \\\n  --header \"Authorization: Bearer YOUR_KEY\"\n```\n\nRun `/mcp` in Claude Code to verify the connection. Replace the name and URL\nwith another endpoint from the table to use FFmpeg or Exa Search.\n\n### Pollinations MCP\n\nThe Pollinations server exposes the main Pollinations API as agent-friendly\ntools. Agents can discover live models, delegate text requests, generate and\nedit media, create embeddings and 3D assets, transcribe audio, and inspect\nmodel health, usage, earnings, quests, and API keys.\n\n| Tool | Purpose |\n| --- | --- |\n| `listModels` | Search and list live models, aliases, capabilities, voices, endpoints, and pricing; narrow with `query`, `capabilities`, `agent`, `community`, `limit` |\n| `getModelStatus` | Inspect recent requests, errors, and latency for a model |\n| `generateText` | Generate text, use search-capable models, process multimodal input, or call a listed agent |\n| `generateImage` | Generate or edit images |\n| `generateVideo` | Generate video |\n| `generateAudio` | Generate speech, music, or sound |\n| `transcribeAudio` | Transcribe audio from a public HTTPS URL |\n| `generate3D` | Generate a GLB 3D model |\n| `createEmbeddings` | Create text or multimodal embeddings |\n| `getBalance` | Check the remaining Pollen balance; requires `account:usage` permission |\n| `getUsage` | List recent requests or a daily usage summary; requires `account:usage` permission |\n| `getEarnings` | Show developer earnings from BYOP apps and community models; requires `account:usage` permission |\n| `listQuests` | List quests with reward and claim state; requires `account:usage` permission |\n| `listKeys` | List API keys; requires `account:keys` permission |\n| `createKey` | Create a secret or publishable app key; requires `account:keys` permission |\n| `revokeKey` | Revoke an API key by id; requires `account:keys` permission |\n\nUse `listModels` before choosing a model or voice. The registry is live, so\nclients should not rely on a hardcoded model list.\n\nGenerated media is uploaded unlisted to `media.pollinations.ai` and returned as\nan MCP resource link, so binary data does not consume model context. Anyone\nwith the link can access it, and it expires after 30 days.\n\n### Ask Jev MCP\n\n`jev_decide` accepts `state` and a map of `questions`, each using `choice`,\n`score`, or `noul` (probability). It returns typed answers with confidence or\nprobabilities. Include relevant facts in `state`; confidence can remain high\nwhen facts are missing. Calls use Jev's listed model rate with no additional\nMCP fee.\n\n### FFmpeg MCP\n\n`runFfmpeg` accepts public HTTPS media inputs and ordinary FFmpeg arguments. It\nsupports multiple inputs and returns the output as a hosted MCP resource link.\nPollinations saves sources as `input0`, `input1`, and so on. Reference those\nexact names in arguments—for example, `[\"-i\", \"input0\", \"-vf\",\n\"scale=1280:-2\"]`—and omit the `ffmpeg` executable, source URLs, and output\npath.\n\n### Exa Search MCP\n\n- `web_search_exa` searches the live web and returns relevant pages with\n  highlights.\n- `web_fetch_exa` reads one or more known URLs as clean text when the search\n  highlights are not enough.\n\n### Connectors MCP\n\nThe Connectors MCP uses Composio to discover and run tools in each user's own\naccounts. Enable it in your agent or connect the MCP endpoint, then ask for a\nspecific task, such as “Summarize my unread Gmail” or “Find open issues in my\nGitHub repository.”\n\nWhen an app is not connected, the agent can return a sign-in link. You can also\n[connect apps in your account](https://enter.pollinations.ai/account#connectors).\nSign-in links expire after 10 minutes; select Connect again for a fresh link.\nConnecting an app does not automatically enable it in an agent.\n\n### Computer MCP\n\nThe Computer server gives each account a private filesystem under `/workspace`\nand a bash shell. Files persist between requests and agent runs; nothing runs\nwhile idle. There is one tool, `bash`, with `command`, optional `stdin` (for\nexample file content for `cat > path`) and optional `cwd`, which defaults to `/workspace` and is created if\nmissing. The shell cannot run Node or Python; curl, coreutils,\n`grep`, `sed`, `awk`, `jq`, `xan`, `html-to-markdown`, `file`, `tar`, and `git` are available. A `/workspace/README.md` is created on first use and\ndescribes a simple memory layout (`memory/facts.md` plus a dated\n`memory/log/`). Keep one folder per project. Nothing is shared between accounts. Files come in with `curl` or `git clone` and go out with `assets publish <path>`, which copies a file to\n[media.pollinations.ai](https://media.pollinations.ai) and prints an unlisted URL that\nexpires after 30 days. Every call costs the same flat rate; see the catalog.\n\n#### Collective memory\n\n[Collective memory](https://github.com/pollinations/collective-memory) is a\npublic, permanent repository shared by all agents: clone it, read its README,\nleave something for the next agent and push (no token needed). Never write\nprivate data. [Browse it](https://memory.pollinations.ai).\n\n### Billing and permissions\n\nCalls use the same Pollen wallet as the Pollinations API. The catalog endpoint\nshows each server's current pricing. Pollinations generation tools use the\nselected model's listed rate.\n\nAn MCP server can only use models and account features allowed by the caller's\nkey and cannot spend beyond that key's budget. Configure both in\n[API key settings](https://enter.pollinations.ai/keys). See\n[Authentication](https://gen.pollinations.ai/docs#tag/authentication) for key\ntypes and security guidance."},{"name":"Sandboxes","description":"Linux VMs from [E2B](https://e2b.dev), paid from your Pollinations wallet (alpha).\n\n### Use a sandbox\n\n```bash\npolli sandbox create              # prints the id and sets up ssh\nssh <id>.polli                    # scp, sftp and rsync work too\npolli sandbox list\npolli sandbox timeout <id> 14400  # keep it running 4 hours without ssh\npolli sandbox kill <id>\n```\n\n- A sandbox pauses about 10 minutes after the last ssh session ends. Your files stay, and the next `ssh` resumes it.\n- To keep it running without ssh, pay for the time up front with `polli sandbox timeout <id> <seconds>`, up to 24 hours at a time. It also resumes a paused sandbox.\n- The first `ssh` allows only polli's key, `~/.pollinations/ssh/id_ed25519`. On other templates than the default, it first installs `sshd`, `rsync` and `websocat` (Debian-based templates only).\n- The default template, `pollinations` (2 vCPU, 2 GB), is E2B's `base` (Debian 12, Python 3.11) with Node.js 24, polli, and the coding harnesses polli connects: Claude Code, OpenCode, Pi, Hermes Agent and OpenClaw.\n- It comes logged in when the key that creates it has the `keys` permission, as polli's own key does. polli inside uses a key of the sandbox's own, `polli-sandbox-<id>`, created like any other key, with polli's usual permissions. Killing the sandbox leaves the key. Your first interactive `ssh` connects each harness to Pollinations with a key of its own, `polli-harness-<harness>`.\n- `polli sandbox create <template>` starts another E2B template instead, such as `claude` (Claude Code), `codex`, `opencode` or `amp` (2 vCPU, 2 GB each), or [any public one](https://docs.e2b.dev/use-cases/coding-agents). Bigger templates cost more per second.\n- `polli sandbox logs <id>` shows the sandbox's system log: when it started and paused, and each process run in it.\n- Needs Node.js 22 or newer.\n\n### Cost and limits\n\n- Billed at [E2B's per-second rates](https://e2b.dev/pricing) for the sandbox's CPU and memory, paid in advance: 10 minutes at creation, 10 minutes at a time while an ssh session is open, and the time you add with `polli sandbox timeout`.\n- Unused time is not refunded. Pausing a sandbox early, or shortening its timeout, gives up the rest of its paid time; resuming pays again. To stop paying, let the paid time run out or kill the sandbox.\n- A new sandbox needs enough balance, and enough key budget, for its first block; otherwise it is stopped with a 402.\n- At most 3 sandboxes run at once per account.\n\n### E2B SDKs\n\nE2B's SDKs, and its CLI run directly, work unchanged. Use a Pollinations key with the `machines` permission:\n\n```bash\nexport E2B_API_URL=https://gen.pollinations.ai/alpha/e2b\nexport E2B_API_KEY=sk_...\n```\n\nRun `polli sandbox ssh-config` once to ssh into the sandboxes they create. Auto-resume, snapshots, forks, IAM and volume mounts are not available."},{"name":"Errors","description":"All errors return JSON with a consistent shape:\n\n```json\n{\n  \"status\": 400,\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BAD_REQUEST\",\n    \"message\": \"Description of what went wrong\"\n  }\n}\n```\n\n| Status | Meaning |\n|--------|---------|\n| `400` | Invalid parameters or malformed request |\n| `401` | Missing or invalid API key |\n| `402` | Insufficient pollen balance |\n| `403` | API key lacks required permission |\n| `500` | Internal server error |\n\n### Timeouts and retries\n\nIf your client or proxy times out, send the exact same request again. Keep the endpoint, body, query parameters, and seed unchanged.\n\nThe generation continues after the connection closes. The retry waits for the generation already in progress or receives the completed cached result, instead of starting another generation. Only the generation is billed; retries and cache hits are not.\n\nThis applies to cache-backed, non-streaming text, embedding, image, video, 3D, audio, and transcription requests, including the OpenAI-compatible endpoints. Streaming text and uncached endpoints run independently."},{"name":"Safety","description":"Optional safety checking runs on text input before generation. Omitted, `false`, or `0` means off.\n\nFor community models, enabled checks run before text is sent to the provider or a configured fallback.\n\nModels may require specific checks. Required checks are listed as `required_safety` in the model catalog and cannot be disabled by callers.\n\nUse `safe` as a query parameter or JSON body field, or send the same value in the `Pollinations-Safe` header.\n\nValues: `privacy` redacts personal information like names, email, phone, address, IP, URLs, and usernames. `secrets` redacts keys and passwords. `sexual`, `violence`, and `shield` block matching requests. Aliases: `true` = `privacy,secrets`, `nsfw` = `sexual,violence`.\n\n```bash\ncurl \"https://gen.pollinations.ai/text/email%20me%20at%20a%40example.com?safe=privacy\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n\ncurl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Pollinations-Safe: privacy\" \\\n  -d '{\"model\":\"openai/gpt-5.4-nano\",\"messages\":[{\"role\":\"user\",\"content\":\"email me at a@example.com\"}]}'\n```\n\nLarge requests check the latest 50,000 text characters, across up to 25 text parts, in one safety call.\n\nBlocked requests return `400` with `error.code: \"content_blocked\"`; the message names the triggered categories. Safety service failures return `503`. Check `X-Safety-Applied`, `X-Safety-Redacted`, and `X-Safety-Status` headers."},{"name":"Text","description":"Generate text using OpenAI-compatible Chat Completions and stateless Responses APIs — use an OpenAI SDK by changing the base URL.\n\n| Endpoint | Best for |\n|----------|----------|\n| `POST /v1/chat/completions` | Full OpenAI compatibility — streaming, tools, vision, structured outputs |\n| `POST /v1/responses` | Stateless Responses input/output items, semantic streaming events, and function tools |\n| `POST /v1/messages` | Anthropic Messages API — Claude Code and the Anthropic SDKs |\n| `GET /text/{prompt}` | Quick prototyping — simple GET, returns plain text |\n\n**Available models:** openai/gpt-5.4-nano, openai/gpt-5-nano, openai/gpt-oss-20b, openai/gpt-4o-mini, openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.4-mini, openai/gpt-5.5, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-6-astra, openai/gpt-6-sol, openai/gpt-6.1-sol, openai/gpt-6-luna, inception/mercury-2, inception/mercury-2.5-preview, cohere/command-a-plus, qwen/qwen3-coder-30b-a3b-instruct, mistralai/mistral-small-3.2, mistralai/mistral-small-4, openai/gpt-audio-mini, openai/gpt-audio-1.5, google/gemini-3-flash-preview, google/gemini-3.7-flash, google/gemini-3.8-flash, google/gemini-3.5-flash-lite, google/gemini-2.5-flash-lite, deepseek/deepseek-v4-flash, deepseek/deepseek-v4.1-flash, deepseek/deepseek-v4-flash-vision-exp, google/gemma-4-26b-a4b-it, google/gemma-4-31b-it, deepseek/deepseek-v4-pro, x-ai/grok-4.20, x-ai/grok-4.3, x-ai/grok-4.6, x-ai/grok-4.7, google/gemini-2.5-flash-lite:search, respan/span-01-lite, typesafe/jev-1.13, jaredpalmer/kev-4b, liquid/d1, pollinations/midijourney, pollinations/midijourney-large, anthropic/claude-haiku-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-5, anthropic/claude-sonnet-5.5, anthropic/claude-opus-4.6, anthropic/claude-opus-4.7, anthropic/claude-opus-5, anthropic/claude-opus-5.5, anthropic/claude-fable-5, anthropic/claude-fable-5.1, perplexity/sonar, moonshotai/kimi-k2.6, moonshotai/kimi-k2.7-code, moonshotai/kimi-k3, poolside/laguna-s-2.1, tencent/hy4-preview, tencent/hy3, inclusionai/ling-3.1-flash, inclusionai/ling-3.0-flash-vl, meituan/longcat-2.0, thinkingmachines/inkling-small, thinkingmachines/inkling, nvidia/nemotron-3-ultra, nvidia/nemotron-3.5-lightning, xiaomi/mimo-v2.5, xiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.6-flash, xiaomi/mimo-v2.6-pro, google/gemini-3.1-pro-preview, amazon/nova-micro-v1, amazon/nova-2-lite-v1, z-ai/glm-5.2, z-ai/glm-5.3, z-ai/glm-5.3-flash, z-ai/glm-5.3-flashx, meta/llama-3.3-70b-instruct, meta/llama-4-maverick, meta/llama-4-scout, minimax/minimax-m2.7, minimax/minimax-m3, meta/muse-glimmer-30b, meta/muse-spark-1.2, mistralai/mistral-large-3, qwen/qwen3-coder-next, qwen/qwen3.7-plus, qwen/qwen3.7-max, qwen/qwen3.8-2.4t-a95b, qwen/qwen3.8-27b, qwen/qwen3.8-max, qwen/qwen3.8-max-0902, qwen/qwen3.8-flash, qwen/qwen3.7-flash, qwen/qwen3-vl-30b-a3b-instruct, qwen/qwen3-vl-235b-a22b-thinking, stepfun/step-3.7-flash, stepfun/step-3.5-flash, qwen/qwen3guard-gen-8b\n\n### Responses API\n\nUse `supported_endpoints` from [`GET /v1/models`](/v1/models) or [`GET /text/models`](/text/models) to find models that advertise `/v1/responses`. This includes configured built-in providers, community text models with an exact Responses URL, external endpoint agents with an exact Responses URL, and managed prompt agents.\n\n```bash\ncurl https://gen.pollinations.ai/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -d '{\n    \"model\": \"openai\",\n    \"input\": \"Explain why the sky is blue in two sentences.\",\n    \"store\": false\n  }'\n```\n\nThe endpoint is deliberately stateless. `store` must be `false`; `previous_response_id`, `conversation`, and `prompt` must be null or omitted; `background` must be false or omitted; and encrypted content or reusable item references are rejected. Streaming uses Responses event names and terminal usage events. Direct models preserve the provider's terminal marker; managed-agent streams add one `data: [DONE]` marker. For text models, missing or malformed usage on a completed or incomplete response fails the request. Failed responses may report null usage. These failed requests are not billed, but completed child model calls and charged MCP operations within an agent run remain billable; the outer agent request adds no charge.\n\nThe stateless surface follows the OpenAI Responses API and OpenResponses item/event vocabulary. It does not claim full OpenResponses conformance: persisted continuation, conversations, compaction, background jobs, Responses WebSocket transport, and normalization of every direct provider stream are outside this subset.\n\nCommunity text models and endpoint agents declare one upstream API and one exact URL. A Responses registration accepts both public APIs: Responses requests use the selected endpoint directly, while Chat Completions requests use the shared stateless adapter. A Chat Completions registration accepts Chat Completions only. Built-in models can have separate routes for the two public APIs; advertising Responses does not mean their Chat requests use the adapter.\n\nManaged prompt agents run configured MCP tools on the server. Send previous response items back to continue a conversation; completed tools are not run again.\n\nManaged prompt agents accept `reasoning.effort` (Responses) and `reasoning_effort` (Chat Completions). Reasoning summaries are not supported: a non-null `reasoning.summary` returns HTTP 400.\n\n### Anthropic Messages API\n\nModels that list `/v1/messages` in `supported_endpoints` — every text model that supports Chat Completions — also accept Anthropic Messages requests. Point Claude Code or an Anthropic SDK at `https://gen.pollinations.ai` and authenticate with a bearer token:\n\n```bash\nexport ANTHROPIC_BASE_URL=https://gen.pollinations.ai\nexport ANTHROPIC_AUTH_TOKEN=$POLLINATIONS_API_KEY\nexport ANTHROPIC_MODEL=openai\nclaude\n```\n\n```python\nimport os\n\nimport anthropic\n\nclient = anthropic.Anthropic(\n    base_url=\"https://gen.pollinations.ai\",\n    auth_token=os.environ[\"POLLINATIONS_API_KEY\"],\n)\nmessage = client.messages.create(\n    model=\"openai\",\n    max_tokens=1024,\n    messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n)\n```\n\n```typescript\nimport Anthropic from \"@anthropic-ai/sdk\";\n\nconst client = new Anthropic({\n    baseURL: \"https://gen.pollinations.ai\",\n    authToken: process.env.POLLINATIONS_API_KEY,\n});\nconst message = await client.messages.create({\n    model: \"openai\",\n    max_tokens: 1024,\n    messages: [{ role: \"user\", content: \"Hello\" }],\n});\n```\n\nRequests run as Chat Completions requests: balance checks, key permissions, rate limits, caching and billing are the same. Streaming, tools, images, system prompts and stop sequences depend on the selected model's capabilities; see [`/text/models`](/text/models). `cache_control` uses the same provider support as Chat Completions (see Prompt caching below); custom cache TTLs are not supported. `thinking` sets `reasoning_effort` (`output_config.effort` for adaptive thinking), and provider reasoning returns as `thinking` blocks. Usage reports `input_tokens`, `output_tokens`, `cache_read_input_tokens` and `cache_creation_input_tokens`; a response without provider usage fails, and a stream ends with an `error` event. Errors use Anthropic's error shape. `/v1/messages/count_tokens`, batches, files, server tools and `x-api-key` authentication are not supported.\n\nClaude Code sends `cache_control` automatically. Fireworks-hosted models that reject this field cannot currently be used with Claude Code; see [the compatibility issue](https://github.com/pollinations/pollinations/issues/15682).\n\n### Media models in conversations\n\nImage, video, audio and 3D models that advertise these endpoints in [`/models`](/models) accept a text prompt. Only the last user message is used; history, instructions and text-generation settings are ignored. Its text parts (or a string Responses `input`) form the prompt. Image parts (`image_url` in Chat, `input_image` in Responses, as URLs or data URIs) are the source images of image models and the start frame of video models that list `image` under `input_modalities`, exactly as `/v1/images/edits` does; other models, including 3D, return HTTP 400 for them, and any other attachment type returns HTTP 400. Use the native media endpoints for generation settings.\n\nText models with `video` under `input_modalities` (for example `inclusionai/ling-3.0-flash-vl`) accept `video_url` parts the same way they accept `image_url`: a public `https://` URL or a `data:video/...;base64,...` data URI (Gemini models also accept YouTube and `gs://` URLs). Video usage is metered from the provider's reported `video_tokens` detail and billed against the model's video prompt rate.\n\nEmpty prompts, malformed Unicode and prompts consisting only of `.` or `..` return HTTP 400. Reference-required models return their normal missing-input error.\n\nDialogue models expect one `<voice>: <text>` turn per line, just like `/audio`. Community speech models available only through `/v1/audio/speech` are not included.\n\n```bash\ncurl https://gen.pollinations.ai/v1/responses \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"flux\",\"input\":\"A lighthouse at dawn\"}'\n\ncurl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"flux\",\"messages\":[{\"role\":\"user\",\"content\":\"A lighthouse at dawn\"}]}'\n```\n\nBoth return assistant text: a Markdown image embed for images, or a Markdown link for audio, video and 3D, followed by the plain public file URL. The URL is also in the `Link` header. With `stream: true`, events arrive after generation finishes.\n\nMedia uses its normal billing units, not text tokens: Responses returns `usage: null`; Chat JSON omits `usage`. Chat streaming chunks contain `usage: null`, with no final usage chunk. Video uses the native model or provider's default duration.\n\n### Reasoning\n\nUse `reasoning_effort` to control reasoning on models that advertise reasoning support.\n\n```bash\n# POST /v1/chat/completions — OpenAI-compatible response\ncurl https://gen.pollinations.ai/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -d '{\n    \"model\": \"openai\",\n    \"reasoning_effort\": \"high\",\n    \"messages\": [\n      { \"role\": \"user\", \"content\": \"Prove that there are infinitely many prime numbers.\" }\n    ]\n  }'\n```\n\n```bash\n# POST /text — plain-text response\ncurl https://gen.pollinations.ai/text \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $POLLINATIONS_API_KEY\" \\\n  -d '{\n    \"model\": \"openai\",\n    \"reasoning_effort\": \"medium\",\n    \"messages\": [\n      { \"role\": \"user\", \"content\": \"Design a URL shortener. Outline the key tradeoffs.\" }\n    ]\n  }'\n```\n\n### Prompt caching\n\nOn Gemini, Claude, and Nova models, a large static prompt prefix can be cached so repeat requests bill it at a fraction of the input rate. Mark the end of the static prefix with `cache_control` on a content block (not on the message); everything before the marker must be byte-identical across requests, everything dynamic goes after. The first request creates the cache (`usage` reports `cache_creation_input_tokens`); repeat requests within the TTL report `prompt_tokens_details.cached_tokens` at the discounted rate.\n\n```json\n{\n  \"model\": \"google/gemini-2.5-flash-lite\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"<large static prompt>\",\n          \"cache_control\": { \"type\": \"ephemeral\" }\n        }\n      ]\n    },\n    { \"role\": \"user\", \"content\": \"<dynamic message>\" }\n  ]\n}\n```\n\n**Gemini** — the prefix must be at least ~2,048 tokens (~4,096 on Gemini 3 models). Requests with tools are not cached — including built-in tools, so `google/gemini-3.7-flash`, `google/gemini-3-flash-preview`, `google/gemini-3.1-pro-preview`, and the search variants only cache when tools are disabled (`\"tools\": []`) or a JSON `response_format` is set; `google/gemini-2.5-flash-lite` and `google/gemini-3.5-flash-lite` cache by default. Cache creates bill at the standard input rate plus a storage fee for the 1-hour TTL ($1 per 1M cached tokens on Flash models, $4.50 on Pro); hits bill at ~10% of input. The storage fee means caching pays off only when the prefix is reused often — roughly a dozen reuses per hour on the cheapest models.\n\n**Claude** — all Claude models cache. The prefix minimum varies by model: 512 tokens on `anthropic/claude-fable-5`, `anthropic/claude-fable-5.1`, and `anthropic/claude-opus-5`, and 1,024 on `anthropic/claude-sonnet-4.6`; other models have higher minimums. Tool definitions are cacheable. `anthropic/claude-fable-5.1` accepts only automatic or disabled tool choice; forcing any or a named tool returns a 400. Cache creates bill at 1.25× the input rate (no storage fee); hits bill at 10% of input, or 2.5% on `anthropic/claude-fable-5.1`. The cache lives ~5 minutes, refreshed on each hit.\n\n**Nova** — `nova` and `nova-fast` cache. The prefix must be at least ~1,000 tokens (up to 20K tokens cacheable). Cache creates are free; hits bill at 25% of input. ~5-minute TTL.\n\nModels that advertise `/v1/responses` also accept OpenAI's cache controls. Set `prompt_cache_options.mode` to `explicit` and place `prompt_cache_breakpoint: { \"mode\": \"explicit\" }` on the content block ending each stable prefix (up to four). Chat requests adapted to Responses preserve these markers; the existing `cache_control: { \"type\": \"ephemeral\" }` marker is translated to the same explicit breakpoint. Managed prompt agents apply an explicit request without caller markers to their configured static prompt.\n\n### Typed decisions (`typesafe/jev-1.13`)\n\n`typesafe/jev-1.13` (aliases `jev` and `typesafe/jev`) returns calibrated judgments instead of free text. Post `state` and a map of `questions` to `POST /alpha/decisions`; each question is a `choice`, `score`, or `noul`, and each is answered independently under the key you supplied. `model` defaults to `jev`.\n\n```json\n{\n  \"state\": \"My payouts have been failing for 3 days.\",\n  \"questions\": {\n    \"department\": {\n      \"type\": \"choice\",\n      \"instructions\": \"Which team should handle this?\",\n      \"criteria\": { \"billing\": \"Payment issues\", \"technical\": \"Product failures\" }\n    },\n    \"is_urgent\": { \"type\": \"noul\", \"instructions\": \"Does this convey urgency?\" }\n  }\n}\n```\n\nThe response carries `answers`, one field per question, each with `type` and its native fields (`choice` + `confidence` + `probabilities`, `score` + `legend` + `confidence` + `probabilities`, or `noul`), plus `usage` with `input_tokens` and `output_tokens`. See the [TypeSafe API reference](https://docs.typesafe.ai/api) for the native request and answer shapes.\n\n```json\n{\n  \"id\": \"dec-…\",\n  \"model\": \"typesafe/jev-1.13\",\n  \"provider\": \"TypeSafe\",\n  \"answers\": {\n    \"department\": {\n      \"type\": \"choice\",\n      \"choice\": \"billing\",\n      \"confidence\": 0.82,\n      \"probabilities\": { \"billing\": 0.91, \"technical\": 0.09 }\n    },\n    \"is_urgent\": { \"type\": \"noul\", \"noul\": 0.87 }\n  },\n  \"usage\": { \"input_tokens\": 312, \"output_tokens\": 48 }\n}\n```\n\n`state`, `instructions`, and criteria values accept a string or arbitrary JSON. There is no streaming; the answers arrive in one response.\n\nThe same model is also reachable from an OpenAI client on `/v1/chat/completions`: put the identical request JSON in the last `user` message as a string, and the answers come back as `message.content`. Earlier turns, system instructions, and text-generation settings are ignored. With `stream: true` the finished answers arrive as one content chunk followed by the usage chunk. Prefer `/alpha/decisions` where you can post the native shape.\n\nSupply relevant facts in `state`; Jev can be confident even when facts are missing. Interpret scores using `legend`, and handle counting, arithmetic, and date comparisons in code. Questions are evaluated independently.\n\nThe context limit is 64k tokens for `state` and all questions together, and 32k for `state` plus the longest question."},{"name":"Image","description":"Generate images from text prompts via a simple GET request. Returns JPEG, PNG, or SVG depending on the selected model.\n\n```\nhttps://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux\n```\n\n**Available models:** krea/krea-2-medium, lykon/dreamshaper-8-lcm, black-forest-labs/flux.1-kontext-pro, black-forest-labs/flux.1.1-pro, black-forest-labs/flux.2-pro, black-forest-labs/flux-3-image, black-forest-labs/flux.2-flex, black-forest-labs/flux.2-max, microsoft/mai-image-2.6-flash, microsoft/mai-image-2.6, google/gemini-2.5-flash-image, google/gemini-3.1-flash-image, google/gemini-3.1-flash-lite-image, google/gemini-3-pro-image, bytedance/seedream-5.0-lite, bytedance/seedream-5.0-flash, bytedance/seedream-5.0-pro, bytedance/seedream-4.0, bytedance/seedream-4.5, ideogram-ai/ideogram-v4-turbo, ideogram-ai/ideogram-v4-balanced, ideogram-ai/ideogram-v4-quality, openai/gpt-image-1-mini, openai/gpt-image-1.5, openai/gpt-image-2, openai/gpt-image-2.5-flare, openai/gpt-image-2.5-sunburst, black-forest-labs/flux.1-schnell, tongyi-mai/z-image-turbo, alibaba/wan-2.7-image, alibaba/wan-2.7-image-pro, qwen/qwen-image, qwen/qwen-image-2.1, qwen/qwen-image-3, x-ai/grok-imagine-image, x-ai/grok-imagine-image-quality, x-ai/grok-imagine-image-2.0, recraft/recraft-v4.1-vector, recraft/recraft-v4.1-flash, black-forest-labs/flux.2-klein-4b, prunaai/p-image, prunaai/p-image-edit, inferenceport-ai/lightning-image-turbo\n\n### Community image models\n\nCommunity image models use a `community/owner/model` id and support generation through `/image/{prompt}` and `/v1/images/generations`. The registration test adds image input and `/v1/images/edits` metadata when the registrant's edit endpoint succeeds. OpenAI-compatible responses default to `b64_json`; set `response_format: \"url\"` for a stored media URL. See `/image/models` for the live model list and supported endpoints."},{"name":"Video","description":"Generate videos from text prompts or reference images. Returns MP4.\n\n```\nhttps://gen.pollinations.ai/video/sunset%20timelapse?model=veo&duration=4\n```\n\n**Available models:** google/veo-3.1-fast, google/gemini-omni-1.1-flash, bytedance/seedance-1-pro-fast, bytedance/seedance-2.0, bytedance/seedance-2.0-mini, bytedance/seedance-2.0-fast, alibaba/wan-2.6, alibaba/wan-2.2-fast, alibaba/wan-2.7, alibaba/wan-3.0, x-ai/grok-imagine-video, x-ai/grok-imagine-video-1.5, bytedance/seedance-2.5, alibaba/happyhorse-1.1, heygen/heygen-video-1, minimax/minimax-h3, minimax/minimax-h3-max, minimax/minimax-h3-max-turbo, prunaai/p-video\n\n### Community video models\n\nCommunity video models use a `community/owner/model` id and work on `/video/{prompt}`, `/image/{prompt}`, and `/v1/images/generations`. See `/video/models` for the live catalog and [Publish a Model](https://github.com/pollinations/pollinations/blob/main/BRING_YOUR_OWN_MODEL.md) for the synchronous publisher contract."},{"name":"Realtime","description":"OpenAI-compatible Realtime WebSocket for voice, multimodal, and transcription sessions.\n\n| Endpoint | Description |\n|----------|-------------|\n| `GET /realtime` | Pollinations Realtime session (`model=openai/gpt-realtime-2.1`) |\n| `GET /v1/realtime` | WebSocket Realtime session (`model=openai/gpt-realtime-2.1`) |\n\nRequires an API key with positive balance. Server clients can use `Authorization: Bearer <key>`; browser WebSocket clients can use `?key=pk_...`.\n\nThe WebSocket settles one billing event when the session closes. Selecting `elevenlabs/scribe-v2-realtime` creates a transcription session automatically; other realtime models create voice and multimodal sessions.\n\nEvents sent and received over both routes use the OpenAI Realtime protocol. See OpenAI's [Realtime WebSocket events guide](https://developers.openai.com/api/docs/guides/realtime-websocket#sending-and-receiving-events).\n\n```js\nimport WebSocket from \"ws\";\n\n// Server: Bearer auth. Browser: append `&key=pk_...` instead (headers aren't settable).\nconst ws = new WebSocket(\n    \"wss://gen.pollinations.ai/v1/realtime?model=openai/gpt-realtime-2.1\",\n    { headers: { Authorization: `Bearer ${process.env.POLLINATIONS_API_KEY}` } },\n);\n\nws.on(\"open\", () => ws.send(JSON.stringify({\n    type: \"session.update\",\n    session: { type: \"realtime\", instructions: \"Be concise.\" },\n})));\nws.on(\"message\", (m) => console.log(JSON.parse(m.toString())));\n```\n\n**Browser audio:** play the model's audio through an `<audio>` element (e.g. a Web Audio `MediaStreamDestination` set as the element's `srcObject`), not straight to the Web Audio output. The browser only uses audio-element output as the echo-cancellation reference, so without it the mic re-captures the model's voice and it starts replying to itself. The WebRTC transport handles this automatically; on the WebSocket transport it's the client's responsibility.\n\n**Realtime models:** openai/gpt-realtime-2.1, openai/gpt-realtime-2.1-mini, elevenlabs/scribe-v2-realtime, openai/gpt-live-transcribe"},{"name":"3D","description":"Generate 3D models from text prompts and images via a simple GET request.\nReturns glTF Binary in GLB format by default. Depending on the model, certain\nmodels ignore text inputs — any text prompt passed to the Trellis 2/Asset Harvester family will\nbe ignored; only the image URL is used.\n\nhttps://gen.pollinations.ai/3d/no_prompt_for_trellis_needed?model=microsoft%2Ftrellis-2&resolution=low&key=YOUR_KEY_HERE&image=IMAGE_URL_HERE\n\n**Available models:** microsoft/trellis-2, nvidia/asset-harvester, hyper3d/rodin-2.5\n\n> **Note:** `hyper3d/rodin-2.5` and `nvidia/asset-harvester` require Paid Pollen. `microsoft/trellis-2` (the default)\n> supports `low`, `medium`, and `high` resolution and works with Quest Pollen.\n\n### NVIDIA Asset Harvester\n\n`nvidia/asset-harvester` generates 3D Gaussian Splat\nmodels in PLY format. Unlike other 3D models that return GLB, Asset Harvester\nreturns raw PLY binary suitable for real-time rendering in Gaussian Splat\nviewers (e.g. SuperSplat, Three.js with Gaussian PLY loader)."},{"name":"Audio","description":"Text-to-speech, music generation, and audio transcription.\n\n| Endpoint | Description |\n|----------|-------------|\n| `GET /audio/{text}` | Simple URL-based TTS or music generation |\n| `POST /v1/audio/speech` | OpenAI-compatible TTS |\n| `POST /v1/audio/transcriptions` | Speech-to-text transcription |\n\n**Audio models:** elevenlabs/eleven-v3, elevenlabs/eleven-flash-v2.5, elevenlabs/eleven-multilingual-v2, elevenlabs/eleven-v3:dialogue, elevenlabs/eleven-multilingual-sts-v2, elevenlabs/voice-isolator, elevenlabs/stem-separation, elevenlabs/music-v2, elevenlabs/music-v2.5, google/lyria-3.5, google/lyria-3-clip-preview, elevenlabs/eleven-text-to-sound-v2, openai/whisper-large-v3, openai/gpt-transcribe, elevenlabs/scribe-v2, x-ai/grok-transcribe, google/gemini-3.5-transcribe, x-ai/grok-tts, openai/tts-1, openai/tts-1-hd, google/gemini-3.8-flash-tts, google/gemini-3.8-flash-lite-tts, assemblyai/universal-2, assemblyai/universal-3.5-pro, stability-ai/stable-audio-3-medium, stability-ai/stable-audio-3, fish-audio/s2.1-pro, qwen/qwen3-tts-flash, qwen/qwen3-tts-instruct-flash, sesame/csm-1b, hexgrad/kokoro-82m\n\n**Available voices:** alloy, echo, fable, onyx, nova, shimmer, ash, ballad, coral, sage, verse, rachel, domi, bella, elli, charlotte, dorothy, sarah, emily, lily, matilda, adam, antoni, arnold, josh, sam, daniel, charlie, james, fin, callum, liam, george, brian, bill"},{"name":"Embeddings","description":"Generate vector embeddings with an OpenAI-compatible response format.\n\n| Endpoint | Description |\n|----------|-------------|\n| `POST /v1/embeddings` | OpenAI-compatible embeddings endpoint |\n| `GET /embeddings/models` | Embedding models with pricing and modalities |\n\n`google/gemini-embedding-2` supports text, image, audio, and video inputs. `cohere/embed-v4.0` supports text and one image per input. The OpenAI and Qwen embedding models are text-only.\n\nString batch input supports up to 32 items. For retrieval, use `task_type` with Gemini text input (it is converted to the recommended prompt instruction) or `input_type` (`query` or `document`) with Cohere. Dimensions are model-specific: Cohere supports 256, 512, 1024, or 1536; `openai/text-embedding-3-small` supports up to 1536; `google/gemini-embedding-2` and `openai/text-embedding-3-large` support up to 3072; `qwen/qwen3-embedding-8b` supports up to 4096.\n\nGemini task instructions count toward prompt token usage. Cohere requests containing an image expose one combined usage count, so any accompanying text is billed at the image-input rate.\n\n**Gemini GA migration:** `google/gemini-embedding-2` now uses the GA embedding space. Do not mix preview-era and GA vectors; re-embed stored `google/gemini-embedding-2` data before comparing it with new results.\n\n**Embedding models:** google/gemini-embedding-2, openai/text-embedding-3-small, openai/text-embedding-3-large, cohere/embed-v4.0, cohere/embed-v4.0:azure:sweden, qwen/qwen3-embedding-8b\n\n## Community embedding endpoints\n\nOwners can publish their own embedding backend as a community endpoint. A community embedding endpoint proxies `POST /v1/embeddings` to the owner's OpenAI-compatible upstream (`/embeddings` appended to the endpoint base URL) and is listed alongside the hosted models in `/embeddings/models` and `/v1/models`.\n\n- **Input:** text (`input` as a string or array of strings, up to the embedding batch limit), with optional dimensions and float or base64 output encoding.\n- **Billing:** community embedding models are token-only. `promptTextPrice` sets the price per input token, displayed as Pollen per 1M tokens, and billing uses the upstream `usage.prompt_tokens`. Usage is emitted through the standard `x-usage-*` headers.\n- **Response:** the upstream returns an OpenAI embeddings object with positive `usage.prompt_tokens` and matching `total_tokens`."},{"name":"Models","description":"Discover available models with pricing, capabilities, and metadata. No authentication required.\n\n| Endpoint | Returns |\n|----------|---------|\n| `GET /models` | All models with pricing, capabilities, and metadata |\n| `GET /v1/models` | All models in OpenAI-compatible format (`{object: \"list\", data: [...]}`) |\n| `GET /text/models` | Text models with pricing, context window, tool support |\n| `GET /image/models` | Image & video models with capabilities and pricing |\n| `GET /video/models` | Video models with capabilities and pricing |\n| `GET /audio/models` | Audio models with supported voices |\n| `GET /embeddings/models` | Embedding models with supported modalities |\n| `GET /3d/models` | 3D Generation models with supported modalities |\n\n### Filters\n\nAll model list endpoints above accept the same optional `source` filter:\n`official` or `community`. Omit it for both. `community=true|false|1|0`\nremains available as a legacy source filter. The query overrides the\nconnection-wide header; `source` overrides `community`. Invalid values return\n**400 Bad Request**. The filter combines with the caller's access restrictions;\nit does not change generation permissions.\n\n```bash\ncurl 'https://gen.pollinations.ai/v1/models?source=official'\n```\n\nTo search or narrow a list instead of fetching the whole catalog, add any of:\n\n| Parameter | Effect |\n|-----------|--------|\n| `query` | Case-insensitive search of the name, aliases, title, description and publisher; every word must match |\n| `capabilities` | Comma-separated list (`tool_calling`, `reasoning`, `web_search`, `code_execution`, `pollinations_models`); a model needs all of them |\n| `agent` | `true`/`1` for agents only, `false`/`0` to exclude agents |\n| `limit` | At most this many models (1-500), in catalog order |\n\nThey apply after the access, source and reliability rules above, so `limit`\nnever counts a model the caller cannot see. Unknown capabilities and values\noutside these ranges return **400 Bad Request**.\n\n```bash\ncurl 'https://gen.pollinations.ai/text/models?query=gpt&capabilities=reasoning,tool_calling&limit=5'\n```\n\nOpenAI-compatible clients that append `/models` to their base URL can use the\nequivalent header instead of the query parameter:\n\n```text\nPollinations-Model-Source: official\n```\n\nThis header works with Open WebUI and Cline custom OpenAI connections.\nLibreChat administrators can set it in the custom endpoint's `headers` map.\nThe client can use any returned model ID for generation without forwarding the\ncatalog header.\n\nLists default to `reliability=reliable`: public community proxy models need more than\n80% success across the last 50 eligible final requests within seven days.\nOfficial models, agents, and owner-only private models are unaffected. There is no minimum sample size.\nModels without observations remain listed. Successful fallbacks count as successes\nfor the requested model; final 4xx are excluded, while owner requests and\nmonitor probes count. Each entry includes `health` with `status`,\n`success_rate` (null without observations), and `requests` (at most 50 for\ncommunity proxies). Other models keep their 24-hour health window. Health\nrefreshes roughly every 60 seconds; unavailable analytics fails open.\n\nUse `?reliability=all` or `Pollinations-Model-Reliability: all` to see all\notherwise accessible models. The query takes precedence over the header.\nThis only affects discovery: exact-ID calls, retrieval and fallback routing\nremain available. Authentication, key permissions, paid access and manual\nhiding still apply. Owners can manage all their models in My Models.\n\nTime-windowed traffic, latency and fallback breakdowns are served separately by\n`/models/status`, described in [Public Stats](/docs#tag/public-stats).\n\nRich model endpoints include `capabilities` for agentic/model traits:\n`tool_calling`, `reasoning`, `web_search`, and `code_execution`.\nModalities, video frame controls, voices, and context length remain separate\nstructured fields.\n\nUse `supported_endpoints` to discover which public API routes accept each\nmodel. `/v1/responses` identifies built-in models with a configured native\nResponses route, community text models and endpoint agents whose owner supplied\nthe Responses API and one exact URL, and managed prompt agents. These community\nmodels and agents also accept `/v1/chat/completions` through the shared adapter.\nBuilt-in models may use separate upstream routes for Chat and Responses.\nSupported media models also advertise both endpoints and return generated-file\nlinks as assistant text. Reference-required models return their normal missing-input\nerror; use their native endpoint until attachments are supported here.\n\n### Chat parameters\n\nOfficial Chat models include `supported_parameters`: verified generation\ncontrols honored through `/v1/chat/completions` on the model's primary route.\n\nThis field describes Pollinations' Chat behavior, not the native\n`/v1/responses` API. Unverified controls are omitted; inclusion does not mean\nevery value or combination is supported. Provider fallback routes can have\ndifferent controls. Community models omit this field.\nFor example,\n`openai/gpt-5.4` omits sampling controls because its Chat transform removes\nthem, while `openai/gpt-oss-20b` forwards `temperature` and `top_p`.\nOn `anthropic/claude-sonnet-4.6`, those two controls are mutually exclusive\n(`temperature` wins), and both are disabled when `reasoning_effort` is enabled.\nNewer Claude and Gemini models may omit sampling controls entirely. On\nSonnet 4.6, `response_format` supports `json_schema`, not `json_object`.\nReasoning effort levels and forced-tool restrictions remain model-specific.\n\n## Community Models\n\nCommunity models and agents use a canonical `community/owner/model` id and appear in the same discovery responses as Pollinations-operated models. Use `community=true` to return only community models or `community=false` to exclude them.\n\nThe old `owner/model` IDs remain generation aliases in each model's `aliases` array. Key creation and updates accept only canonical model IDs. Existing stored permissions are migrated with the rename.\n\nThe `source=community` and `source=official` filters are equivalent source filters\nfor discovery. Source, access, and status filters combine with AND semantics.\n\nFor registration, publishing, pricing, fallbacks, and health monitoring, see [Publish a Model](/docs#tag/publish-a-model). For ownership endpoints and schemas, see [Community Models](/docs#tag/community-models) under Resources."},{"name":"Quests","description":"Public quest catalog and available rewards."},{"name":"Media Storage","description":"Upload images, audio, and video and get back an id and URL. By default, each upload gets a new random id.\n\nBase URL: https://media.pollinations.ai\n\nStored image, video, audio, and 3D files are linked through `Link: <https://media.pollinations.ai/{id}>; rel=\"enclosure\"`. Image generation and editing preserve this header in both URL and base64 JSON responses; `response_format: \"url\"` also returns the URL in `data[].url`. Audio JSON responses, such as transcripts and timestamped speech, do not have a stored-file link. Fetching media URLs never triggers generation; missing files return 404. A generated file's ID identifies its request, so a new generation after expiry may replace the file at the same URL. Clients may continue using an older cached result after regeneration.\n\n| Endpoint | Description |\n|----------|-------------|\n| `POST /upload` | Upload a file, receive a unique media URL |\n| `GET /{id}` | Retrieve a previously uploaded file |\n| `GET /{id}/metadata` | Get file metadata as JSON |\n| `GET /media?tag={tag}` | List the public gallery for a tag (no auth) |\n| `DELETE /media/{id}` | Delete a published item you own (secret `sk_` key) |\n\nUpload requires an API key; retrieval is public. Multipart FormData and raw file uploads can reach 400 MiB through `media.pollinations.ai`. Base64 JSON uploads remain limited to 100 MiB because they buffer the file in Worker memory. Files use a 30-day lifecycle from upload or the latest refresh. Retrieving the file body refreshes that lifecycle only when the object is at least 15 days old; metadata and HEAD requests do not refresh it. Three upload formats are accepted:\n\nRaw file body (streams to storage; returns a random, unlisted ID):\n\n```bash\ncurl -X POST \"https://media.pollinations.ai/upload\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: video/mp4\" \\\n  -H \"X-File-Name: video.mp4\" \\\n  --data-binary @path/to/video.mp4\n```\n\nMultipart form (browsers, files on disk):\n\n```bash\ncurl -X POST \"https://media.pollinations.ai/upload\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -F file=@path/to/image.png\n```\n\nBase64 JSON (programmatic callers that already hold the bytes):\n\n```bash\ncurl -X POST \"https://media.pollinations.ai/upload\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"data\": \"<base64-or-data-uri>\", \"contentType\": \"image/png\", \"name\": \"image.png\"}'\n```\n\n**Custom IDs.** Add `id` to either format (for example, `-F id=cover.png` or `\"id\": \"cover.png\"`). IDs are case-sensitive, start with a letter or digit, and contain up to 128 letters, digits, dots, underscores, or hyphens. A user-owned API key is required. The returned id includes an opaque account prefix; use the returned URL for retrieval. The same ID works independently for different accounts. Existing files or gallery entries return `409` without replacement, including on retries.\n\nUntagged files cannot be deleted. They expire after 30 days, but reads refresh retention once a file is at least 15 days old. An ID can be reused only once its file and any gallery entry are gone. A failed upload can still leave its ID occupied, so a retry may return `409`. Custom-ID files are served with `Cache-Control: no-store`.\n\n**Tags publish (alpha).** An optional `tags` field (comma-separated string, or a JSON array in the JSON format) publishes the upload into each tag's public gallery, where anyone can list it via `GET /media?tag={tag}`. Untagged uploads stay unlisted; all retrieval URLs are public, not access-controlled. Knowing one custom URL makes other predictable names in that account guessable. Full endpoint reference: https://media.pollinations.ai/openapi.json"},{"name":"Account","description":"Self-service endpoints for the authenticated user. Endpoints require authentication (API key or session) unless their schema says otherwise. API keys need the relevant `account:<scope>` permission. Base path: `/account`.\n\n`account:usage` is the read-only account-state scope for balances, usage, quests, and earnings. `account:keys` manages keys and, where enabled, my-models. These permissions are independent; request both when a client needs both. Newly created child keys cannot receive `account:keys` through this API.\n\n| Endpoint | Description |\n|----------|-------------|\n| `GET /account/profile` | GitHub username, image, and community model access |\n| `GET /account/balance` | Current pollen balance |\n| `GET /account/quests` | Read-only quest status |\n| `GET /account/usage` | Per-request usage history with costs (account-wide) |\n| `GET /account/usage/daily` | Daily aggregated usage for dashboards |\n| `GET /account/key/usage` | Usage history for the calling API key only |\n| `/account/agents` | Managed agent configuration |\n| `/account/my-models` | Private community model registration and allowlisted public publishing |\n| `GET /account/key` | API key validity, type, and permissions |\n\n### GET /account/profile\n\nReturns user profile. `githubUsername`, `image`, and `communityEndpointsAllowed` are always included. `name` and `email` are included only when the API key has `account:profile`.\n\n### GET /account/balance\n\n`balance` is the amount visible to this caller and is kept stable for existing clients:\n\n- Budgeted API keys always get the key's remaining budget in `balance` (no extra scope).\n- Sessions and unbudgeted keys get the account total (Quest Pollen + paid) in `balance`. That path requires `account:usage` for API keys.\n\nWhen the caller can view account usage (dashboard session or `account:usage`), the response also includes `accountBalance: { total, tier, paid }` so clients can see Quest Pollen vs paid Pollen. Budgeted keys without `account:usage` do **not** receive `accountBalance` — that would leak the owner's wallet.\n\n### GET /account/key/usage\n\nUsage history for the API key used in the request. No extra scope — a key can always read its own usage. For account-wide usage across all keys, use `GET /account/usage` with `account:usage`.\n\n### GET /account/quests\n\nReturns the quest catalog with account status. `completed` includes both globally completed quests and quests earned by the account. Requires `account:usage`. Claiming rewards is dashboard-only.\n\n### GET /account/usage\n\nPer-request usage history: model, token counts, cost, response time. Requires `account:usage`.\n\n### GET /account/usage/daily\n\nDaily aggregated usage suitable for dashboards. Requires `account:usage`.\n\n### GET /account/key\n\nReturns the current API key's validity, type, and permissions.\n\n### /account/agents\n\nCreate and manage managed agents and their callable `community/owner/name` model listings. Private agents are available to any account with linked GitHub; public listing requires community publisher access. Managed agents are text-only and free at the outer layer; their model and tool calls consume the caller's Pollen.\n\n- **Prompt agent**: instructions, a base model, and optional MCP servers.\n- **Code agent**: a public GitHub repository with `agent.ts` at its root. Pollinations deploys the current default-branch revision; the repository name becomes the model ID and title. The bundled Vercel AI SDK (`ai`, `@ai-sdk/openai-compatible`) is importable; other dependencies are not installed. The callback receives `model(id)`, `mcp.tools(server)`, `respond(config)`, `pollinations(path, init)`, `mcp.listTools(server)`, and `mcp(server, tool, arguments)`.\n\n`POST /account/agents/{id}/sync` redeploys a code agent's latest revision and bundled runtime. It needs no authentication, is limited to once every 30 seconds, and cannot change the stored repository. To deploy after every push, add a GitHub Action step (replace `AGENT_ID`):\n\n```yaml\n- run: curl --fail --retry 2 --retry-delay 30 -X POST https://gen.pollinations.ai/account/agents/AGENT_ID/sync\n```\n\nSee [Publish an Agent](/docs#tag/publish-an-agent) for dashboard, CLI, and API examples, or [fork a code agent example](https://github.com/orgs/pollinations/repositories?q=topic%3Apollinations-code-agent-example) to get started.\n\n### /account/my-models\n\nCommunity text, image, video, speech-to-text, and text-to-speech model management. Any authenticated account can list, create, update, delete, and call its private owner-only models. Text providers and endpoint agents declare one `api` (`chat_completions` or `responses`) and its exact `url`. Responses listings support both public text APIs through Gen; Chat Completions listings support Chat Completions only. Managed prompt agents use the local Responses runtime and require no endpoint URL. The text endpoint test checks JSON and streaming usage for the selected API; `/models` discovery is optional.\n\nOther model families retain `baseUrl`. Image providers expose `/v1/images/generations` and may also expose `/v1/images/edits`; transcription providers expose `/v1/audio/transcriptions`; speech providers expose `/v1/audio/speech` and must return binary audio, which is billed by input character count. Video providers enter an exact endpoint URL that accepts `prompt`, optional `duration`, and optional `image` and `reference_*` URL arrays. Omitted duration uses the provider's default. Return completed MP4 media as `data[].b64_json` or `data[].url`, plus `usage.duration` in generated seconds. Billing uses reported duration, falling back to requested duration when usage is missing; at least one is required. The endpoint test detects image-edit support and selects image pricing: valid OpenAI image token usage enables per-1M-token pricing, otherwise a fixed Pollen price is charged once per successful generated image.\n\nPublic publishing requires `communityEndpointsAllowed: true`; [request account-level publisher access](https://github.com/pollinations/pollinations/issues/new?template=community-model-allowlist.yml) with the allowlist form. Inspecting and testing an upstream endpoint is open to every account, limited to one probe every 30 seconds. The form does not register individual models. API keys require `account:keys`. The dashboard, Account API, and `polli my-models` support text, image, video, transcription, and speech registration. See [Publish a Model](https://github.com/pollinations/pollinations/blob/main/BRING_YOUR_OWN_MODEL.md) for setup, publishing, pricing, fallbacks, and health monitoring."},{"name":"Public Stats","description":"Anonymous, read-only platform statistics served directly from Tinybird. No\naccount or API key needed — pass the shared public read token as a query param.\n\nBase URL: `https://api.europe-west2.gcp.tinybird.co`\n\nPublic read token (safe to embed client-side):\n\n```\np.eyJ1IjogImFjYTYzZjc5LThjNTYtNDhlNC05NWJjLWEyYmFjMTY0NmJkMyIsICJpZCI6ICI5ZWZmMGM3Ni1kOTZkLTQwYjgtYWQwOC1mNDFlMmRiYjBmYTIiLCAiaG9zdCI6ICJnY3AtZXVyb3BlLXdlc3QyIn0.6VnVkAQ5h_fkcDZVDUoU38dzTxaw0xo3DnmKkhECbA8\n```\n\n| Endpoint | Params | Returns |\n|----------|--------|---------|\n| `GET /v0/pipes/public_model_stats.json` | `limit` (50) | Per-model usage over the last 7 days: request count, typical (median) cost, avg response time |\n| `GET https://gen.pollinations.ai/models/status` | `minutes` (60, max 10080) | Per-model and per-route health in a recent window: 2xx/4xx/5xx counts, fallback rescues, latency p50/p95. A 60-second edge cache in front of the `model_route_health` pipe; prefer it over calling Tinybird directly. |\n| `GET /v0/pipes/weekly_health_stats.json` | `weeks_back` (12) | Weekly service availability (`2xx / (2xx + 5xx)`, cache excluded) and latency |\n| `GET /v0/pipes/app_top_weekly.json` | `limit` (10) | Listed apps ranked by successful, billable BYOP requests over the rolling last 7 days. Credits each registered App Key to the owner's catalog listing whose URL covers its redirect URI, or to the owner's only listing; excludes failed/unbilled requests and banned users. Returns catalog `app_url`, `app_name`, `owner`, `request_count`, and `last_seen` |\n| `GET /v0/pipes/app_directory_public.json` | `category`, `platform`, `limit` (1000) | The community app directory ([app.json](https://github.com/pollinations/pollinations/blob/main/operations/app-management/app.json)) |\n\nTinybird responses are JSON: a `data` array of rows plus a `meta` array typing\neach column. Append `&token=<public-read-token>` to authenticate them. The\nmodel status gateway has the same response shape and does not require the\nTinybird token.\n\n```bash\ncurl \"https://api.europe-west2.gcp.tinybird.co/v0/pipes/public_model_stats.json?limit=5&token=PUBLIC_READ_TOKEN\"\n```"}],"servers":[{"url":"https://gen.pollinations.ai"}],"security":[{"bearerAuth":[]}],"x-tagGroups":[{"name":"Get Started","tags":["Quick Start","Authentication"]},{"name":"Integrations","tags":["Connect User Wallets","Publish a Model","Publish an Agent","MCP Servers","CLI","Coding Harnesses","Sandboxes"]},{"name":"Generation","tags":["Text","Image","Video","Realtime","3D","Audio","Embeddings"]},{"name":"Resources","tags":["Models","Community Models","Community Agents","Quests","Media Storage","Account","Safety","Errors","Public Stats"]}]}