new-api
new-api copied to clipboard
fix(relay): sanitize Opus 4.7 incompatible params + bump VERSION to v0.12.14
Summary
Claude Opus 4.7 rejects non-default temperature, top_p, top_k with HTTP 400 "Improperly formed request". When the bare model name claude-opus-4-7 (no effort/thinking suffix) is used, these parameters are forwarded as-is to the Anthropic API, causing the request to fail.
Additionally, ReasoningEffort / Reasoning parameters set thinking.type="enabled" which Opus 4.7 also rejects.
Changes
Phase 1: Fix Opus 4.7 parameter sanitization
relay/channel/claude/relay-claude.go(OpenAI-compat path): clear temperature/topP/topK forclaude-opus-4-7prefix; convertthinking.type="enabled"→"adaptive"for Opus 4.7relay/claude_handler.go(native Claude API path): clear temperature/topP/topK forclaude-opus-4-7prefix
Phase 2: Bump VERSION
VERSION: v0.12.12 → v0.12.14
Test plan
- [ ] Send request to
claude-opus-4-7with temperature set — should succeed (param stripped) - [ ] Send request to
claude-opus-4-7-high— should still work as before - [ ] Send request to
claude-opus-4-7withreasoning_effort— thinking type should be adaptive, not enabled
hope to merge it
[Bot Review]
This issue has been automatically marked as stale due to inactivity. If this is still relevant, please reply within 7 days — otherwise it will be closed automatically.