Problem
The Post-processing Custom Provider only supports OpenAI-compatible /chat/completions format. When users configure an Anthropic/Claude API endpoint, requests fail because:
- Anthropic's endpoint is
/messages, not /chat/completions (llm_client.rs:148 hardcodes appending /chat/completions)
- Anthropic's request body format differs: requires
max_tokens, uses x-api-key instead of Authorization: Bearer (headers are partially handled at llm_client.rs:80-86 but the request body format is still OpenAI-style)
- Anthropic's response body format differs: no
choices field, uses content array instead
Steps to Reproduce
- Settings → Advanced → Enable Experimental Features → Enable Post Processing
- Post Process → Select Custom provider
- Set Base URL to an Anthropic API address (e.g.,
https://api.anthropic.com/v1)
- Enter Anthropic API Key
- Enter model name (e.g.,
claude-sonnet-4-20250514)
- Record using the Post Process hotkey
Actual Behavior
Logs show:
Starting LLM post-processing with provider 'custom' (model: claude-sonnet-4-20250514)
Sending chat completion request to: https://api.anthropic.com/v1/chat/completions
API request failed with status 404 Not Found
Falling back to original transcription.
The request is sent to /v1/chat/completions, but Anthropic doesn't have this endpoint, returning 404. Post-processing silently fails and falls back to the raw transcription with no error shown to the user.
Expected Behavior
The Custom Provider should correctly call the Anthropic API, or at minimum display an error message to the user instead of silently falling back.
Suggested Fixes
Option A (minimal): Add a note in the Custom Provider UI explaining it only supports OpenAI-compatible APIs (/v1/chat/completions). Display error messages in the UI when API requests fail instead of silently falling back.
Option B (full): Make llm_client.rs use different request formats based on provider type:
- OpenAI-compatible:
/chat/completions + Authorization: Bearer + choices response
- Anthropic:
/messages + x-api-key + anthropic-version + content response + max_tokens
Related Files
src-tauri/src/llm_client.rs — HTTP client, hardcodes /chat/completions
src-tauri/src/settings.rs:550-557 — Anthropic Provider definition
src-tauri/src/actions.rs:260-294 — Legacy mode fallback logic
Environment
Problem
The Post-processing Custom Provider only supports OpenAI-compatible
/chat/completionsformat. When users configure an Anthropic/Claude API endpoint, requests fail because:/messages, not/chat/completions(llm_client.rs:148hardcodes appending/chat/completions)max_tokens, usesx-api-keyinstead ofAuthorization: Bearer(headers are partially handled atllm_client.rs:80-86but the request body format is still OpenAI-style)choicesfield, usescontentarray insteadSteps to Reproduce
https://api.anthropic.com/v1)claude-sonnet-4-20250514)Actual Behavior
Logs show:
The request is sent to
/v1/chat/completions, but Anthropic doesn't have this endpoint, returning 404. Post-processing silently fails and falls back to the raw transcription with no error shown to the user.Expected Behavior
The Custom Provider should correctly call the Anthropic API, or at minimum display an error message to the user instead of silently falling back.
Suggested Fixes
Option A (minimal): Add a note in the Custom Provider UI explaining it only supports OpenAI-compatible APIs (
/v1/chat/completions). Display error messages in the UI when API requests fail instead of silently falling back.Option B (full): Make
llm_client.rsuse different request formats based on provider type:/chat/completions+Authorization: Bearer+choicesresponse/messages+x-api-key+anthropic-version+contentresponse +max_tokensRelated Files
src-tauri/src/llm_client.rs— HTTP client, hardcodes/chat/completionssrc-tauri/src/settings.rs:550-557— Anthropic Provider definitionsrc-tauri/src/actions.rs:260-294— Legacy mode fallback logicEnvironment