Implement OpenAI-to-Anthropic proxy with streaming support
- Add request/response converters (OpenAI <-> Anthropic formats) - Implement SSE streaming conversion (Anthropic events -> OpenAI SSE) - Add /v1/models endpoint with Claude model list - Add /v1/chat/completions endpoint with streaming and non-streaming support - Fix context key type matching bug (sessionIDKey) - Configurable upstream URL via config.yaml - Mimic claude-code CLI headers for upstream requests
This commit is contained in:
parent
87a74edbf5
commit
8450d96e2e
10 changed files with 1270 additions and 0 deletions
2
config.yaml
Normal file
2
config.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
port: 8080
|
||||
upstream_url: "https://api.z.ai/api/anthropic"
|
||||
Loading…
Add table
Add a link
Reference in a new issue