Skip to content

Quick Start Guide

Fresh 🌱

Get started with the Poe API in 5 minutes. This guide will walk you through making your first API call.

Prerequisites

Step 1: Install Dependencies

bash
pip install fastapi-poe

Step 2: Get Your API Key

  1. Navigate to poe.com/api_key
  2. Copy your API key (it looks like: hxbFDCpJQ70H4heUw3r6AUugvIW5CvN2fMrLr_9VWj4)

Step 3: Make Your First Query

Create a file called hello_poe.py:

python
import fastapi_poe as fp

# Replace with your actual API key
api_key = "hxbFDCpJQ70H4heUw3r6AUugvIW5CvN2fMrLr_9VWj4"

# Create a message
message = fp.ProtocolMessage(role="user", content="Hello world")

# Query GPT-5
for partial in fp.get_bot_response_sync(
    messages=[message], 
    bot_name="GPT-5", 
    api_key=api_key
):
    print(partial, end="", flush=True)

Run it:

bash
python hello_poe.py

You should see the bot's response printed to the console!

Step 4: Try Different Bots

You can query any available Poe bot. Here are some popular ones:

python
# Claude Sonnet 4.5
for partial in fp.get_bot_response_sync(
    messages=[message], 
    bot_name="Claude-Sonnet-4.5", 
    api_key=api_key
):
    print(partial, end="", flush=True)

# Grok 4
for partial in fp.get_bot_response_sync(
    messages=[message], 
    bot_name="Grok-4", 
    api_key=api_key
):
    print(partial, end="", flush=True)

Step 5: Use Async (Optional)

For better performance in applications, use the async version:

python
import asyncio
import fastapi_poe as fp

async def get_response():
    api_key = "your_api_key"
    message = fp.ProtocolMessage(role="user", content="Hello world")
    
    async for partial in fp.get_bot_response(
        messages=[message], 
        bot_name="GPT-5", 
        api_key=api_key
    ):
        print(partial, end="", flush=True)

asyncio.run(get_response())

What's Next?

Troubleshooting

Error: "Invalid API key"

  • Make sure you copied the entire API key from poe.com/api_key
  • Check for any extra spaces or characters

Error: "Rate limit exceeded"

  • You're limited to 500 requests per minute
  • Wait a moment and try again

Error: "Insufficient points"

  • Check your Poe account balance
  • Each query consumes compute points

For more help, see the Troubleshooting Guide.


Next: Get API Key SOP

Poe API Documentation