中
◀ Back to feed
AWS

在 Amazon Bedrock 上使用 Kimi Code CLI(11 月 19 日)

Published 2026-11-19 Collected 2026-11-20 20:00 AI news #ai
Full text

Use Kimi Code CLI with models on Amazon Bedrock

Kimi Code CLI is an open source coding agent from Moonshot AI, the creator of the Kimi series of open-weight foundation models. Previously, using Kimi Code with models on Amazon Bedrock meant configuring a generic connection “provider” with an Amazon Bedrock API key. For many AWS customers, this meant introducing an extra credential to obtain and protect.

With v2.7.0, Moonshot AI adds a native bedrock provider to the CLI. You can now configure the agent to use your standard AWS credential chain, including named profiles and single sign-on (SSO), instead of creating and managing a separate API key.

In this post, we show you how to connect Kimi Code CLI to models on Amazon Bedrock using your existing AWS credentials. We use Kimi K3.1 Pro Highspeed as an example, which supports streaming, configurable reasoning, image input, and client-side tool calling.

What’s new

Amazon Bedrock provides pay-per-token inference for a range of open and proprietary models from leading providers, available through standard APIs. Processing stays within the AWS data boundary, as detailed in the Data protection section of the User Guide. The model cards detail which APIs and features are supported for each model.

In older versions of the Kimi Code CLI, you could connect to Amazon Bedrock through a provider with type = "openai" or type = "openai_responses". These use the OpenAI-compatible Chat Completions or Responses APIs, respectively. This approach required you to set the regional base_url and provide an Amazon Bedrock API key. The key could be short-term or long-term, but it was a separate credential for you to obtain and manage.

The native provider changes that setup:

  • Use your existing AWS authentication workflow. The bedrock provider can resolve temporary credentials through the standard AWS Command Line Interface (AWS CLI) credential chain. You can use the default chain or select a named profile, including a profile backed by SSO.
  • Override the protocol for each model, if needed. The provider infers an API format and regional endpoint from the model ID, but you can change them as detailed in the “Override endpoint URL and protocol” section of this post.

AWS recommends short-term credentials over long-term credentials. This new path reduces reliance on manually managed API keys, but it doesn’t change your responsibility to protect AWS credentials and scope permissions appropriately.

How it works

The native provider handles authentication and request routing in four steps:

  1. Resolve AWS credentials. Unless you configure an Amazon Bedrock API key, the bedrock provider uses the standard AWS credential chain in your environment. You can set AWS_PROFILE to select a specific named profile.
  2. Generate a short-lived bearer token. The provider uses @aws/bedrock-token-generator to create a short-term Amazon Bedrock API key, and renews it when necessary. You don’t need to place any AWS access key or manually generated Amazon Bedrock key in the Kimi Code config.toml. However, an explicit key given through api_key or api_key_env takes precedence if you provide it.
  3. Build the regional endpoint. The provider resolves AWS_REGION or AWS_DEFAULT_REGION and constructs the appropriate bedrock-runtime endpoint for the model’s inferred API. For Kimi models, this resolves to the recommended OpenAI-compatible Chat Completions path.
  4. Call the selected inference profile. The model alias maps to an Amazon Bedrock model or inference profile ID. This example uses the global inference profile global.moonshotai.kimi-k3.1. The global. prefix selects the profile, while AWS_REGION determines the regional endpoint that receives your request.

The CLI then streams the model response and can use the model’s client-side tool-calling support during coding tasks. Authentication, authorization, model access, and network connectivity must all succeed for a request to complete. The ephemeral API keys generated by the provider are valid for up to 12 hours or your AWS session length, whichever is shorter.

Prerequisites

For this walkthrough, we use Kimi K3.1 Pro Highspeed as an example model, accessed through global cross-Region inference for broadest availability and lowest cost. Review the Amazon Bedrock pricing to understand expected costs before using the model.

To follow along, you need:

  • An AWS account with access to the target model and inference profile in a supported source AWS Region. Check the Kimi K3.1 Pro Highspeed model card for current Region and inference-profile support.
  • Kimi Code CLI v2.7.0 or later. Follow the Kimi Code CLI installation guide and run kimi --version to check your installation.
  • The AWS CLI, to follow the profile and identity-check commands in this post. The optional aws login workflow requires AWS CLI v2.32.0 or later.
  • An AWS Identity and Access Management (IAM) identity (user or assumed role) with permissions to invoke the target model and inference profile in your chosen AWS Region.

The following example IAM policy grants the permissions used by this walkthrough, for the Kimi K3.1 Pro Highspeed model and global inference profile only. Replace ${AWS_REGION} with your source Region (for example, us-west-2 for US West Oregon) and ${AWS_ACCOUNT_ID} with your 12-digit AWS account ID:

The foundation-model ARN without a Region or account ID is intentional and required for global cross-Region routing. The BedrockInvokeKimiK31DefaultProject statement is only required if using the openai_responses protocol, not with the default openai (Chat Completions).

Security of your AWS environment is a shared responsibility. Review and grant IAM permissions according to the principle of least privilege, particularly for production environments. Consider using a dedicated IAM role for Kimi Code CLI, separate from your regular AWS activities.

Get started with the bedrock provider

After your prerequisites are ready, follow these steps to configure AWS authentication, add the provider and model, and send a test request.

Step 1: Configure AWS credentials

There are different ways to authenticate with the AWS CLI, depending on your organization’s setup. With Named profiles, you can configure multiple AWS contexts and switch between them.

For example:

  • If you use SSO through AWS IAM Identity Center, run aws configure sso --profile YOUR_PROFILE_NAME to set up a profile, then run aws sso login --profile YOUR_PROFILE_NAME to authenticate.
  • To use AWS Management Console credentials with AWS CLI v2.32.0 or later, run aws login --profile YOUR_PROFILE_NAME. The console-credential login guide also describes a credential_process configuration for tools that don’t support the cached login session directly.
  • Omit the --profile arguments to use your default AWS profile instead of a named one.

Whichever approach you choose, your session resolves to an IAM identity (user or role) that needs the Amazon Bedrock permissions from the prerequisites. A Region configured in an AWS CLI profile applies to AWS CLI commands, but you must still set the Region explicitly for Kimi Code in Step 2.

Verify that the AWS CLI resolves your intended identity. Omit --profile YOUR_PROFILE_NAME if you use the default profile:

Step 2: Add the provider and model

  1. Open or create ~/.kimi-code/config.toml in a text editor. If you set KIMI_CODE_HOME, use $KIMI_CODE_HOME/config.toml instead. If you have an existing file, back it up and merge these entries with your current settings rather than overwriting unrelated providers or models.
  2. Replace YOUR_SOURCE_REGION with your supported source Region (for example, us-west-2). To use a named profile, replace YOUR_PROFILE_NAME and uncomment the AWS_PROFILE line: The model alias bedrock-kimi-k3-1 is a local name used by Kimi Code CLI. The model value is the Amazon Bedrock global inference-profile ID. The example declares a 1-million-token context window and explicit reasoning, image-input, and tool-use capabilities. It omits api_key, api_key_env, and AWS_BEARER_TOKEN_BEDROCK, so the provider uses ambient AWS credentials. A configured Amazon Bedrock key would take precedence.
  3. Save the file. The [providers.bedrock.env] table supplies configuration to the provider. It doesn’t export variables into your shell.

Step 3: Send a request and start a coding session

  1. Run a small non-interactive coding request:

  2. Confirm that the CLI streams a response without an authentication, authorization, Region, model-access, or network error. This request provides a more meaningful connectivity check than a provider status indicator.

  3. Start an interactive session in a project directory:

      Because you set `default_model`, the session selects `bedrock-kimi-k3-1` automatically. Ask the agent to explain the repository or propose a small change. Review its proposed file modifications and shell commands before approving them.
    

Configuration best practices

At the time of writing, the native bedrock provider has several configuration considerations. These practices help you avoid ambiguous status information and mismatched settings.

Use the configuration file to set up the provider

At the time of writing, Kimi Code’s desktop and web provider-creation interfaces don’t expose all the provider environment fields used by this credential-chain setup. Edit config.toml directly to set up the Amazon Bedrock provider. For further details, refer to Model providers in the Kimi Code documentation.

Declare model capabilities explicitly

Kimi Code doesn’t auto-detect the capabilities of most models on Amazon Bedrock, including Kimi models. Check the Amazon Bedrock model card for each target model and explicitly declare its capabilities to let Kimi Code make use of them.

For example, Kimi K3.1 Pro Highspeed supports always_thinking, thinking, image_in, and tool_use, but not audio_in or video_in, as reflected in the config.toml example shown earlier.

These declarations describe client behavior. You should only include capabilities that are supported for each target model and Amazon Bedrock API endpoint. Validate tool and image workflows for your application rather than relying on the capability labels alone.

Keep Region settings consistent and prefer cross-Region inference where possible

The bedrock provider requires an explicit AWS_REGION or AWS_DEFAULT_REGION in Kimi Code’s config.toml or the shell environment. It can’t infer a Region configured only in ~/.aws/config or through aws configure.

When you use cross-Region inference profiles (with prefixes such as global., us., or in.), the configured Kimi Code Region controls the source Region that receives your requests. For more information, refer to cross-Region inference in the Amazon Bedrock User Guide.

For workloads without data-residency requirements, start with the global inference profile. This model, like many others, is priced 10% lower for global inference than through geographic profiles. Review Amazon Bedrock pricing for current rates and geographic alternatives.

Override endpoint URL and protocol where needed

In some cases, the provider’s auto-detection might mistake the API protocol or target URL you want to use for a particular model. For example, you will need to set a different URL to use Amazon Bedrock through a VPC endpoint or the Mantle endpoints.

In the Kimi Code config.toml, you can:

  • Set the protocol field to openai (Chat Completions), openai_responses, or anthropic (Messages) to configure a model to use a particular supported wire protocol. See the model cards for which models support which APIs.
  • Set the base_url field to change the target URL, which must include any attached API path like /openai/v1 or /anthropic.

In the following example, we show a configuration to connect to the same model but using the OpenAI Responses API through an Amazon Bedrock VPC endpoint you’ve set up:

Treat connectivity status as a configuration indicator

In the Kimi Code desktop and web apps, the provider list can show connected for a bedrock provider. That status doesn’t validate the configured AWS credentials, IAM permissions, Region, model access, or network path. Don’t treat it as proof of a successful model request. Use the non-interactive prompt to test the complete path, and diagnose the actual response if it fails.

Cleanup

If you created a new AWS IAM identity or assigned new permissions to experiment with Kimi K3.1 Pro on Amazon Bedrock, remember to delete them when you’re finished testing.

You might also want to revert any local Kimi Code CLI provider configurations or AWS CLI profiles you set up. You can even uninstall the CLIs altogether if they’re no longer required. See the uninstall guides for Kimi Code and AWS CLI for details. Remember that deleting the local AWS configuration or CLI doesn’t by itself revoke IAM permissions or an active AWS session.

Amazon Bedrock inference for the models we showed is charged on a per-token basis, so there’s no persistent cloud infrastructure deployment to clean up.

Conclusion

We showed how Moonshot AI’s native bedrock provider in Kimi Code CLI v2.7.0 connects to Kimi K3.1 Pro Highspeed on Amazon Bedrock through the standard AWS credential chain. You no longer need a separately managed Amazon Bedrock API key.

Amazon Bedrock gives you access to open and proprietary AI models from leading providers, through standard APIs. Its governance controls and compliance validation programs can support even strictly regulated workloads.

If you’re already using Kimi Code CLI and want to run inference on AWS, upgrade today and give the new streamlined authentication a try.

For more information about Kimi K3.1 Pro on Amazon Bedrock, see our launch blog post and the Moonshot AI on AWS samples repository. To explore supported APIs and features by model, see the model cards in the Amazon Bedrock User Guide. To discuss your use case with the Amazon Bedrock team, connect with us.

Source
Title
在 Amazon Bedrock 上使用 Kimi Code CLI(11 月 19 日)
Author
—
Site
AWS
Published
2026-11-19
Collected
2026-11-20 20:00 · 2026-11-20-20-ai.json
Link
https://aws.amazon.com/blogs/machine-learning/use-kimi-code-cli-with-models-on-amazon-bedrock/
Open original ↗

Reposted. Will be removed on request. All rights belong to the original author.

More from this batch

20:00batch · 2026-11-2012 items
>

Anthropic IPO live updates: ANT stock price and Nasdaq debut

这是上次推送之后最重要的进展:股票于 11 月 19 日开盘 111.50 美元,收盘 97.17 美元,较 83 美元发行价上涨约 17%。Yahoo Finance 记录当日最高 115.10、最低 92.72 美元,成交约 8.53 亿股。CNBC 称本次发行筹资 813 …

CNBC
>

Has DeepSeek's 100-billion-yuan round landed? 31 investors come into view

第一财经 11 月 19 日 16:23 报道(上一期 20:07 推送前已刊出,本期补录),企查查显示杭州深度求索注册资本由约 1645 万元增至 1991.87 万元,新增股东杭州程砚;该平台同期新增 31 家合伙人,腾讯与宁德时代体系出资比例并列前列,另有中国移动、中信证券…

第一财经
>

The Information:英伟达接近以逾 5 亿美元收购扩散模型公司 Inception(报道,尚未宣布)

多家媒体转述 The Information 的报道称,英伟达正与 Inception(Mercury 扩散语言模型团队)进行后期洽谈,对价至少约 5 亿美元,还可能包含业绩对赌;交易尚未签署或官宣,报道称创始团队将加入英伟达。这仍是独家报道,不是双方声明。

The Information
>

苹果被曝在招人,要做能操控 Mac 的自有 AI 智能体(11 月 19 日)

TechCrunch 和 The Verge 根据招聘信息报道,苹果可能在开发一款可在 Mac 上运行、帮用户完成电脑操作的自有智能体。这还不是产品发布,只是招聘与报道层面的线索,细节以苹果之后的正式说明为准。

TechCrunch
>

谷歌开始把 AI 对话直接放上搜索首页(11 月 19 日)

The Verge 报道,谷歌正在把 AI 聊天入口放到搜索首页,而不只是藏在搜索结果里的 AI 模式中。具体覆盖范围和是否可关闭,请以谷歌产品说明和原文为准。

The Verge
>

薯片袋触发校园枪支警报后,两名学生起诉学校和警方(11 月 19 日)

Ars Technica 报道,美国一起校园 AI 武器检测误报导致两名青少年被警察制服,两人已提起诉讼。这是公共场所视觉识别落地时误报代价的一个具体案例,细节以诉状和报道为准。

Ars Technica
>

Introducing Tool Retrieval in the Gemini API

谷歌官方介绍,当应用挂了大量工具时,模型不必每次都看完整工具列表,而是先检索可能相关的工具再决定调用。这对工具很多的企业 Agent 有直接意义:可以降低提示开销,也减少无关工具干扰。能力边界和配额以官方文档为准。

Google
>

Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth

上一期未收入。苹果机器学习研究放出 Depth Pro 2,可从照片、视频或实时画面估计以米为单位的深度,并强调物体边缘更锐、帧间更稳定。仓库提供 S/B/L/H+ 等多档模型及 Core ML 包,权重为研究用途。论文编号 arXiv:2611.26603。

arXiv
>

NVIDIA 介绍用 Dynamo 缓解强化学习 rollout 瓶颈(11 月 19 日)

官方技术博客讨论在强化学习训练里,生成轨迹(rollout)常常卡住吞吐。文章介绍如何用 NVIDIA Dynamo 把这部分流水线理顺,让训练不必长时间等采样。适合正在做 RL 后训练或智能体强化学习的团队对照自己的栈。

NVIDIA
>

NVIDIA:用 GPU 原生数据采集,让科学仪器能跑实时 AI(11 月 19 日)

官方博客介绍把科学仪器的数据采集直接放到 GPU 上处理,减少数据搬运,从而在实验现场做实时推理。这对同步辐射、显微镜或探测器一类场景有参考价值,不是面向普通聊天应用的更新。

NVIDIA
>

Science 观察 Agent AlphaXiv:35 个实验室放出 936 个智能体,12 周写出 936 篇预印本(11 月 19 日)

《Science》11 月 19 日下午的特稿记录了一场为期 12 周的实验:35 个人类实验室部署的智能体在专属预印本服务器上互相交流、写代码、做实验并发布 936 篇研究,还自建了同行评议期刊。文章提醒这些是预印本而非传统期刊论文,质量参差,但提供了一个观察「智能体科研社区」…

Science
>

Claude solves two open problems in the physics of black holes

官方文章署期 11 月 17 日,上一期未收入;本期 Hacker News 讨论升温。Anthropic 称 Claude Fable 5.2 完成了两项与量子引力和黑洞有关的计算:其一补完了 2003 年提出但一直未做完的相变计算,显示黑洞形成对应的突变在时空不再有明确形状时…

Anthropic