View a markdown version of this page

Grok 4.7 - Amazon Bedrock

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

Grok 4.7

xAi 徽标。 xAi — Grok 4.7

模型详细信息

Grok 4.7 xAI 是前沿模型,专为编码、代理任务和知识工作而构建,支持文本和图像输入。它建立在前几代Grok的基础上,专注于长期运行的代理和更雄心勃勃的交互式工作。它提供了一个在输入和输出之间共享的 524,288 个令牌的上下文窗口,以及可配置的推理工作(低、中、高、xhigh)。

  • 模型发布日期:2026 年 9 月 28 日

  • EOL 不早于:2027 年 9 月 28 日

  • 遗产期:至少 6 个月

  • 模型生命周期策略:模型生命周期

  • 型号停产日期: N/A

  • 最终用户许可协议和使用条款:查看

  • 模型生命周期:活跃

  • 上下文窗口:524,288 个标记,在输入和输出之间共享

  • 最大输出令牌:524,288 减去输入标记

  • 推理:支持(可配置:低、中、高、xhigh)

输入模式 输出模式 支持的 API 支持的终端节点
Red circle with white X icon indicating error, cancel, or close action.音频Red circle with white X icon indicating error, cancel, or close action.嵌入Green circle with white checkmark icon. ResponsesGreen circle with white checkmark icon. bedrock-runtime
Green circle with white checkmark icon.图片Red circle with white X icon indicating error, cancel, or close action.图片Green circle with white checkmark icon. Chat CompletionsRed circle with white X icon indicating error, cancel, or close action. bedrock-mantle
Red circle with white X icon indicating error, cancel, or close action.演讲Red circle with white X icon indicating error, cancel, or close action.演讲Green circle with white checkmark icon. Converse
Green circle with white checkmark icon.文本Green circle with white checkmark icon.文本Green circle with white checkmark icon. Invoke
Red circle with white X icon indicating error, cancel, or close action.视频Red circle with white X icon indicating error, cancel, or close action.视频

功能和特点

基岩特征

使用bedrock-runtime端点支持的功能

支持的 不支持

定价

下表按推理选项显示了 Grok 4.7 的按需定价。

推理选项 输入 输出 缓存读取
Geo CRIS2.206.60 美元0.55 美元
全球CRIS2.006.00 美元0.50 美元

所有价格均为每100万个代币。显示的定价适用于标准套餐。

优先级和弹性层级支持:除标准版外,Grok 4.7 还支持Responses、Chat Completions和 Invoke API 上的优先级和弹性服务层。Converse API 仅支持此型号的标准级别;请求priority或flex通过 Converse 返回验证错误。优先级按标准每代币费率的 1.75倍(溢价75%)计费,Flex按标准费率的 0.5倍(50%的折扣)计费。将这些乘数应用于上面显示的标准费率。有关每个服务层级的详细信息,请参阅服务等级。

以编程方式访问

使用以下模型 ID 和端点 URL 以编程方式访问此模型。有关可用 API 和终端节点的更多信息,请参阅支持的 API 和支持的终端节点。

Endpoint 型号标识 In-Region 端点网址 地理推理 ID 全局推理 ID
bedrock-runtime xai.grok-4.7 不支持 us.xai.grok-4.7 global.xai.grok-4.7

打开bedrock-runtime,基本网址为 “https://bedrock-runtime.{region} .amazonaws。 com/openai/v1 “和请求必须将地理跨区域推理 ID us.xai.grok-4.7 或全球跨区域推理 ID 命名为模型。global.xai.grok-4.7

服务等级

Amazon Bedrock 提供多个服务等级,以满足您的工作负载要求。标准版提供按令牌付费的访问权限,无需承诺(设置"service_tier": "default"或省略该字段)。P@@ ri ority 以更高的价格(套装"service_tier": "priority")提供更快、按优先顺序排列的处理。Flex 为灵活、非时间敏感型工作负载(套装)提供低成本的访问权限。"service_tier": "flex"对于此模型,Priority 和 Flex 仅在ResponsesChat Completions、和 Invoke API 上可用,Converse API 仅支持标准版。有关更多信息,请参阅服务等级。

Standard 优先级 Flex 已保留
Green circle with white checkmark icon. Green circle with white checkmark icon. Green circle with white checkmark icon. Red circle with white X icon indicating error, cancel, or close action.

区域可用性

地区供应情况一览

Amazon Bedrock 提供三种推断选项:将请求In-Region保留在单个区域内以严格合规;在尊重数据驻留的情况下跨地理区域(例如美国、欧盟和亚太地区)进行地理 Cross-Region路由;以及没有居住限制的全球任何地方的全球路由。 Cross-Region有关更多详细信息,请参阅该各型号的地区供货情况页面。

Grok 4.7 可在bedrock-runtime终端上使用 Grok 4.7,使用地理(美国)和全球跨区域推理。下表按地区显示了可用性。

区域 In-Region Geo Global
us-east-1(弗吉尼亚北部)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Green circle with white checkmark icon.
us-east-2(俄亥俄州)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Green circle with white checkmark icon.
us-west-1(加利福尼亚北部)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Green circle with white checkmark icon.
us-west-2(俄勒冈州)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Green circle with white checkmark icon.
ca-central-1(加拿大)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Green circle with white checkmark icon.
ca-west-1(卡尔加里)Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.
eu-north-1(斯德哥尔摩)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-west-1(爱尔兰)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-west-2(伦敦)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-west-3(巴黎)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-central-1(法兰克福)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-central-2(苏黎世)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-south-1(米兰)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
eu-south-2(西班牙)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-northeast-1(东京)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-northeast-2(首尔)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-northeast-3(大阪)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-south-1(孟买)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-south-2(海得拉巴)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-1(新加坡)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-2(悉尼)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-3(雅加达)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-4(墨尔本)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-5(马来西亚)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-southeast-7(泰国)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
ap-east-2(台北)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
me-central-1(阿联酋)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
il-central-1(特拉维夫)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
sa-east-1(圣保罗)Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.
us-gov-east-1(AWS GovCloud (US-East))Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.
us-gov-west-1(AWS GovCloud (US-West))Red circle with white X icon indicating error, cancel, or close action.Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.

地理推断详情

地理推理配置文件可用的目标区域取决于源区域。要检索当前的路由配置,请GetInferenceProfile从来源区域致电。

地理位置:美国

地理推断 ID:us.xai.grok-4.7

来源区域 目的地区域
us-east-1(弗吉尼亚州北部)us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-2(俄勒冈州)
us-east-2(俄亥俄州)us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-2(俄勒冈州)
us-west-1(加利福尼亚北部)us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-1(加利福尼亚北部)、us-west-2(俄勒冈州)
us-west-2 (俄勒冈)us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-2(俄勒冈州)
ca-central-1(加拿大)ca-central-1(加拿大)、us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-2(俄勒冈州)
ca-west-1(卡尔加里)ca-west-1(卡尔加里)、us-east-1(弗吉尼亚北部)、us-east-2(俄亥俄州)、us-west-2(俄勒冈州)

配额和限制

您的 AWS 账户具有默认配额,以保持服务性能并确保适当使用 Amazon Bedrock。分配给账户的默认配额可能会根据地区因素、付款历史记录、欺诈性使用情况、增加配额请求的 and/or 批准而更新。有关更多信息,请参阅Amazon Bedrock 的配额文档并查看模型的限制。

示例代码

第 1 步- AWS 账户:如果您已经有 AWS 账户,请跳过此步骤。如果您不熟悉 AWS,请注册 A WS 账户。

第 2 步-API 密钥:前往 Amazon Bedrock 控制台生成长期 API 密钥。

将 OpenAI-compatible SDK 与 xAi   模型

Grok 4.7 就是一个xAI模型。Amazon Bedrock 通过 OpenAI-compatible 终端节点提供其响应和聊天完成 API,因此这些示例使用 OpenAI Python SDK 作为客户端。使用您的亚马逊 Bedrock API 密钥和亚马逊 Bedrock 基本 URL 配置软件开发工具包,如下所示。这些请求在 Amazon Bedrock 上调用xAI模型,但不会发送到 OpenAI。

第 3 步-获取 SDK:要使用本入门指南,必须已安装 Python。然后根据您使用的 API 安装相关软件。

Responses API / Chat Completions API
pip install openai
Converse API
pip install boto3

第 4 步-设置环境变量:将您的环境配置为使用 API 密钥进行身份验证。

bedrock-runtime
OPENAI_API_KEY="<provide your Bedrock API key>" OPENAI_BASE_URL="https://bedrock-runtime.us-east-1.amazonaws.com/openai/v1"
Cross-Region 需要推理配置文件

开启bedrock-runtime,将跨区域推理配置文件命名为模型,或者us.xai.grok-4.7。global.xai.grok-4.7此模型不适用于该终端节点上的区域内推理。除了推理配置文件外,您的 IAM 身份还需要bedrock:InvokeModel在账户的默认项目 (arn:aws:bedrock:{region}:{account-id}:project/default) 中。

第 5 步-运行您的第一个推理请求:将文件另存为 bedrock-first-request.py

Responses API (bedrock-runtime)
from openai import OpenAI client = OpenAI() response = client.responses.create( model="us.xai.grok-4.7", input="Can you explain the features of Amazon Bedrock?" ) print(response)
Chat Completions API (bedrock-runtime)
from openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="us.xai.grok-4.7", messages=[ {"role": "user", "content": "Can you explain the features of Amazon Bedrock?"} ] ) print(response)
Converse API (bedrock-runtime)
import boto3 client = boto3.client("bedrock-runtime", region_name="us-east-1") response = client.converse( modelId="us.xai.grok-4.7", messages=[ {"role": "user", "content": [{"text": "Can you explain the features of Amazon Bedrock?"}]} ] ) print(response)

使用注意事项和限制

  • 推理工作-默认情况下,推理始终处于活动状态。您可以通过reasoning参数配置工作量:"low"、"medium"、"high"(默认)或"xhigh"。推理内容经过加密,可以通过传入 Respons include: ["reasoning.encrypted_content"] es API 请求来返回。你可以在后续回合中将加密的内容发送回去,为多回合对话提供推理背景。聊天完成 API 不返回推理标记。

    response = client.responses.create( model="us.xai.grok-4.7", reasoning={"effort": "high"}, include=["reasoning.encrypted_content"], input="Explain quantum entanglement simply." ) print(response.output_text)