Skip to content

Fix model_id: claude-opus-4.8 → claude-opus-4-8#31151

Closed
ajwcontreras wants to merge 1 commit into
cloudflare:productionfrom
ajwcontreras:fix/claude-opus-4-8-model-id
Closed

Fix model_id: claude-opus-4.8 → claude-opus-4-8#31151
ajwcontreras wants to merge 1 commit into
cloudflare:productionfrom
ajwcontreras:fix/claude-opus-4-8-model-id

Conversation

@ajwcontreras
Copy link
Copy Markdown
Contributor

The catalog model_id anthropic/claude-opus-4.8 works on Workers AI's /ai/v1/messages (CF normalizes .- internally) but fails through AI Gateway provider routing, which forwards the id literally to Anthropic:

{
  "request_id": "req_011CbYUJederp2KvDoT8QYJU",
  "error": {
    "type": "not_found_error",
    "message": "model: claude-opus-4.8 was not found. Did you mean claude-opus-4-8?"
  },
  "type": "error"
}

Hyphen form works on both paths; dot only works on one. See comment for screenshot + curl evidence.

@ajwcontreras
Copy link
Copy Markdown
Contributor Author

Evidence — same id, two paths, different behavior.

AI Gateway provider-native (fails — Anthropic 404, screenshot from gateway logs):

AI Gateway 404 for claude-opus-4.8

Workers AI /ai/v1/messages (works — CF normalizes .- server-side):

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/messages \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "anthropic/claude-opus-4.8",
    "max_tokens": 64,
    "messages": [{"content": "reply with the single word: OK", "role": "user"}]
  }'
# → {"model":"claude-opus-4-8","stop_reason":"end_turn","content":[{"type":"text","text":"OK"}], ...}

Note the upstream-normalized "model":"claude-opus-4-8" in the response — the hyphen form is what Anthropic actually serves. Switching the catalog id to anthropic/claude-opus-4-8 works on both paths and matches what Anthropic returns.

@cloudflare-docs-bot
Copy link
Copy Markdown
Contributor

cloudflare-docs-bot Bot commented May 30, 2026

Review

✅ No style-guide issues found in commit 6ee8378.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

@ajwcontreras
Copy link
Copy Markdown
Contributor Author

Closing — broader smoke shows the catalog is correct.

On Workers AI's OpenAI-compat endpoint (/ai/v1/chat/completions), the model id is matched literally and only the dot form works:

anthropic/claude-opus-4.8   →  200
anthropic/claude-opus-4-8   →  404 Model not found

So three endpoints, three behaviors for the same upstream:

endpoint dot (4.8) hyphen (4-8)
/ai/v1/chat/completions (OpenAI-compat) 200 404
/ai/v1/messages (Anthropic-compat, CF normalizes) 200 200
AI Gateway provider-native (literal forward) 404 (Anthropic) 200

The catalog id is the OpenAI-compat key, where dot is required. Switching to hyphen would break that endpoint. The AI Gateway 404 I hit is an AIG-side concern (literal forwarding to Anthropic), not a catalog issue. Apologies for the noise — I should have smoked all three endpoints before opening.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants