Skip to content

[Bug/Feature] Custom Post-processing provider doesn't work with Anthropic/Claude native API #1386

Description

@phpmac

Problem

The Post-processing Custom Provider only supports OpenAI-compatible /chat/completions format. When users configure an Anthropic/Claude API endpoint, requests fail because:

  1. Anthropic's endpoint is /messages, not /chat/completions (llm_client.rs:148 hardcodes appending /chat/completions)
  2. 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)
  3. Anthropic's response body format differs: no choices field, uses content array instead

Steps to Reproduce

  1. Settings → Advanced → Enable Experimental Features → Enable Post Processing
  2. Post Process → Select Custom provider
  3. Set Base URL to an Anthropic API address (e.g., https://api.anthropic.com/v1)
  4. Enter Anthropic API Key
  5. Enter model name (e.g., claude-sonnet-4-20250514)
  6. 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

  • Handy v0.8.3
  • macOS

Activity

  1. cjpais commented on May 11, 2026

    @cjpais
    Owner

    Don't use a custom provider, use anthropic directly.

    Separately we can add a different support for Anthropic Compatible and OpenAI Compatible, but that is a feature request, or a PR can be submitted directly. Not a bug.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions