Skip to content

panel synthesize routes openrouter/anthropic/* models to the Anthropic provider (demands ANTHROPIC_API_KEY) instead of OpenRouter #549

@claude-dataviking

Description

@claude-dataviking

Summary

A synthesis model spec of the form openrouter/anthropic/<model> is resolved to the Anthropic provider (requiring ANTHROPIC_API_KEY) instead of being routed through OpenRouter (OPENROUTER_API_KEY). Panelist calls with the same slug route correctly via OpenRouter; only the synthesis path mis-detects the provider, presumably by matching the anthropic path segment rather than the leading openrouter/ provider prefix.

Repro

With only OPENROUTER_API_KEY set (no ANTHROPIC_API_KEY):

synthpanel panel synthesize <result-id> --synthesis-model openrouter/anthropic/claude-haiku-4.5

Output:

Synthesis will cost ~$0.1521 using openrouter/anthropic/claude-haiku-4.5
Error: synthesis failed: Missing API key for Anthropic: set ANTHROPIC_API_KEY ...

Note the cost line correctly echoes openrouter/anthropic/claude-haiku-4.5, then the provider resolver still demands an Anthropic key.

Same failure occurs in-run: a panel run --models "openrouter/anthropic/claude-haiku-4.5,..." --blend whose default synthesis model is the leading ensemble member fails synthesis ("Missing API key for Anthropic") and saves an empty synthesis: {} with no hard error surfaced to the user — the run otherwise "succeeds."

Expected

openrouter/anthropic/claude-haiku-4.5 (and any openrouter/<vendor>/<model>) routes through OpenRouter for synthesis exactly as it does for panelist calls, using OPENROUTER_API_KEY.

Suggested fixes

  1. In the synthesis model-resolution path, parse the leading provider segment (openrouter/) the same way the panelist path does; don't infer provider from a later anthropic/openai/google segment.
  2. If synthesis fails, do not silently persist synthesis: {} on an otherwise-successful run — surface a clear warning/error and a non-zero indication so the user knows synthesis didn't run.

Environment

synthpanel 1.5.6, Python 3.12, OpenRouter only (OPENROUTER_API_KEY).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions