anomalyco / anomalyco/opencode

[FEATURE]: Bedrock Mantle for both Anthropic and OpenAI models with SigV4/SSO auth

Open
#43,230 2 comments 14 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 18, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

I'm evaluating opencode and want to run it entirely against the bedrock-mantle endpoint — both OpenAI and Anthropic models — authenticating with SigV4 from an AWS SSO profile. No API keys, no bearer tokens.

The OpenAI half already works. openai.gpt-5.6-sol / terra / luna go through @ai-sdk/amazon-bedrock/mantle and sign with the credential chain, so "profile": "<my-sso-profile>" is all I need.

The Anthropic half has no path. Mantle serves Claude through the Anthropic Messages API at /anthropic/v1/messages, and none of the bundled packages reach it:

  • @ai-sdk/amazon-bedrock/mantle is OpenAI-compatible only, and Mantle rejects Claude on those paths:
    • The model 'anthropic.claude-opus-4-8' does not support the '/v1/chat/completions' API
    • The model 'anthropic.claude-opus-4-8' does not support the '/openai/v1/responses' API
  • @ai-sdk/amazon-bedrock/anthropic speaks Messages, but builds bedrock-runtime /model/{id}/invoke URLs — the other endpoint.
  • @ai-sdk/anthropic speaks Messages and I can point baseURL at Mantle, but it only authenticates with a key. I'd have to mint a Bedrock API key and refresh it every 12h, which defeats the point of using SSO.

So today it's either Mantle without Claude, or Claude on bedrock-runtime. Not one endpoint and one auth mode for both.

What I'd like: Mantle's Messages API as an option on the existing amazon-bedrock provider, so a Claude model can be routed there and signed with SigV4 like everything else, with bearer tokens still taking precedence when set. Model IDs would stay unprefixed, since Mantle has no cross-region inference profiles.

Related: #36208 (native llm layer design — this is the AI SDK path) and #40075 (${AWS_REGION} not substituted on v2).

I have this working locally against us-east-1 with SSO credentials and can open a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.