Skip to main content

Python client for the Poe API (api.poe.com)

Project description

poe

Official Python client for the Poe chat completions API.

Installation

pip install poe

Quick Start

from poe import PoeClient

client = PoeClient(api_key="your-poe-api-key")

# Simple chat
response = client.chat("What is Python?", model="GPT-4o")
print(response["choices"][0]["message"]["content"])

Streaming

for chunk in client.stream("Tell me a story", model="GPT-4o"):
    print(chunk, end="", flush=True)

Options

client = PoeClient(
    api_key="your-key",
    timeout=120.0,       # request timeout in seconds
)

response = client.chat(
    "Explain quantum computing",
    model="GPT-4o",
    temperature=0.7,
    max_tokens=1024,
    system_prompt="You are a helpful physics teacher.",
)

Context Manager

with PoeClient(api_key="your-key") as client:
    resp = client.chat("Hello!")
    print(resp["choices"][0]["message"]["content"])

API Key

Get your API key from poe.com/api_key.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poe-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poe-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file poe-0.1.0.tar.gz.

File metadata

  • Download URL: poe-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for poe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f293cd30de517b89daa82c0537bc5015d48871f0fcfe720f5eaa01aab4a03299
MD5 c4ce3c7a7822074396e95bee4eee8e83
BLAKE2b-256 622323e42436a734412d8e46ecdc05041a5533619ce6b3bcb05977c34d9e61f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for poe-0.1.0.tar.gz:

Publisher: pypi.yml on poe-platform/poe-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file poe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: poe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for poe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93b71291c874befd2d8607cff13cbbc9c847016781742e57c3ab6729bd777f65
MD5 22461c2a697f994d8db2efcc53d42c0e
BLAKE2b-256 20820736aa02fb146c1e7f742467ce58df2348bcb43cb2da9e17081bc5cf5cfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for poe-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on poe-platform/poe-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page