Skip to content

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

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

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

Conversation

@Adam8234

@Adam8234 Adam8234 commented Sep 19, 2026 •

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 github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Sep 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

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

@Adam8234

Adam8234 commented Sep 19, 2026 •

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
Adam8234 marked this pull request as ready for review September 19, 2026 05:34
@Adam8234
Adam8234 force-pushed the bedrock-runtime-apis branch from 0cf7805 to b46d192 Compare September 19, 2026 16:24
@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:11
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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