API 指南

API Reference

生产 Router 契约

Octoryn 通过统一工作区身份提供 OpenAI-compatible 推理、Anthropic-compatible Messages 与治理端点。本参考描述实际部署契约;源码存在不能作为线上服务证据。

契约与 Base URL

所有公共推理 Client 都使用 https://api.octoryn.dev/v1。请以生产 OpenAPI 文档为精确 Schema 基准;排查部署漂移时,同时核对 /status 的 build_id 与 contract_sha256。

curl https://api.octoryn.dev/openapi.json
curl https://api.octoryn.dev/status

支持的协议面

POST /v1/chat/completions、/completions 与 /responses 用于生成任务;同时提供 Anthropic-compatible 的 POST /api/v1/messages。Embedding、重排、Moderation、模型目录与治理控制面分别记录在对应章节。


请求身份

每次请求都使用工作区 Service Key。POST /v1/route/simulate 与 GET /v1/governance/summary 需要专用 Scope。保留 Request ID 用于支持与审计关联,但不要为了说明路由而记录 Bearer Token 或 Prompt 内容。


兼容性取决于能力

协议字段被接受,并不代表任意路由都能执行。工具、Structured Outputs、模态与区域处理必须在主路由及所有候选 Fallback 上都获得批准。

下一篇认证