OpenAI Python SDK
Prerequisites
- Python 3.8+
- A Chuizi.AI account with an API key (starts with
ck-)
Installation
terminal
bash
pip install openai
Basic Usage
example.py
python
from openai import OpenAI client = OpenAI( base_url="https://api.chuizi.ai/v1", api_key="ck-your-key-here", ) response = client.chat.completions.create( model="anthropic/claude-sonnet-4-6", messages=[ {"role": "user", "content": "Hello!"} ], ) print(response.choices[0].message.content)
Next Steps
- Streaming Guide — implement token-by-token streaming
- Function Calling — let models call your tools
- Migration Guide — full migration walkthrough from OpenAI direct