API 参考
Arcflow 暴露的 /v1 端点简明参考。
Base URL:
https://api.tryarcflow.com用户认证:
Authorization: Bearer sk-...根据 OpenAPI schema,/v1/models 和 /v1/ping 等公开端点不需要 bearer。
Runtime
| Method | Path | 说明 |
|---|---|---|
GET | /v1/ping | API ping。 |
GET | /v1/models | 列出模型目录。 |
GET | /v1/models/{model} | 获取单个模型元数据。 |
OpenAI 兼容
| Method | Path | 说明 |
|---|---|---|
POST | /v1/responses | 创建 Responses API 响应,stream=true 时使用 SSE。 |
GET | /v1/responses/{response_id} | 获取响应。 |
POST | /v1/chat/completions | 将 Chat Completions 转发到配置的上游。 |
POST | /v1/conversations | 创建 conversation 容器。 |
GET | /v1/conversations/{conversation_id} | 获取 conversation。 |
POST | /v1/conversations/{conversation_id} | 更新 conversation。 |
DELETE | /v1/conversations/{conversation_id} | 删除 conversation。 |
Responses 示例
curl https://api.tryarcflow.com/v1/responses \
-H "Authorization: Bearer $ARCFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"input": "Write a one sentence release note."
}'最小 body 需要 model。input 可按 Responses 格式包含文本、消息、图片、
文件或工具结果。
Claude 兼容
| Method | Path | 说明 |
|---|---|---|
POST | /v1/messages | 通过 Anthropic Messages 创建 Claude 消息。 |
POST | /v1/messages/count_tokens | 计算 Claude token。 |
Messages 示例
curl https://api.tryarcflow.com/v1/messages \
-H "Authorization: Bearer $ARCFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 128,
"messages": [{ "role": "user", "content": "Reply with ok" }]
}'Files
| Method | Path | 说明 |
|---|---|---|
POST | /v1/files | 上传 multipart form data。 |
PUT | /v1/files/{path} | 通过请求 body 流式上传文件。 |
Usage
| Method | Path | 说明 |
|---|---|---|
GET | /v1/usage | 当前认证 API 密钥的预算。 |
常见错误
| Status | 含义 |
|---|---|
400 | body 无效或模型不可用。 |
401 | 缺少密钥或密钥无效。 |
402 | API 密钥预算已耗尽。 |
502 | 上游失败。 |
503 | Provider、repository 或容量不可用。 |