Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/advanced/anthropic-messages-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ features that have no canonical equivalent are not preserved end to end:
`stop_reason: "stop_sequence"` plus the `stop_sequence` value. OpenAI-family
providers conflate stop-parameter hits with natural stops in `finish_reason`,
so completions there report `stop_reason: "end_turn"` (output is still truncated
correctly).
correctly). OpenAI, Azure OpenAI, and Groq accept at most four stop sequences;
a longer list is truncated to the first four (with a warning in the gateway
log) instead of failing the request. Anthropic accepts the full list.
- **`thinking`** on a non-Anthropic model becomes a reasoning effort (budget
under 10000 tokens: `low`, under 20000: `medium`, otherwise `high`; adaptive:
`medium`), sent as each provider's own field: `reasoning_effort` on OpenAI,
Expand Down
5 changes: 4 additions & 1 deletion docs/features/passthrough-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ Passthrough is intentionally narrow while the API is in beta.
that surface.
- GoModel does not translate passthrough request bodies or response bodies.
- Provider-native error bodies and status codes are proxied instead of converted
into OpenAI-compatible responses.
into OpenAI-compatible responses, so provider SDKs raise their own typed
errors. Errors raised by GoModel itself (authentication, rate limits, budgets,
a provider that is not enabled, an unreachable upstream) use the gateway's
error shape, as does an upstream error body that is not JSON.
- Features that depend on OpenAI-compatible request or response shapes may not
apply to passthrough traffic in the same way as `/v1` traffic.

Expand Down
2 changes: 1 addition & 1 deletion internal/core/chat_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (r *ChatRequest) UnmarshalJSON(data []byte) error {
type alias ChatRequest
var raw alias
if err := json.Unmarshal(data, &raw); err != nil {
return err
return wrapJSONDecodeError(err)
}

extraFields, err := extractUnknownJSONFieldsSet(data, chatRequestFields)
Expand Down
Loading