Skip to content

fix: set api:openai-completions per-model for non-anthropic/ models - #6

Open
GiorgioBarresi wants to merge 2 commits into
requestyai:mainfrom
GiorgioBarresi:fix/api-format-for-non-anthropic-models
Open

fix: set api:openai-completions per-model for non-anthropic/ models#6
GiorgioBarresi wants to merge 2 commits into
requestyai:mainfrom
GiorgioBarresi:fix/api-format-for-non-anthropic-models

Conversation

@GiorgioBarresi

Copy link
Copy Markdown

Problem

The Requesty docs recommend configuring the provider with api: "anthropic-messages". This works correctly for direct anthropic/claude-* models, but breaks every other model (Azure, Vertex Gemini, Mistral, etc.) because Pi sends those requests in Anthropic Messages format, which those providers reject with a 422.

Fix

In discoverModels, add a per-model api: "openai-completions" override for any model whose ID does not start with anthropic/. Direct Anthropic models continue to inherit the provider-level anthropic-messages setting (preserving native prompt caching), while all other models get the correct OpenAI-compatible format.

updateModelsJson is also updated to persist the api field so the override survives a /requesty-models-sync + /reload cycle.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant