Skip to content

feat: add OpenAI chat completions compatibility#648

Open
yulate wants to merge 1 commit intoWei-Shaw:mainfrom
yulate:feat/openai-chat-completions-compat
Open

feat: add OpenAI chat completions compatibility#648
yulate wants to merge 1 commit intoWei-Shaw:mainfrom
yulate:feat/openai-chat-completions-compat

Conversation

@yulate
Copy link

@yulate yulate commented Feb 26, 2026

Summary

  • add /v1/chat/completions and /chat/completions compatibility endpoints
  • convert chat-completions payloads to responses API format and convert responses back
  • add direct API-key passthrough forwarding for chat-completions upstream
  • include tests and fix errcheck lint issues

Validation

  • go test -timeout 60s ./internal/service -run "ChatCompletions|ConvertChatCompletions|ConvertResponsesToChatCompletion"
  • go test -timeout 60s ./internal/handler -run "ChatCompletions|OpenAIGateway"
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.0 run --timeout=5m ./...
@iDeaLMine
Copy link

/v1/chat/completions
Does it support OpenAI-to-Claude-to-OpenAI proxy/forwarding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants