adding responses api to oai

This commit is contained in:
2026-07-21 11:17:44 -05:00
parent 0e9131dafa
commit 08a11825ea
4 changed files with 334 additions and 0 deletions
+2
View File
@@ -54,6 +54,8 @@ curl http://localhost:4005/oai/v1/chat/completions \
-d '{"model":"kimi-k3","messages":[{"role":"user","content":"Hello"}]}'
```
Codex and other OpenAI Responses API clients can use `POST /oai/v1/responses`. Responses requests are translated to the upstream Chat Completions API and responses, including streaming events, are translated back to the Responses format.
Streaming requests are supported with `"stream":true` and are passed through as Server-Sent Events. The model list is fetched from OpenCode Go, so it can include models whose upstream transport is not OpenAI Chat Completions.
The Anthropic-compatible adapter exposes `POST /ant/v1/messages` and `GET /ant/v1/models`. Messages, tools, JSON responses, and streaming events are translated to and from OpenAI Chat Completions. Anthropic clients should use their normal Messages API request format and can use the OpenCode model IDs returned by the models endpoint.