Skip to content

OpenAI 兼容接口

UniAPI 对大多数模型提供 OpenAI Compatible 的调用方式。

  • Base URL:https://api.uniapi.io/v1
  • 鉴权:Authorization: Bearer <your-api-key>

最小示例(Chat Completions)

bash
curl --request POST \
  --url https://api.uniapi.io/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <your-api-key>' \
  --data '​​{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "hi"}
    ]
  }'

下一步