跳转至

API 端点速查

Native API

方法 路径 作用
GET/HEAD / 服务心跳
GET/HEAD /api/version 版本
GET /api/status cloud/服务状态
POST /api/generate 文本生成
POST /api/chat 对话生成
POST /api/embed 批量 embedding
POST /api/embeddings legacy embedding
GET /api/tags 本地模型列表
POST /api/show 模型详情
GET /api/ps 运行中模型
POST /api/pull 下载模型
POST /api/push 上传模型
POST /api/create 创建模型
POST /api/copy 复制引用
DELETE /api/delete 删除模型
HEAD/POST /api/blobs/:digest Blob 检查/上传

OpenAI-compatible API

方法 路径 内部 handler
POST /v1/chat/completions ChatHandler
POST /v1/completions GenerateHandler
POST /v1/embeddings EmbedHandler
GET /v1/models ListHandler
GET /v1/models/:model ShowHandler
POST /v1/responses ChatHandler
POST /v1/audio/transcriptions ChatHandler

Anthropic-compatible API

方法 路径 内部 handler
POST /v1/messages ChatHandler

流式语义

Native Ollama: application/x-ndjson
OpenAI:        text/event-stream, data: {...}, data: [DONE]
Anthropic:     text/event-stream, event-specific frames

协议 adapter 负责把相同的内部 response 变成不同 framing;不要把“支持同一路径”误解成“响应字节完全相同”。