View a markdown version of this page

API 兼容性 - Amazon Bedrock

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

API 兼容性

Amazon Bedrock 支持四个运行时 API 系列,每个系列都针对不同的集成模式和用例而设计。

Invoke 系列InvokeModel处理同步的单一响应呼叫。InvokeModelWithResponseStream以实时流的形式返回响应。InvokeModelWithBidirectionalStream支持交互式应用程序的全双工流式传输。AsyncInvoke异步提交长时间运行的请求,将输出存储到 Amazon S3。

Converse 系列Converse为同步多回合对话提供统一的、与模型无关的接口。ConverseStream通过流媒体输出提供相同的体验。

OpenAI-compatible 家庭ChatCompletions实现OpenAI聊天完成界面,使现有的 OpenAI-based 集成能够在Bedrock上运行,只需进行最少的更改。ResponsesAPI 实现了 OpenAI 响应接口,通过内置工具使用和对话历史记录管理支持有状态的代理交互。

消息系列:在bedrock-mantle终端上Messages实现 Anthropic 消息接口,使现有的 Anthropic SDK-based 集成能够在 Bedrock 上运行,几乎不做任何更改。

我们现在将查看每种型号支持的 API 列表。

AI21

模型名称 调用 Converse 聊天完成 响应 消息
Jamba 1.5 Large* supported supported not-supported not-supported not-supported
Jamba 1.5 Mini* supported supported not-supported not-supported not-supported

Amazon

Anthropic

Cohere

模型名称 调用 Converse 聊天完成 响应 消息
Command R* supported supported not-supported not-supported not-supported
Command R+* supported supported not-supported not-supported not-supported
Embed(英文版) supported not-supported not-supported not-supported not-supported
Embed(多语版) supported not-supported not-supported not-supported not-supported
嵌入 v4 supported not-supported not-supported not-supported not-supported
Rerank 3.5 supported not-supported not-supported not-supported not-supported

DeepSeek

模型名称 调用 Converse 聊天完成 响应 消息
DeepSeek V3.2* supported supported supported not-supported not-supported
DeepSeek-R1* supported supported not-supported not-supported not-supported
DeepSeek-V3.1* supported supported supported not-supported not-supported

Google

模型名称 调用 Converse 聊天完成 响应 消息
Gemma 3 12B IT* supported supported supported not-supported not-supported
Gemma 3 27B PT* supported supported supported not-supported not-supported
Gemma 3 4B IT* supported supported supported not-supported not-supported

Meta

MiniMax

模型名称 调用 Converse 聊天完成 响应 消息
MiniMax M2* supported supported supported not-supported not-supported
MiniMax M2.1* supported supported supported not-supported not-supported
MiniMax M2.5* supported supported supported not-supported

Mistral

登月

模型名称 调用 Converse 聊天完成次数 响应 消息
Kimi K2 Thinking* supported supported not-supported not-supported not-supported
基米 K2.5* supported supported supported not-supported not-supported

NVIDIA

OpenAI

您可以在同时开启响应 API 和聊天完成 API 的情况下使用此页面上的bedrock-mantle所有模型。有关详细信息,请参阅每张模型卡。

Qwen

稳定性

TwelveLabs

模型名称 调用 Converse 聊天完成 响应 消息
Marengo 嵌入 3.0 supported not-supported not-supported not-supported not-supported
Marengo 嵌入 v2.7 not-supported not-supported not-supported not-supported not-supported
Pegasus v1.2 supported not-supported not-supported not-supported not-supported

写入器

模型名称 调用 Converse 聊天完成 响应 消息
Palmyra Vision 7B supported supported supported not-supported
Palmyra X4* supported supported not-supported not-supported not-supported
Palmyra X5* supported supported not-supported not-supported not-supported

xAI

模型名称 调用 Converse 聊天完成次数 响应 消息
Grok 4.3 not-supported not-supported supported supported not-supported
Grok 4.6 supported supported supported supported not-supported

Z.AI

模型名称 调用 Converse 聊天完成 响应 消息
GLM 4.7* supported supported supported not-supported not-supported
GLM 4.7 闪存* supported supported supported not-supported not-supported
GLM 5* supported supported supported not-supported not-supported
注意

* 流媒体支持:标有星号 (*) 的模型也支持InvokeModelWithResponseStream,它以实时流的形式返回响应。

支持的模型 StartAsyncInvoke

StartAsyncInvoke 是一个亚马逊 Bedrock 运行时 API,它允许调用者提交模型调用请求并立即收到回的调用 ARN,无需等待模型完成处理。任务在后台运行,输出完成后将写入调用者指定的 S3 存储桶。然后,呼叫者可以使用配套 GetAsyncInvoke 和 ListAsyncInvokes API 轮询任务状态。该模式专为涉及大量或对延迟不敏感的输入的工作负载而构建,尤其是视频、音频和批量嵌入生成,在这些工作负载中,保持开放的同步连接是不切实际的。

就支持哪些型号而言,以下型号支持 StartAsyncInvoke:

  • TwelveLabs Marengo Embed 2.7 (twelvelabs.marengo-embed-2-7-v 1:0) — 视频和音频输入必需;仅处理文本和图像 InvokeModel

  • TwelveLabs Marengo Embed 3.0 (twelvelabs.marengo-embed-3-0-v 1:0) — 相同的模式;大规模需要异步 video/audio

  • 亚马逊 Nova Reel(amazon.nova-reel-v 1:0 和 v 1:1)— 视频生成完全是异步的;输出在 S3 中

  • 亚马逊 Nova 多模态嵌入(amazon.nova-2-multimodal-embeddings-v 1:0)— 大于 25MB base64 编码的视频输入需要异步;文本、图像和文档输入支持同步

InvokeModelWithBidirectionalStream

InvokeModelWithBidirectionalStream是一个 Amazon Bedrock Runtime API,它在调用者和模型之间建立持久的全双工信道,允许音频数据同时连续地双向流动。与遵循请求后响应模式的标准InvokeModel甚至 InvokeModelWithResponseStream API 不同,此 API 在会话期间保持连接处于打开状态,这样模型就可以在传入的音频到达时对其进行处理,并近乎实时地将生成的语音流回流,而无需等待完整的说话完成。交互分为三个阶段:会话初始化(客户端发送配置事件来设置流)、音频流(其中捕获的音频被编码并作为连续事件流发送)和响应流(其中模型同时返回用户语音的文本转录和合成音频输出)。InvokeModelWithBidirectionalStream不能与亚马逊 Bedrock API 密钥一起使用,并且需要基于标准的 AWS 凭证身份验证,这反映了与其他基岩运行时操作相比,其会话生命周期更为复杂。

以下模型支持此 API:

  • 亚马逊 Nova Sonic系列:amazon.nova-sonic-v 1:0 和 amazon.nova-2-sonic-v 1:0 都将其用作唯一的调用路径,因为语音转语音架构从根本上需要一个无论是匡威都无法提供的双向直播频道。 InvokeModel