Files
proxycast/docs/content/04.api-reference/1.overview.md
T
coso 267bbf75e3 feat: add documentation system with Docus framework
- Add complete documentation structure with 25+ markdown files
- Add introduction, user guide, provider configs, API reference
- Add troubleshooting and development guides
- Add disclaimer for legal use
- Add GitHub Actions workflow for auto-deploying docs to GitHub Pages
- Bump version to v0.11.0
2025-12-17 13:10:58 +08:00

1.6 KiB

title, description, navigation
title description navigation
API 概述 ProxyCast API 端点和认证
icon
i-heroicons-code-bracket

API 概述

ProxyCast 提供 OpenAI 和 Claude 兼容的 API 端点。

支持的端点

OpenAI 兼容

端点 方法 说明
/v1/chat/completions POST 聊天补全
/v1/models GET 模型列表
/v1/embeddings POST 文本嵌入

Claude 兼容

端点 方法 说明
/v1/messages POST 消息 API
/v1/messages/count_tokens POST Token 计数

认证方式

OpenAI 格式

使用 Authorization 头:

curl http://127.0.0.1:9090/v1/chat/completions \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '...'

Claude 格式

使用 x-api-key 头:

curl http://127.0.0.1:9090/v1/messages \
  -H "x-api-key: your-api-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '...'

基础 URL

默认地址:http://127.0.0.1:9090

可在设置中修改主机和端口。

错误响应

错误格式

{
  "error": {
    "message": "错误描述",
    "type": "error_type",
    "code": "error_code"
  }
}

常见错误码

状态码 说明
400 请求格式错误
401 认证失败
404 端点不存在
429 速率限制
500 服务器错误
503 服务不可用

下一步