加载中...

欢迎使用 API Key 管理系统

OpenAI 兼容接口

http://localhost:5003/v1/

API Key 用于访问 OpenAI 兼容接口(http://localhost:5003/v1/)。 请妥善保管您的 API Key,不要泄露给他人。

创建新的 API Key

默认30天,最长365天

我的 API Keys

请先使用上面的表单创建 API Key

使用示例

Python 示例

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 示例

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": "你好!"}]
  }'