View a markdown version of this page

API 相容性 - Amazon Bedrock

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

API 相容性

Amazon Bedrock 支援四個執行時間 APIs 系列,每個系列都專為不同的整合模式和使用案例而設計。

調用 系列InvokeModel處理同步、單一回應的呼叫。 會以即時串流的形式InvokeModelWithResponseStream傳回回應。 InvokeModelWithBidirectionalStream 會啟用互動式應用程式的全雙工串流。 會以非同步方式AsyncInvoke提交長時間執行的請求,將輸出儲存到 Amazon S3。

Converse 系列: 為同步多轉對話Converse提供統一、模型無關的界面。 ConverseStream提供與串流輸出相同的體驗。

OpenAI 相容系列ChatCompletions實作 OpenAI 聊天完成介面,讓現有的 OpenAI 型整合能夠在 Bedrock 上執行,且變更最少。 ResponsesAPI 實作 OpenAI 回應界面,支援與內建工具使用和對話歷史記錄管理的狀態代理互動。

訊息系列: 會在bedrock-mantle端點上Messages實作 Anthropic Messages 介面,讓現有的 Anthropic SDK 型整合能夠在 Bedrock 上執行,且變更最少。

現在,我們將查看每個模型支援的 APIs 清單。

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 English supported not-supported not-supported not-supported not-supported
Embed Multilingual 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* 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 思維* supported supported not-supported not-supported not-supported
Kimi K2.5* supported supported supported not-supported not-supported

NVIDIA

OpenAI

您可以使用此頁面上的所有模型搭配 上的回應 API 和聊天完成 APIbedrock-mantle。如需詳細資訊,請參閱每個模型卡。

Qwen

穩定性

TwelveLabs

模型名稱 調用 Converse 聊天完成 回應 訊息
Marengo 內嵌 3.0 supported not-supported not-supported not-supported not-supported
Marengo Embed 2.7 版 not-supported not-supported not-supported not-supported not-supported
Pegasus 1.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 是一種 Amazon Bedrock 執行期 API,可讓發起人提交模型調用請求,並立即收到 invocationArn,而無需等待模型完成處理。任務會在背景執行,一旦完成,輸出就會寫入呼叫者指定的 S3 儲存貯體。然後,來電者可以使用配套 GetAsyncInvoke 和 ListAsyncInvokes APIs輪詢任務狀態。此模式專為涉及大型或延遲不敏感輸入的工作負載而打造,特別是產生視訊、音訊和大量內嵌,其中保持開放同步連線並不切實際。

就支援它的模型而言,下列模型支援 StartAsyncInvoke:

  • TwelveLabs Marengo Embed 2.7 (twelvelabs.marengo-embed-2-7-v1:0) — 視訊和音訊輸入需要;InvokeModel 僅處理文字和影像

  • TwelveLabs Marengo Embed 3.0 (twelvelabs.marengo-embed-3-0-v1:0) — 相同模式;大規模視訊/音訊需要非同步

  • Amazon Nova Reel (amazon.nova-reel-v1:0 和 v1:1) — 影片產生完全非同步;輸出登陸 S3

  • Amazon Nova 多模態內嵌 (amazon.nova-2-multimodal-embeddings-v1:0) — 大於 25MB base64 編碼的視訊輸入需要非同步;同步適用於文字、影像和文件輸入

InvokeModelWithBidirectionalStream

InvokeModelWithBidirectionalStream 是一種 Amazon Bedrock 執行期 API,可在發起人和模型之間建立持久的全雙工通道,允許音訊資料同時且持續地雙向流動。與遵循 request-then-response 模式的標準InvokeModel甚至 InvokeModelWithResponseStream APIs 不同,此 API 會在工作階段期間保持連線開啟,以便模型可以在傳入音訊到達時處理,並近乎即時地將產生的語音串流回去,而無需等待完整的表達用語完成。互動分為三個階段: 工作階段初始化 (用戶端傳送組態事件以設定串流)、音訊串流 (擷取的音訊已編碼並做為連續事件串流傳送) 和回應串流 (其中模型同時傳回使用者語音和合成音訊輸出的文字轉錄)。 InvokeModelWithBidirectionalStream 無法與 Amazon Bedrock API 金鑰搭配使用,且需要標準 AWS 憑證型身分驗證,反映了相較於其他 Bedrock 執行期操作更複雜的工作階段生命週期。

下列模型支援此 API:

  • Amazon Nova Sonic 系列:amazon.nova-sonic-v1:0 和 amazon.nova-2-sonic-v1:0 都使用它作為唯一的調用路徑,因為speech-to-speech架構基本上需要 InvokeModel 和 Converse 都無法提供的即時雙向通道。