explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR: what you need to know
  • What was the old setup and why change it?
  • How does the provider work?
  • What do I need before starting?
  • Step by step setup
  • What are the gotchas?
  • Cost: why global is the default suggestion
  • Using a VPC endpoint or a different protocol
  • How does this compare with other coding agents on Bedrock?
  • What searchers are asking
  • Troubleshooting checklist
  • Security review before a team rollout
  • What is not covered
  • Related reading
← Back to blog

explainx / blog

Kimi Code CLI 2.7 Native Bedrock Provider: Use AWS SSO Instead of an API Key

Kimi, Amazon Bedrock, Coding Agents, AWS, Moonshot AI

Part of AI Coding Tools

Kimi Code CLI v2.7.0 adds a native bedrock provider. Use AWS profiles or SSO with Kimi K3.1 Pro Highspeed, config.toml, IAM policy and gotchas explained.

Nov 20, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
Kimi Code CLI 2.7 Native Bedrock Provider: Use AWS SSO Instead of an API Key

Kimi Code CLI v2.7.0 can now talk to Amazon Bedrock with your normal AWS login instead of a separate API key. Moonshot AI added a native bedrock provider, and AWS published a walkthrough on November 19, 2026 in Use Kimi Code CLI with models on Amazon Bedrock. The example model is Kimi K3.1 Pro Highspeed.

This guide explains what changed, gives the config and IAM policy from the AWS post, and flags the traps AWS itself lists. It builds on our earlier Kimi K3.1 Pro on Bedrock with OpenCode post, which covered model IDs, caching and the Flex tier.

TL;DR: what you need to know

table · 2 cols
QuestionAnswer
What is new?A native bedrock provider in Kimi Code CLI v2.7.0
Do I need a Bedrock API key?No, unless you want one; an explicit key takes precedence
Which auth works?Default AWS chain, named profiles, SSO, aws login (CLI v2.32.0 or later)
Which model in the example?global.moonshotai.kimi-k3.1 (Kimi K3.1 Pro Highspeed)
Key lifetime?Up to 12 hours or your session length, whichever is shorter
Where do I configure it?~/.kimi-code/config.toml, not the desktop or web UI
Is billing per token?Yes, AWS says Bedrock inference is charged per token
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

What was the old setup and why change it?

Before v2.7.0, you connected Kimi Code to Bedrock through a provider with type = "openai" or type = "openai_responses". Those use the OpenAI-compatible Chat Completions or Responses APIs. You had to set the regional base_url and supply a Bedrock API key, short-term or long-term. AWS notes this meant one more credential to obtain and protect.

The native provider removes that step. It follows the same credential chain as the AWS CLI. If your company already signs people in with IAM Identity Center, the coding agent inherits that sign-in. That matters for security teams who prefer to avoid long-lived keys sitting in dotfiles. We saw why in the OpenCode console breach that exposed stored API keys.

How does the provider work?

AWS describes four steps:

  1. Resolve credentials. Unless you configure a Bedrock key, the provider uses the standard AWS credential chain. Set AWS_PROFILE to pick a named profile.
  2. Mint a short-lived token. It uses @aws/bedrock-token-generator to create a short-term Bedrock key and renews it when necessary. You do not place any AWS access key in config.toml.
  3. Build the regional endpoint. It reads AWS_REGION or AWS_DEFAULT_REGION and builds the bedrock-runtime endpoint. For Kimi models this resolves to the recommended OpenAI-compatible Chat Completions path.
  4. Call the inference profile. The model alias maps to a Bedrock model or inference profile ID.

Terminal prompt with a block cursor for running Kimi Code CLI against Amazon BedrockTerminal prompt with a block cursor for running Kimi Code CLI against Amazon Bedrock

What do I need before starting?

  • An AWS account with access to the target model and inference profile in a supported source Region (check the Kimi K3.1 Pro Highspeed model card).
  • Kimi Code CLI v2.7.0 or later; check with kimi --version.
  • The AWS CLI. The optional aws login flow needs v2.32.0 or later.
  • An IAM identity with permission to invoke the model and profile.

AWS's example policy has five statements: bedrock:CallWithBearerToken limited to short-term tokens, bedrock:GetInferenceProfile on the Kimi inference profile, and InvokeModel plus InvokeModelWithResponseStream on the global profile and on the foundation model. A fifth statement, allowing InvokeModel on the default project, is only needed for the openai_responses protocol, not the default Chat Completions. The foundation-model ARN with no Region or account ID is deliberate and required for global cross-Region routing. AWS recommends least privilege and a dedicated IAM role for Kimi Code.

Step by step setup

Step 1: sign in. For SSO, run aws configure sso --profile YOUR_PROFILE_NAME and then aws sso login --profile YOUR_PROFILE_NAME. Verify with aws sts get-caller-identity --profile YOUR_PROFILE_NAME. A Region set in your AWS CLI profile does not carry over to Kimi Code.

Step 2: edit ~/.kimi-code/config.toml (or $KIMI_CODE_HOME/config.toml). Back up any existing file and merge:

toml
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"]

Step 3: test. Run a small non-interactive request:

bash
kimi --model bedrock-kimi-k3-1 --prompt "Write a Python function that checks whether a string is a palindrome. Include a short usage example."

If it streams a response without authentication, authorisation, Region, model-access or network errors, start a session in a project with kimi. Review proposed file changes and shell commands before approving them.

What are the gotchas?

AWS lists several at the time of writing.

Vault door and key representing scoped AWS credentials for Kimi Code CLI on BedrockVault door and key representing scoped AWS credentials for Kimi Code CLI on Bedrock

  • Edit the file, not the UI. The desktop and web provider-creation interfaces do not expose all the environment fields for this setup.
  • Declare capabilities. Kimi Code does not auto-detect them for most Bedrock models. Declare only what the model supports, and test tool and image workflows yourself.
  • Set the Region explicitly. The provider cannot infer a Region from ~/.aws/config. With an inference-profile prefix such as global., us. or in., the Kimi Region sets the source Region that receives requests.
  • Status is not proof. The desktop and web apps may show the bedrock provider as connected. That does not validate credentials, permissions, Region, model access or the network path.
  • Cleanup. Delete any IAM identity you created for testing. Deleting local config does not by itself revoke permissions or an active session.

Cost: why global is the default suggestion

AWS recommends starting with the global inference profile for workloads without data-residency requirements. It says this model, like many others, is priced 10% lower for global inference than through geographic profiles. We did not re-check the rates, so read the Bedrock pricing page. Bedrock bills per token, so there is no standing infrastructure to remove. For how Bedrock's four inference choices compare on cost, see Bedrock cache and Flex tier choices.

Using a VPC endpoint or a different protocol

If auto-detection picks the wrong API format or URL, you can override the model entry with a protocol of openai, openai_responses or anthropic, and a base_url that includes the API path such as /openai/v1 or /anthropic. AWS shows a VPC endpoint example with protocol = "openai_responses" and a vpce- URL. VPC endpoints and Mantle endpoints are the cases where you will need it. The extra default project IAM statement applies if you choose openai_responses.

How does this compare with other coding agents on Bedrock?

Kimi Code is one of several agents that can reach Bedrock models with AWS identity. We have walked through Codex with Bedrock SSO and AgentCore Gateway and the cost side in AI coding tools per-user cost with IAM Identity Center. The pattern is the same: tie the agent's access to your identity provider so you can revoke it centrally and attribute spend. For the model's own capabilities and open weights, read Kimi K3.1 Pro: open weights, benchmarks and price.

What searchers are asking

Can I use Kimi Code CLI with AWS SSO? Yes, per AWS: set up an SSO profile, log in, and set AWS_PROFILE in the provider env table.

Do I still need a Bedrock API key? Not unless you want one. If you set api_key, api_key_env or AWS_BEARER_TOKEN_BEDROCK, that key wins.

Is my code sent outside AWS? AWS says Bedrock processing stays within the AWS data boundary, as described in its User Guide. Check which Region your profile routes to if residency matters.

Troubleshooting checklist

When the first request fails, AWS's list of required conditions is the best map: authentication, authorisation, model access and network connectivity must all succeed. Work through them in order.

  1. Authentication. Run aws sts get-caller-identity with the same profile. If it fails, your SSO session expired; run aws sso login again.
  2. Region. Confirm AWS_REGION is set in the provider env table or your shell. A Region that lives only in ~/.aws/config is ignored by Kimi Code.
  3. Model access. Check the Bedrock model card for your source Region and confirm your account has access to the model and the inference profile.
  4. Authorisation. Compare your IAM policy with the five statements above. The most common gap is the foundation-model ARN without a Region or account ID, which global routing needs.
  5. Network. If you use a VPC endpoint, confirm the base_url includes the API path and that the protocol matches what the model supports.

Security review before a team rollout

A native provider reduces key handling, but it does not remove the agent's reach. The agent can propose shell commands and file edits, and AWS tells you to review them before approving. Before rolling this out to a team, decide who can assume the dedicated IAM role, how long sessions last, and who sees the Bedrock invocation logs. If a developer's laptop is compromised during the 12-hour token window, the token is usable until it expires, so keep the policy narrow. Our post on the litellm PyPI compromise shows how stolen cloud credentials get used in practice.

For the launch details of the model itself, AWS has a separate post, Introducing Kimi K3.1 Pro on Amazon Bedrock, and Moonshot AI describes the release in its own Kimi K3.1 Pro announcement.

What is not covered

AWS's post does not give benchmark results for the Kimi model through Bedrock, and it does not state a price per token in the walkthrough. It is a setup guide, so judge model quality on your own repository.

Related reading

  • Kimi K3.1 Pro on Amazon Bedrock with OpenCode
  • Kimi K3.1 Pro open weights, benchmarks and price
  • Codex with Amazon Bedrock SSO and AgentCore Gateway
  • Bedrock coding tools per-user cost with IAM Identity Center
  • Bedrock four inference choices: cost, cache, Flex
  • OpenCode console breach and stored API keys

Versions, model IDs and prices are as stated in AWS's November 19, 2026 post and may change.

Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Nov 11, 2026

Kimi K3.1 Pro Highspeed on Amazon Bedrock: Model IDs, Caching, Flex Tier, and OpenCode

On November 10, 2026, Amazon announced Kimi K3.1 Pro Highspeed from Moonshot AI on Amazon Bedrock. The post walks through inference profile IDs, Chat Completions and Converse calls, Flex and explicit prompt caching, data-boundary promises, and the official OpenCode recipe for terminal coding agents.

Nov 12, 2026

OpenAI Codex on Amazon Bedrock: SSO Setup, Gateways, and Telemetry

On November 11, 2026 AWS published a hands-on guide for pointing OpenAI Codex at Amazon Bedrock. Codex stays on the developer laptop. Requests go to Bedrock through AWS credentials, and a team picks one of four rollout paths for control and audit.

Oct 23, 2026

Kimi K3.1 Pro: Moonshot's Open-Weight Flagship Scores 65.7% on Terminal-Bench 4.0, Weights Due by Nov 4

Moonshot AI launched Kimi K3.1 Pro and a 2-3x faster Highspeed variant on October 23, 2026. Here is what the company published about benchmarks, price, cyber controls and the November 4 open-weight promise, what comes from Moonshot alone, and what developers on Hacker News are saying.