Troubleshooting Guide
Fresh 🌱Common problems and their solutions.
Installation Issues
Problem: pip: command not found
Solution:
# Use python -m pip
python -m pip install fastapi-poe
# Or install pip
python -m ensurepip --upgradeProblem: Permission denied during install
Solution:
# Install for user only
pip install --user fastapi-poe
# Or use virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
pip install fastapi-poeProblem: Import error after installation
Solution:
# Verify installation
pip show fastapi-poe
# Reinstall
pip uninstall fastapi-poe
pip install fastapi-poe
# Check Python path
python -c "import sys; print(sys.path)"API Key Issues
Problem: Invalid API key
Symptoms:
- Error: "Invalid API key" or "Authentication failed"
Solutions:
Verify API key is correct:
pythonimport os api_key = os.getenv("POE_API_KEY") print(f"Key length: {len(api_key) if api_key else 0}")Check for extra spaces:
pythonapi_key = api_key.strip() # Remove whitespaceVerify environment variable is set:
bash# Windows PowerShell echo $env:POE_API_KEY # Linux/Mac echo $POE_API_KEYGet a new API key from poe.com/api_key
Problem: API key not found
Solutions:
Check
.envfile exists and is loaded:pythonfrom dotenv import load_dotenv load_dotenv() # Must call thisVerify
.envfile format:bashPOE_API_KEY=your_key_here # No spaces around =Use absolute path:
pythonfrom dotenv import load_dotenv from pathlib import Path load_dotenv(Path(__file__).parent / ".env")
Query Issues
Problem: Bot not found
Symptoms:
- Error: "Bot not found" or "Invalid bot name"
Solutions:
Check bot name spelling (case-sensitive):
python# Correct bot_name = "GPT-5" bot_name = "Claude-Sonnet-4.5" # Incorrect bot_name = "gpt-5" # Wrong case bot_name = "GPT5" # Missing hyphenVerify bot is available:
- Check Poe website for available bots
- Try a different bot name
Common bot names:
GPT-5Claude-Sonnet-4.5Claude-Opus-4.1Grok-4Imagen-4
Problem: Rate limit exceeded
Symptoms:
- Error: "Rate limit exceeded" or "Too many requests"
Solutions:
Wait 60 seconds before retrying
Implement rate limiting:
pythonimport time from collections import deque class RateLimiter: def __init__(self, max_requests=500, window=60): self.max_requests = max_requests self.window = window self.requests = deque() async def wait_if_needed(self): now = time.time() while self.requests and self.requests[0] < now - self.window: self.requests.popleft() if len(self.requests) >= self.max_requests: sleep_time = self.window - (now - self.requests[0]) await asyncio.sleep(sleep_time) self.requests.append(time.time())Reduce request frequency
Use async with delays between requests
Problem: Insufficient points
Symptoms:
- Error: "Insufficient points" or "Not enough credits"
Solutions:
- Check your Poe account balance
- Purchase more points if needed
- Use bots that consume fewer points
- Reduce thinking budget or reasoning effort
Problem: Timeout errors
Symptoms:
- Request hangs or times out
Solutions:
Increase timeout:
python# For OpenAI-compatible API client = OpenAI( api_key=api_key, base_url="https://api.poe.com/v1", timeout=60.0 # 60 seconds )Use async with proper error handling:
pythonimport asyncio async def query_with_timeout(): try: async with asyncio.timeout(60): # Your query here pass except asyncio.TimeoutError: print("Request timed out")Check internet connection
Retry with exponential backoff
File Upload Issues
Problem: File not found
Solutions:
Use absolute path:
pythonfrom pathlib import Path file_path = Path(__file__).parent / "document.pdf"Verify file exists:
pythonimport os if not os.path.exists("document.pdf"): print("File not found!")Check file permissions
Problem: File too large
Solutions:
Check file size:
pythonfile_size = os.path.getsize("document.pdf") print(f"File size: {file_size / 1024 / 1024:.2f} MB")Compress or split large files
Use smaller test file first
Problem: Unsupported file type
Solutions:
Use supported formats:
- PDF (
.pdf) - Images (
.png,.jpg,.jpeg) - Text (
.txt,.md)
- PDF (
Convert to supported format
Check bot's file capabilities
Parameter Issues
Problem: Parameters not working
Symptoms:
- Parameters seem to be ignored
Solutions:
Verify parameter format:
python# Correct message = fp.ProtocolMessage( role="user", content="Question", parameters={"thinking_budget": 12288} # In parameters dict ) # Incorrect message = fp.ProtocolMessage( role="user", content="Question --thinking_budget 12288" # Won't work! )Check bot supports parameter:
thinking_budgetfor Claude modelsreasoning_effortfor GPT modelsaspect_ratiofor image bots
Verify parameter values:
python# thinking_budget: integer parameters={"thinking_budget": 12288} # reasoning_effort: string parameters={"reasoning_effort": "high"} # aspect_ratio: string parameters={"aspect_ratio": "16:9"}
Network Issues
Problem: Connection errors
Solutions:
Check internet connection
Verify API endpoint is accessible:
pythonimport requests response = requests.get("https://api.poe.com/v1") print(response.status_code)Check firewall/proxy settings
Try from different network
Problem: SSL certificate errors
Solutions:
Update certificates:
bashpip install --upgrade certifiUpdate Python and pip
Check system date/time is correct
Debugging Tips
Enable verbose logging
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
# Your code here
logger.debug(f"Querying bot: {bot_name}")Print request details
print(f"API Key: {api_key[:10]}...")
print(f"Bot: {bot_name}")
print(f"Message: {message.content}")
print(f"Parameters: {message.parameters}")Test with simple query
# Minimal test
import fastapi_poe as fp
import os
api_key = os.getenv("POE_API_KEY")
message = fp.ProtocolMessage(role="user", content="Hi")
try:
for partial in fp.get_bot_response_sync(
messages=[message],
bot_name="GPT-5",
api_key=api_key
):
print(partial, end="", flush=True)
print("\n✓ Success!")
except Exception as e:
print(f"\n✗ Error: {e}")Getting Help
If you're still stuck:
- Check error message - Often contains helpful details
- Review documentation - SOPs and Workflows
- Test with minimal example - Isolate the problem
- Check Poe status - API might be down
- Contact support - For API-specific issues
Common Error Messages
| Error | Cause | Solution |
|---|---|---|
Invalid API key | Wrong or missing key | Verify API key |
Bot not found | Wrong bot name | Check spelling |
Rate limit exceeded | Too many requests | Wait 60 seconds |
Insufficient points | Low balance | Add points |
File not found | Wrong path | Use absolute path |
Timeout | Network issue | Check connection |
Back to: Quick Reference