← Back
AWS ML Blog

Use Kimi Code CLI with models on Amazon Bedrock

•12 min read•
#bedrock#agents
Level:Intermediate
For:AI Engineers
✦TL;DR

The Kimi Code CLI v2.7.0 introduces a native Amazon Bedrock provider that eliminates the need for a separate Bedrock API key by leveraging the standard AWS credential chain (including named profiles and SSO). The provider generates short‑lived bearer tokens via **@aws/bedrock-token-generator**, builds the correct regional endpoint from the model ID, and routes requests to the chosen inference profile. This change simplifies credential management while still requiring proper AWS permission scoping. Engineers can now connect the Kimi Code CLI to models such as **Kimi K3.1 Pro Highspeed** using existing AWS credentials.

⚡ Key Takeaways

  • v2.7.0 adds a native Bedrock provider to Kimi Code CLI, removing the need for a separate Bedrock API key.
  • The provider resolves credentials through the AWS CLI credential chain and can select a named profile via the **AWS_PROFILE** environment variable.
  • It generates short‑lived bearer tokens with **@aws/bedrock-token-generator**, renewing them automatically.
  • Endpoint construction uses **AWS_REGION** or **AWS_DEFAULT_REGION** to form the appropriate Bedrock‑runtime URL, with optional overrides.
  • An explicit `api_key` in `config.toml` still takes precedence, so existing key‑based setups remain compatible.
💡 Why It Matters

By reusing existing AWS authentication, teams reduce operational overhead and secret sprawl while maintaining secure, short‑lived access to Bedrock models, accelerating integration of coding agents into production pipelines.

✅ Practical Steps

  1. Set `AWS_PROFILE` (or rely on the default chain) to select the desired AWS credentials before running Kimi Code CLI.
  2. In `config.toml`, change the provider type to `"bedrock"` (or the appropriate native type) and omit `api_key` to let the CLI generate a short‑lived token automatically.
  3. (Optional) Override the endpoint URL or protocol in the config if a custom Bedrock endpoint is required.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

New in AWS Quick: More capable flows, an updated web experience, and agents that work together

AWS ML Blog•#agents

How Google Duplex evolved to also call businesses for you in Gemini

Google Research•#agents

Genie ZeroOps, now in public beta: An autonomous agent that fixes data pipelines, with lessons from 80,000 customer issues

Databricks Blog•#agents

Towards a Science of Capable Autonomous Agents & Provable Safety — Part II

CMU ML Blog•#agents

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING