首页
4All API 文档
Section titled “4All API 文档”欢迎使用 4All API 文档!
1. 注册账号
Section titled “1. 注册账号”访问 https://4allapi.com 注册账号
2. 获取 API Key
Section titled “2. 获取 API Key”登录后在控制台获取您的 API Key
3. 调用 API
Section titled “3. 调用 API”import openai
client = openai.OpenAI( api_key="your-api-key", base_url="https://api.4allapi.com/v1")
response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "你好!"}])
print(response.choices[0].message.content)- GPT-4o / GPT-4o Mini
- Claude 3.5 Sonnet
- Gemini 2.0 Flash
- 更多模型…