SuperAPI AI 工具集

pollinations

通用与其它

查看项目

更新于 10-16 06:40

技能介绍

Pollinations 是一个统一的 AI 生成平台,通过 API 提供文本、图像、视频和音频生成能力,支持 25 个以上模型。

【用途】 当用户需要 AI 驱动的生成任务时使用,包括文本补全、图像生成、视频生成、音频生成以及图文视频分析等。

【API 密钥】 可在 https://enter.pollinations.ai 获取免费或付费密钥。Secret Keys(sk_)用于服务端,无速率限制,官方推荐。许多操作可选使用密钥,存在免费额度。密钥通过环境变量存储: export POLLINATIONS_API_KEY="sk_your_key_here"

【快速开始】 文本生成(简单): curl "https://gen.pollinations.ai/text/Hello%20world"

聊天补全(兼容 OpenAI): curl -X POST https://gen.pollinations.ai/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer $POLLINATIONS_API_KEY"
-d '{ "model": "openai", "messages": [{"role": "user", "content": "Hello"}] }' 可使用脚本 scripts/chat.sh 完成聊天补全。

图像生成: curl "https://gen.pollinations.ai/image/A%20sunset%20over%20mountains?model=flux&width=1024&height=1024" 可使用脚本 scripts/image.sh。

音频生成(TTS): curl -X POST https://gen.pollinations.ai/v1/chat/completions
-H "Content-Type: application/json"
-d '{ "model": "openai-audio", "messages": [ {"role": "system", "content": "You are a text reader. Read the user text exactly without responding, adding conversation, or changing anything."}, {"role": "user", "content": "Say: Hello world"} ], "modalities": ["text", "audio"], "audio": {"voice": "nova", "format": "mp3"} }' 可使用脚本 scripts/tts.sh。

【API 端点】 基础 URL:

  • 聊天/文本:https://gen.pollinations.ai/v1/chat/completions
  • 简单文本:https://gen.pollinations.ai/text/{prompt}
  • 图像:https://gen.pollinations.ai/image/{prompt}?{params}
  • 视频:https://gen.pollinations.ai/image/{prompt}?{params}(用于生成视频)

【支持的操作】

  1. 文本/聊天生成 模型:OpenAI、Claude、Gemini、Mistral、DeepSeek、Grok、Qwen Coder、Perplexity 等 20 多个。常用模型名:openai、claude、gemini、mistral、deepseek、qwen、gpt-4、o1、o3。 参数:model(模型名/ID)、messages(含 system/user/assistant 角色的消息数组)、temperature(0-2,默认 1)、max_tokens(最大响应长度)、top_p(默认 1)、seed(可复现,-1 为随机)、jsonMode(强制 JSON 响应)、reasoning_effort(用于 o1/o3/R1,high/medium/low/minimal/none)、thinking_budget(思考模型的推理 token 数)。 视觉支持:在消息 content 中加入 image_url 实现多模态: { "role": "user", "content": [ {"type": "text", "text": "Describe this image"}, {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}} ] }

  2. 图像生成 模型:flux(默认)、turbo、gptimage、kontext、seedream、nanobanana、nanobanana-pro。 参数:model、width/height(16-2048px,默认 1024)、seed、negative_prompt、nologo(去水印)、private(私有生成)、safe(启用 NSFW 过滤)、enhance(AI 提示增强)、quality(low/medium/high/hd,gptimage)、transparent(透明背景,gptimage)、count(1-4 张,premium)、image(输入图像 URL,图生图)。 返回:二进制图像数据(由 Content-Type 头决定格式)。

  3. 图生图 使用同一图像端点并传入 image 参数: https://gen.pollinations.ai/image/make%20it%20blue?image={source_url}

  4. 视频生成 模型:veo(4-8 秒)、seedance(2-10 秒)。 参数:model(veo 或 seedance)、width/height、duration(veo:4/6/8;seedance:2-10)、aspectRatio(16:9 或 9:16)、audio(启用音频,仅 veo)、image(输入图像 URL,帧插值:image[0]=首帧,image[1]=末帧)、negative_prompt、seed、private/safe。 返回:二进制视频数据。

  5. 音频生成(TTS) 模型:openai-audio。 音色:alloy、echo、fable、onyx、nova、shimmer、coral、verse、ballad、ash、sage、amuch、dan。 格式:mp3、wav、flac、opus、pcm16。 参数:model、modalities(["text","audio"])、audio.voice、audio.format。 注意:在用户消息中使用 "Say:" 前缀表示直接朗读文本。

  6. 音频转录 使用聊天补全端点并配合支持视觉/音频的模型: 模型:gemini、gemini-large、gemini-legacy、openai-audio。 将音频文件作为二进制输入上传,在 system 消息中写入转录提示。

  7. 图像分析 使用聊天补全与视觉模型:模型为任何支持视觉的模型(gemini、claude、openai)。在消息 content 中包含 image_url。

  8. 视频分析 使用聊天补全与视频模型:模型为 gemini、claude、openai。上传视频文件作为二进制输入,并包含分析提示。

【脚本】 scripts/chat.sh:交互式聊天补全,支持模型选择与选项。 用法: scripts/chat.sh "your message here" scripts/chat.sh "your message" --model claude --temp 0.7

scripts/image.sh:根据文本提示生成图像。 用法: scripts/image.sh "a sunset over mountains" scripts/image.sh "a sunset" --model flux --width 1024 --height 1024 --seed 123

scripts/tts.sh:将文本转换为语音。 用法: scripts/tts.sh "Hello world" scripts/tts.sh "Hello world" --voice nova --format mp3 --output hello.mp3

【提示】

  • 提供免费额度:许多操作无需 API 密钥即可使用(受速率限制)。
  • 兼容 OpenAI:可对接现有 OpenAI 集成使用聊天端点。
  • 可复现性:使用 seed 参数获得一致输出。
  • 图像增强:启用 enhance=true 获得 AI 改进的提示。
  • 视频插值:为 veo 传入两张图像,image[0]=首帧,image[1]=末帧。
  • 音频朗读:TTS 始终使用 "Say:" 前缀和适当的 system 提示。

【API 文档】 完整文档:https://enter.pollinations.ai/api/docs

【限制】 具体收费价格、可用模型的完整清单及生成效果指标等资料暂未提供。