pollinations-api
БесплатноБез исполняемых скриптовНе проверенCall the Pollinations API directly via REST without installing anything. Use when the polli CLI cannot be installed, when browser login steps are blocked, or…
от pollinations★ 5 348 звёзд на GitHubОб этом скилле
pollinations-api — Pollinations REST API
Direct REST access to https://gen.pollinations.ai without installing the CLI.
The image URL works keyless; authenticated calls use POLLINATIONS_API_KEY.
If no key is available, the user can approve a device authorization in their own browser.
With no user to approve, an agent can buy a prepaid key over x402 (below).
Use the polli CLI skill when the CLI is already installed. Use this skill
when it is not (sandboxes, Codex cloud, Cursor chat, fresh containers)
or when you only need one quick call.
Auth
- Keyless (no header):
GET /image/{prompt}. - Authenticated: header
Authorization: Bearer $POLLINATIONS_API_KEY(an existing key, or a user-approved device authorization below). - Same key permissions, billing and caching as the CLI path.
Get a key without copying one into the agent
If POLLINATIONS_API_KEY is already set, skip this. Otherwise ask the user to
approve device authorization, then use the OAuth 2.0 Device Authorization Grant (RFC 8628).
The user opens the printed URL on their own device; the agent polls at the
server-provided interval. No credential goes into a chat, command argument,
URL, public repository, or log. This uses Python's standard library only:
python3 - <<'PYDEVICE'
import json, os, time, urllib.error, urllib.parse, urllib.request
from pathlib import Path
path = Path.home() / '.config/pollinations/agent-key'
if path.exists():
print('Existing private key file:', path)
raise SystemExit(0)
def post(route, fields):
request = urllib.request.Request(
'https://enter.pollinations.ai' + route,
data=urllib.parse.urlencode(fields).encode(),
headers={'Content-Type': 'application/x-www-form-urlencoded'},
)
try:
with urllib.request.urlopen(request, timeout=15) as response:
return json.load(response)
except urllib.error.HTTPError as error:
return json.load(error) # Pending approval is an OAuth 400 response.
code = post('/api/device/code', {})
print('Ask the user to approve:', code['verification_uri_complete'], flush=True)
interval = code['interval']
deadline = time.monotonic() + code['expires_in']
while time.monotonic() < deadline:
time.sleep(interval)
token = post('/api/oauth/token', {
'grant_type': 'urn:ietf:params:oauth:grant-type:device_code',
'device_code': code['device_code'],
})
if token.get('error') in ('authorization_pending', 'slow_down'):
if token['error'] == 'slow_down':
interval += 5
continue
if token.get('error'):
raise SystemExit('Authorization failed: ' + token['error'])
path.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
with os.fdopen(fd, 'w') as file:
file.write(token['access_token'])
print('Saved to private file:', path) # Never print the token.
break
else:
raise SystemExit('Approval timed out; request a new code.')
PYDEVICE
export POLLINATIONS_API_KEY="$(cat ~/.config/pollinations/agent-key)"
Do not run this under shell tracing (set -x). Keep that file out of projects;
its permissions are 0600. The user can revoke the issued key on the
Pollinations keys page. For all grant
options and the browser consent details, see
Pollinations Pay.
No one to approve: buy a prepaid key with x402
An agent with USDC on Base can buy a key without a Pollinations account. Spend only with the user's permission.
GET https://enter.pollinations.ai/api/x402/keys/0.50asks for a $0.50 key (any amount from $0.01 to $10,000). It returns402with payment terms in thePAYMENT-REQUIREDheader.- An x402 client signs those terms and retries with
PAYMENT-SIGNATURE. The response holds the new secretkeyand its budget inpollen, in US dollars.
Each payment creates a new key; store it like the device authorization key above.
First call (keyless image, no code)
https://gen.pollinations.ai/image/a%20cat%20in%20space?model=flux
Open the URL or curl -o out.png "<url>". If it returns an image,
discovery works.
Text (OpenAI-compatible)
from openai import OpenAI
client = OpenAI(base_url="https://gen.pollinations.ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(model="openai/gpt-5.4-nano", messages=[{"role": "user", "content": "Hello!"}])
print(response.choices[0].message.content)
curl https://gen.pollinations.ai/v1/chat/completions \
-H "Authorization: Bearer $POLLINATIONS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"Hello!"}]}'
Audio (one-shot TTS)
curl "https://gen.pollinations.a
Установить pollinations-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pollinations-api?
Call the Pollinations API directly via REST without installing anything. Use when the polli CLI cannot be installed, when browser login steps are blocked, or when only curl or fetch is available. Without an API key, the user can approve a device authorization in their own browser, or an agent with a USDC wallet can buy a prepaid key over x402.
Как установить скилл pollinations-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pollinations-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic