Skip to content

mangodxd/polli-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polli SDK

Unofficial OpenAI-compatible Python SDK for Pollinations.AI

Pollinations.AI brings open, multimodal generative AI for text, chat, image, audio, vision, TTS, and more — no API key required! This SDK lets you call Pollinations.AI with familiar OpenAI Python syntax, as a drop-in replacement for the openai package.


Installation

pip install .

(PyPI package coming soon — stay tuned!)


Usage

from pollinations import Pollinations

client = Pollinations()

# Chat completion (OpenAI-compatible)
# Non-stream
resp = client.chat.completions.create(
    prompt="Why you should donate to Pollinations AI",
    seed= 42,
    # "json": "true", # Optional: Get response as JSON string
    # "system": "Explain things like I'm five.", # Optional
    # "referrer": "MyPythonApp" # Optional for referrer-based authentication
)
print(resp)

# Image generation
img_url = client.images.generate(prompt="Cat in a spacesuit, digital art")
print("Image URL:", img_url)


# List available models
print(client.models.list())

Features

  • OpenAI-compatible syntax (chat, images, audio, models)
  • Streaming support
  • Attribute access (res.choices[0].message.content)
  • Lightweight: only requests dependency
  • Built-in retry, no default caching
  • Fully typed, Python 3.10+

📜 License

MIT — see LICENSE


Disclaimer: This is an unofficial, community-maintained SDK for the Pollinations API. It is not affiliated with or endorsed by Pollinations.ai.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages