For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
  • Get Started
    • Introduction
    • Installation
    • Creating a client
    • Playground
    • FAQs
  • Models
    • An Overview of Cohere's Models
    • Aya
    • Embed
    • Rerank
  • Text Generation
    • Introduction to Text Generation at Cohere
    • Using the Chat API
    • Reasoning
    • Image Inputs
    • Streaming Responses
    • Predictable Outputs
    • Advanced Generation Parameters
    • Tool Use
    • Tokens and Tokenizers
    • Summarizing Text
    • Safety Modes
  • Embeddings (Vectors, Search, Retrieval)
    • Introduction to Embeddings at Cohere
    • Semantic Search with Embeddings
    • Multimodal Embeddings
    • Batch Embedding Jobs
  • Going to Production
    • API Keys and Rate Limits
    • Going Live
    • Deprecations
    • How Does Cohere's Pricing Work?
  • Integrations
    • Integrating Embedding Models with Other Tools
    • Cohere and LangChain
    • LlamaIndex and Cohere
  • Deployment Options
    • Overview
    • SDK Compatibility
  • Tutorials
    • Cookbooks
    • LLM University
    • Build Things with Cohere!
    • Agentic RAG
    • Cohere on Azure
  • Responsible Use
    • Security
    • Usage Policy
    • Command A Technical Report
    • Command R and Command R+ Model Card
  • Cohere Labs
    • Cohere Labs Acceptable Use Policy
  • More Resources
    • Cohere Toolkit
    • Datasets
    • Improve Cohere Docs
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
On this page
  • Supported environments
  • Feature support
  • Snippets
  • Cohere Platform
  • Private Deployment
  • Bedrock
  • Sagemaker
  • Azure
  • OCI
Deployment Options

Cohere SDK Cloud Platform Compatibility

Was this page helpful?
Edit this page
Previous

Private Deployment Overview

Next
Built with

To maximize convenience in building on and switching between Cohere-supported environments, we have developed SDKs that seamlessly support whichever backend you choose. This allows you to start developing your project with one backend while maintaining the flexibility to switch, should the need arise.

Note that the code snippets presented in this document should be more than enough to get you started, but if you end up switching from one environment to another there will be some small changes you need to make to how you import and initialize the SDK.

Supported environments

The table below summarizes the environments in which Cohere models can be deployed. You’ll notice it contains many links; the links in the “sdk” column take you to Github pages with more information on Cohere’s language-specific SDKs, while all the others take you to relevant sections in this document.

Note

The Cohere v2 API is not yet supported for some cloud deployments (Bedrock, SageMaker, Azure). OCI supports the v2 API via OciClientV2. The code examples shown for Bedrock, SageMaker, and Azure use the v1 API.

sdkCohere platformBedrockSagemakerAzureOCIPrivate Deployment
Typescript✅ docs✅ docs✅ docs✅ docs🟠 soon✅ docs
Python✅ docs✅ docs✅ docs✅ docs✅ docs✅ docs
Go✅ docs🟠 soon🟠 soon✅ docs🟠 soon✅ docs
Java✅ docs🟠 soon🟠 soon✅ docs🟠 soon✅ docs

Feature support

The most complete set of features is found on the cohere platform, while each of the cloud platforms support subsets of these features. Please consult the platform-specific documentation for more information about the parameters that they support.

FeatureCohere PlatformBedrockSagemakerAzureOCIPrivate Deployment
chat_stream✅✅✅✅✅✅
chat✅✅✅✅✅✅
generate_stream✅✅✅✅⬜️✅
generate✅✅✅✅⬜️✅
embed✅✅✅✅✅✅
rerank✅✅✅✅⬜️✅
classify✅⬜️⬜️⬜️⬜️✅
summarize✅⬜️⬜️⬜️⬜️✅
tokenize✅✅ (offline)✅ (offline)✅ (offline)✅ (offline)✅ (offline)
detokenize✅✅ (offline)✅ (offline)✅ (offline)✅ (offline)✅ (offline)
check_api_key✅✅✅✅✅✅

Snippets

Cohere Platform

1const { CohereClient } = require('cohere-ai');
2
3const cohere = new CohereClient({
4 token: 'Your API key',
5});
6
7(async () => {
8 const response = await cohere.chat({
9 chatHistory: [
10 { role: 'USER', message: 'Who discovered gravity?' },
11 {
12 role: 'CHATBOT',
13 message: 'The man who is widely credited with discovering gravity is Sir Isaac Newton',
14 },
15 ],
16 message: 'What year was he born?',
17 // perform web search before answering the question. You can also use your own custom connector.
18 connectors: [{ id: 'web-search' }],
19 });
20
21 console.log(response);
22})();

Private Deployment

1const { CohereClient } = require('cohere-ai');
2
3const cohere = new CohereClientV2({
4 token: '',
5 environment: '<YOUR_DEPLOYMENT_URL>'
6});
7
8(async () => {
9 const response = await cohere.chat({
10 chatHistory: [
11 { role: 'USER', message: 'Who discovered gravity?' },
12 {
13 role: 'CHATBOT',
14 message: 'The man who is widely credited with discovering gravity is Sir Isaac Newton',
15 },
16 ],
17 message: 'What year was he born?',
18 // perform web search before answering the question. You can also use your own custom connector.
19 connectors: [{ id: 'web-search' }],
20 });
21
22 console.log(response);
23})();

Bedrock

Rerank API Compatibility

Rerank v3.5 on Bedrock is only supported with Rerank API v2, via BedrockClientV2()

1const { BedrockClient } = require('cohere-ai');
2
3const cohere = new BedrockClient({
4 awsRegion: "us-east-1",
5 awsAccessKey: "...",
6 awsSecretKey: "...",
7 awsSessionToken: "...",
8});
9
10(async () => {
11 const response = await cohere.chat({
12 model: "cohere.command-r-plus-v1:0",
13 chatHistory: [
14 { role: 'USER', message: 'Who discovered gravity?' },
15 {
16 role: 'CHATBOT',
17 message: 'The man who is widely credited with discovering gravity is Sir Isaac Newton',
18 },
19 ],
20 message: 'What year was he born?',
21 });
22
23 console.log(response);
24})();

Sagemaker

1const { SagemakerClient } = require('cohere-ai');
2
3const cohere = new SagemakerClient({
4 awsRegion: "us-east-1",
5 awsAccessKey: "...",
6 awsSecretKey: "...",
7 awsSessionToken: "...",
8});
9
10(async () => {
11 const response = await cohere.chat({
12 model: "my-endpoint-name",
13 chatHistory: [
14 { role: 'USER', message: 'Who discovered gravity?' },
15 {
16 role: 'CHATBOT',
17 message: 'The man who is widely credited with discovering gravity is Sir Isaac Newton',
18 },
19 ],
20 message: 'What year was he born?',
21 });
22
23 console.log(response);
24})();

Azure

1const { CohereClient } = require('cohere-ai');
2
3const cohere = new CohereClient({
4 token: "<azure token>",
5 environment: "https://Cohere-command-r-plus-phulf-serverless.eastus2.inference.ai.azure.com/v1",
6});
7
8(async () => {
9 const response = await cohere.chat({
10 chatHistory: [
11 { role: 'USER', message: 'Who discovered gravity?' },
12 {
13 role: 'CHATBOT',
14 message: 'The man who is widely credited with discovering gravity is Sir Isaac Newton',
15 },
16 ],
17 message: 'What year was he born?',
18 });
19
20 console.log(response);
21})();

OCI

PYTHON
1import cohere
2
3co = cohere.OciClientV2(
4 oci_region="us-chicago-1",
5 oci_compartment_id="ocid1.compartment.oc1...",
6)
7
8response = co.chat(
9 model="command-a-plus-05-2026",
10 messages=[
11 {"role": "user", "content": "Who discovered gravity?"},
12 ],
13)
14
15print(response)