FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(ai): add Bedrock Runtime compatible APIs by Adam8234 · Pull Request #49905 · anomalyco/opencode · GitHub

feat(ai): add Bedrock Runtime compatible APIs - #49905

Open
Adam8234 wants to merge 1 commit into
anomalyco:v2from
Adam8234:bedrock-runtime-apis
Open

Adam8234 wants to merge 1 commit into
anomalyco:v2from
Adam8234:bedrock-runtime-apis

Conversation

Adam8234 commented Sep 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Amazon Bedrock Runtime now supports OpenAI Responses, OpenAI Chat Completions, and Anthropic Messages alongside Converse. This PR adds explicit entrypoints for each API while keeping Converse as the default:

  • amazon-bedrock/converse
  • amazon-bedrock/responses
  • amazon-bedrock/chat
  • amazon-bedrock/messages

The routes reuse OpenCode's existing protocol implementations and Bedrock authentication.

API support varies by model. The intended routing is:

  • GPT-5.6 and GPT-6 → Responses
  • OSS Models → Chat Completions
  • supported Claude models → Anthropic Messages
  • other models, including Nova → Converse

Next steps

A follow-up models.dev change should assign each Bedrock model its preferred API, allowing OpenCode to select the route automatically. For example, the existing Amazon Bedrock provider and a model-specific Responses selection in models.dev could look like:

providers/amazon-bedrock/models/global.openai.gpt-5.6-sol.toml

base_model = "openai/gpt-5.6-sol"
name = "GPT-5.6 Sol (Global)"

[provider]
api_type = "responses"

Suggested values are responses, chat, messages, and converse. A separate api_type field avoids overloading the existing provider.api field, which currently contains a base URL.

Add api_type to models.dev's model-level [provider] schema and generated API output. Then update OpenCode's models.dev normalization to map it to the matching @opencode/ai/providers/amazon-bedrock/* package, falling back to Converse when omitted.

How did you verify your code works?

Added tests for route selection, Runtime URLs, SigV4 signing, API-key headers, and package loading. Also ran the existing Bedrock Converse tests and bun run check.

Screenshots / recordings

Not applicable; this is not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Sep 19, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Adam8234 commented Sep 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

@rekram1-node hey just FYI -> I think bedrock is switching from recommending mantle to recommending runtime again with the distinction of multiple API's

  • Converse
  • Invoke
  • Chat
  • Responses
  • Anthropic Messages

I think at some point we should be able to throw away the mantle specific stuff -> It's very annoying to deal with models not supported in different regions with mantle, and this would eventually simplify a lot of that effort with the CRIS profiles (US, Global)

Adam8234 marked this pull request as ready for review September 19, 2026 05:34
Adam8234 force-pushed the bedrock-runtime-apis branch from 0cf7805 to b46d192 Compare September 19, 2026 16:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL