Kimi Code CLI v2.7.0 Adds a Native Amazon Bedrock Provider: Use Your AWS Credentials Instead of a Separate API Key
AWS says Moonshot AI added a native bedrock provider in Kimi Code CLI v2.7.0, letting you call Amazon Bedrock models with the AWS credential chain (including named profiles and SSO) without managing separate Bedrock API keys.
News date: About 6 min read
Contents
AWS says in its blog that Kimi Code CLI, the open-source coding agent from Moonshot AI, added a native bedrock provider in v2.7.0. A provider is the connection setting the CLI uses to reach a model service. To use it, upgrade to v2.7.0 or later. Model inference on Amazon Bedrock is billed by token usage, where a token is a small chunk of text the model reads or writes. The biggest change is that you can reuse the AWS credential chain directly. The credential chain is the standard order in which AWS tools look for sign-in information, and it includes named profiles (pre-named sets of account settings in the AWS CLI) and SSO (single sign-on). For developers already working on AWS, that means one less separate Bedrock API key to manage. You are still responsible for protecting your credentials and limiting permissions.
How does this update differ from the earlier setup?
AWS explains that older versions needed three things: a provider of type openai or openai_responses, a regional base_url, and a short-term or long-term Amazon Bedrock API key. The new native provider resolves temporary credentials through the standard AWS CLI credential chain. It also infers the API format and regional endpoint from the model ID, and you can override the protocol per model when needed.
The provider works in four steps: 1. It resolves your AWS credentials. 2. It uses @aws/bedrock-token-generator to create a short-lived Bedrock API key and renews it as needed. 3. It builds the bedrock-runtime endpoint from AWS_REGION or AWS_DEFAULT_REGION. 4. It calls the selected inference profile, the setting that determines which model and routing a request goes to. AWS says that if you explicitly supply a key via api_key or api_key_env, that key takes precedence.
| Item | Old approach | v2.7.0 native bedrock provider |
|---|---|---|
| Provider type | openai or openai_responses | bedrock |
| Authentication | Amazon Bedrock API key (short-term or long-term) | Standard AWS credential chain; named profiles and SSO supported |
| Endpoint setup | Regional base_url set manually | Inferred from AWS_REGION and model ID; can be overridden with protocol and base_url |
| Key management | Must be obtained and protected separately | Short-lived keys generated automatically, up to 12 hours or the session length |
What are the prerequisites, and how do you get started?
AWS lists these prerequisites: - An AWS account with access to the target model and inference profile. - Kimi Code CLI v2.7.0 or later. - The AWS CLI, v2.32.0 or later if you use the optional aws login. - An IAM identity permitted to call the target model and inference profile. IAM is the AWS service for managing users, roles and permissions. AWS also recommends granting permissions on the principle of least privilege and considering a dedicated IAM role for Kimi Code CLI.
The AWS article describes three steps: 1. Set up AWS credentials and confirm your identity. 2. Edit ~/.kimi-code/config.toml to add the provider and model. If KIMI_CODE_HOME is set, edit $KIMI_CODE_HOME/config.toml instead. 3. Send a test request. The commands and configuration from the article are below.
kimi --version
aws sts get-caller-identity --profile YOUR_PROFILE_NAME
kimi --model bedrock-kimi-k3-1 --prompt "Write a Python function that checks whether a string is a palindrome. Include a short usage example."default_model = "bedrock-kimi-k3-1"
[providers.bedrock]
type = "bedrock"
[providers.bedrock.env]
AWS_REGION = "YOUR_SOURCE_REGION"
# AWS_PROFILE = "YOUR_PROFILE_NAME"
[models.bedrock-kimi-k3-1]
provider = "bedrock"
model = "global.moonshotai.kimi-k3.1"
max_context_size = 1000000
capabilities = ["always_thinking", "thinking", "image_in", "tool_use"]If you already have a configuration file, AWS advises backing it up and merging the new entries rather than overwriting it. In interactive sessions, AWS also recommends reviewing the file edits and shell commands the agent proposes before approving them.
What limitations and cautions apply?
AWS notes that at the time of writing, the provider-creation interface in the Kimi Code desktop and web apps does not expose all the environment fields this credential chain setup needs. You must edit config.toml directly. The bedrock provider also requires an explicit AWS_REGION or AWS_DEFAULT_REGION. It cannot infer one from ~/.aws/config or aws configure.
Kimi Code does not auto-detect the capabilities of most models on Bedrock, so you must check the model card and declare them yourself. AWS says Kimi K3.1 Pro Highspeed supports always_thinking, thinking, image_in and tool_use, but not audio_in or video_in. AWS recommends testing your own tool and image workflows. On cost, AWS says global inference is 10% cheaper than geographic-region profiles and suits workloads without data residency requirements. See the Amazon Bedrock pricing page for actual rates.
FAQ
Do I still need an Amazon Bedrock API key?
According to AWS, you do not need to put AWS access keys or a manually generated Bedrock key in config.toml, because the provider generates short-lived keys automatically. However, if you explicitly supply a key via api_key or api_key_env, that key takes precedence.
What costs will I incur?
AWS says inference for these models on Amazon Bedrock is billed per token, and there is no persistent cloud infrastructure to clean up. Before using it, check the Amazon Bedrock pricing page for expected costs.
Can I use a different protocol or a VPC endpoint?
AWS says yes. In config.toml, set protocol to openai, openai_responses or anthropic. Then use base_url to specify the target URL, which must include a path such as /openai/v1 or /anthropic. The AWS blog shows an example that uses the OpenAI Responses API through a VPC endpoint. Check each model's card to see which APIs it supports.
How long do the temporary keys last?
AWS says the temporary API keys the provider generates are valid for up to 12 hours or the length of the AWS session, whichever is shorter.
Which AWS Regions can I use it in?
AWS does not list specific Regions. It says you must have access to the model and inference profile in a supported source Region. Check the Kimi K3.1 Pro Highspeed model card for current Region and inference profile support.
Browse the latest news in this topic
Found this guide helpful? Share it with someone who needs it
Claude Code 2.1.329: Code Mode Works With Telemetry, /tasks Lists Scheduled Tasks, macOS Computer Use Gets Stricter Safety Rules
Anthropic's changelog lists Claude Code 2.1.329, covering Code Mode behavior changes, new diagnostics in /tasks and /mcp, /code-review changes, and new safety rules for macOS computer use.
AWS Rounds Up 13 SageMaker Inference Features: Managed NVIDIA Dynamo on HyperPod, MIG GPU Partitioning, Cross-Region Routing
BMW Group Shares How It Governs AI Agents: 12,500+ Developers, Three Autonomy Levels and a Four-Stage CI/CD Gate
Amazon SageMaker AI Now Monitors vLLM GPU Inference Endpoints by Default: Latency Drift, Idle GPUs and Missed Optimizations
Sources
Compiled from the references and verification dates listed above; fares, schedules, product features, and terms can change, so please confirm the latest details on the relevant official website before travelling, booking, or purchasing.