API 示例
Base URL、鉴权、模型列表和 SDK 示例。
Base URL
- OpenAI 兼容接口:
https://www.api0hub.com/v1 - Anthropic 兼容接口:
https://www.api0hub.com
鉴权
Authorization: Bearer sk-your-api-keycURL
curl https://www.api0hub.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1-mini",
"messages": [
{ "role": "user", "content": "你好。" }
]
}'JavaScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: "https://www.api0hub.com/v1",
});