Complete examples for using OpenAI Python SDK with Crazyrouter — Chat, Streaming, Function Calling, Vision, and more.
Crazyrouter — One API key, model-specific API access.
See the current model-specific prices. Input, output, cache, account group and billing unit affect charges.
pip install openai
export OPENAI_API_KEY=sk-your-crazyrouter-key
export OPENAI_BASE_URL=https://crazyrouter.com/v1
python examples/chat.py| File | Description |
|---|---|
examples/chat.py |
Basic chat completion |
examples/streaming.py |
Streaming responses |
examples/function_calling.py |
Function calling / tool use |
examples/vision.py |
Image understanding |
examples/embedding.py |
Text embeddings |
examples/multi_model.py |
Switch between GPT/Claude/Gemini |
- 🌐 Crazyrouter | 💬 Telegram | 🐦 Twitter
MIT