欢迎使用 API Key 管理系统
OpenAI 兼容接口
http://localhost:5003/v1/
API Key 用于访问 OpenAI 兼容接口(http://localhost:5003/v1/)。 请妥善保管您的 API Key,不要泄露给他人。
您的 API Key(请妥善保存,关闭后将无法再次查看):
过期时间:
请先使用上面的表单创建 API Key
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="http://localhost:5003/v1/"
)
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "你好!"}
]
)
print(response.choices[0].message.content)
curl http://localhost:5003/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "你好!"}]
}'