Skip to content

Claude engine + ANTHROPIC_BASE_URL (OpenRouter): api-proxy 404s current Anthropic model slugs #54140

Description

@Jasper13006

Summary

With engine.id: claude routed to OpenRouter via engine.env.ANTHROPIC_BASE_URL, the api-proxy returns 404 model_not_found for a current OpenRouter Anthropic slug (anthropic/claude-sonnet-5), even though the same request succeeds when it bypasses the proxy. There appears to be no supported way to disable token-steering / the built-in model catalog for the claude engine.

Environment

  • gh aw v0.82.14 and v0.86.2 (both reproduce)
  • Firewall images gh-aw-firewall/*:0.27.37 (identical awf-config across both compiler versions)
  • Engine: claude (Claude Code CLI), provider: OpenRouter

Workflow frontmatter (minimal)

engine:
  id: claude
  env:
    ANTHROPIC_BASE_URL: "https://openrouter.ai/api/v1"
    ANTHROPIC_API_KEY: ${{ secrets.OPENROUTER_KEY }}
network:
  allowed:
    - defaults
    - openrouter.ai
model: anthropic/claude-sonnet-5

What happens

The agent job fails on the first model call:

error: model_not_found  (api_error_status: 404)
"There's an issue with the selected model (anthropic/claude-sonnet-5). It may not exist or you may not have access to it."

Every other job (pre_activation, activation, detection, safe_outputs) succeeds. The CLI init log shows "model":"anthropic/claude-sonnet-5" and ANTHROPIC_MODEL: anthropic/claude-sonnet-5.

Not the key/model/credits/endpoint (verified via direct curl with the same key)

anthropic/claude-sonnet-5 returns a valid completion on both endpoints and with both id forms:

  • POST https://openrouter.ai/api/v1/chat/completions — OK
  • POST https://openrouter.ai/api/v1/messages (the Anthropic-native endpoint the CLI uses) — OK
  • model anthropic/claude-sonnet-5 — OK; bare claude-sonnet-5 — OK

GET /api/v1/key confirms a non-free-tier key with credits available. So the 404 originates in the proxy layer, not at OpenRouter.

Apparent root cause

The generated awf-config runs apiProxy with enableTokenSteering: true and a built-in Copilot-oriented model catalog. For the claude engine it resolves claude → agent → [sonnet-6x, …], where sonnet-6x is pinned to *sonnet-4-5-* / *sonnet-4-6* patterns. A current slug like anthropic/claude-sonnet-5 isn't in that steering set, so the proxy rejects/mis-routes it. The catalog is tied to the firewall image (0.27.37), so bumping the compiler version doesn't change it.

Ask

Is there a supported way to, for a custom provider (ANTHROPIC_BASE_URL) on the claude engine, either:

  1. disable token-steering / catalog validation and pass the configured model through to the provider verbatim, or
  2. register a custom model slug so the catalog accepts it?

The docs (reference/engines) describe the ANTHROPIC_BASE_URL pattern but don't mention a catalog bypass for claude (no BYOK-mode equivalent as with Copilot). Happy to provide fuller logs.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions