Official Python client for the Poe chat completions API.
pip install poefrom 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"])for chunk in client.stream("Tell me a story", model="GPT-4o"):
print(chunk, end="", flush=True)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.",
)with PoeClient(api_key="your-key") as client:
resp = client.chat("Hello!")
print(resp["choices"][0]["message"]["content"])Get your API key from poe.com/api_key.
MIT