Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Kimi Code CLI Integration with Amazon Bedrock Using AWS Credentials

Connecting Kimi Code CLI to Amazon Bedrock now uses AWS credentials instead of API keys, requiring configuration via a named AWS profile in the config.toml file.

Share
AI-generated conceptual illustration accompanying: Kimi Code CLI Integration with Amazon Bedrock Using AWS Credentials
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Connecting Kimi Code CLI to Amazon Bedrock

Connecting Kimi Code CLI to models on Amazon Bedrock involves configuring the CLI to use existing AWS credentials rather than manually entering an Amazon Bedrock API key. Previously, this required setting up a generic connection provider with an API key, but newer versions of the Kimi Code CLI support direct integration using AWS credentials. In older versions, the connection was made through a provider with type = "openai" or type = "openai_responses". However, this is no longer necessary. Users can now configure the CLI using a named AWS profile by replacing YOUR_PROFILE_NAME and uncommenting the AWS_PROFILE line in the config.toml file. The model alias bedrock-kimi-k3-1 is a local name used by Kimi Code CLI to reference the model on Amazon Bedrock.

Model Capabilities and Configuration

When using Kimi Code CLI with models on Amazon Bedrock, it is essential to explicitly declare model capabilities. According to AWS Machine Learning, Kimi Code does not auto-detect the capabilities of most models on Amazon Bedrock, including Kimi models. Developers should refer to AWS Machine Learning and check the Amazon Bedrock model card for each target model to explicitly declare its capabilities. This ensures that Kimi Code can effectively utilize the model's features. As stated in AWS Machine Learning, only capabilities supported by the target model and Amazon Bedrock API endpoint should be included. Additionally, AWS Machine Learning emphasizes the importance of keeping Region settings consistent and preferring 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.

IAM Permissions and Cleanup

When using the Kimi Code CLI with models on Amazon Bedrock, proper IAM permissions are essential. An example IAM policy, as noted in AWS Machine Learning, grants the necessary permissions for the Kimi K3.1 Pro Highspeed model and global inference profile. The BedrockInvokeKimiK31DefaultProject statement, mentioned in AWS Machine Learning, is specifically required when using the openai_responses protocol, but not needed for the default openai (Chat Completions) protocol. After completing your testing, it is important to clean up any new AWS IAM identities or permissions created for this purpose, as outlined in AWS Machine Learning. This ensures security and compliance with AWS best practices. As highlighted in AWS Machine Learning, the Kimi Code CLI v2.7.0 connects to Kimi K3.1 Pro Highspeed on Amazon Bedrock through the standard AWS credential chain, as provided by Moonshot AI’s native bedrock provider. Amazon Bedrock, as described in AWS Machine Learning, offers access to both open and proprietary AI models from leading providers through standard APIs.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more