> This page is for version v1 API.
> For other versions, use one of these documentation indexes:
> - v2 API (default): https://docs.cohere.com/v2/llms.txt
> - v1 API: https://docs.cohere.com/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cohere.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cohere.com/_mcp/server.

# Working with Cohere's API and SDK

> Cohere's NLP platform provides customizable large language models and tools for developers to build AI applications.

The Cohere platform allows you to leverage the power of
[large language models](../docs/the-cohere-platform#large-language-models-llms) (LLMs) with just a few
lines of code and an [API key](https://dashboard.cohere.com/api-keys?_gl=1*14v2pj5*_gcl_au*NTczMTgyMTIzLjE3MzQ1NTY2OTA.*_ga*MTAxNTg1NTM1MS4xNjk1MjMwODQw*_ga_CRGS116RZS*MTczNjI3NzU2NS4xOS4xLjE3MzYyODExMTkuNDkuMC4w).

Our [Command](../docs/command-a-plus), [Embed](../docs/cohere-embed), [Rerank](../docs/rerank), [Parse](../../v2/docs/parse),
[Aya](../docs/aya), and [Cohere Transcribe](../../v2/docs/transcribe) models excel at a variety of applications,
from the relatively simple [semantic search](../docs/semantic-search-embed), and
[content generation](../docs/introduction-to-text-generation-at-cohere) to the more advanced
[retrieval augmented generation](../docs/retrieval-augmented-generation-rag) and
[agents](../docs/multi-step-tool-use). If you have a more specialized use case and custom data, you can
also [train a custom model](../docs/fine-tuning) to get better performance.

Check out [our documentation](../docs/the-cohere-platform) if you're ready to start building, and you
might want to check out our [API pricing](../docs/rate-limits).

## SDKs

The Cohere SDK is the primary way of accessing Cohere's models. We support SDKs in four different
languages. To get started, please see the installation methods and code snippets below.

### Python

[https://github.com/cohere-ai/cohere-python](https://github.com/cohere-ai/cohere-python)

```bash
python -m pip install cohere --upgrade
```

```python
import cohere

co = cohere.ClientV2("<<apiKey>>")
response = co.chat(
    model="command-a-plus-05-2026", 
    messages=[{"role": "user", "content": "hello world!"}]
)

print(response)
```

### Typescript

[https://github.com/cohere-ai/cohere-typescript](https://github.com/cohere-ai/cohere-typescript)

```bash
npm i -s cohere-ai
```

```typescript
const { CohereClientV2 } = require('cohere-ai');

const cohere = new CohereClientV2({
  token: '<<apiKey>>',
});

(async () => {
  const response = await cohere.chat({
    model: 'command-a-plus-05-2026',
    messages: [
      {
        role: 'user',
        content: 'hello world!',
      },
    ],
  });

  console.log(response);
})();
```

### Java

[https://github.com/cohere-ai/cohere-java](https://github.com/cohere-ai/cohere-java)

```gradle
implementation 'com.cohere:cohere-java:1.x.x'
```

```java
package chatv2post;

import com.cohere.api.Cohere;
import com.cohere.api.resources.v2.requests.V2ChatRequest;
import com.cohere.api.types.*;
import java.util.List;

public class Default {
    public static void main(String[] args) {
        Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

        ChatResponse response =
                cohere.v2()
                        .chat(
                                V2ChatRequest.builder()
                                    .model("command-a-plus-05-2026")
                                    .messages(
                                        List.of(
                                            ChatMessageV2.user(
                                                UserMessage.builder()
                                                    .content(
                                                        UserMessageContent
                                                                .of("Hello world!"))
                                                    .build())))
                                    .build());

        System.out.println(response);
    }
}
```

### Go

[https://github.com/cohere-ai/cohere-go](https://github.com/cohere-ai/cohere-go)

```bash
go get github.com/cohere-ai/cohere-go/v2
```

```go
package main

import (
    "context"
    "log"

    cohere "github.com/cohere-ai/cohere-go/v2"
    client "github.com/cohere-ai/cohere-go/v2/client"
)

func main() {
    co := client.NewClient(client.WithToken("Your API key"))

    resp, err := co.Chat(
        context.TODO(),
        &cohere.ChatRequest{
            Message: "Hello world!",
        },
    )

    if err != nil {
        log.Fatal(err)
    }

    log.Printf("%+v", resp)
}

```

## Request Specification

To make a request to any model, you must pass in the `Authorization` Header and the request must be made
through a `POST` request.

The content of `Authorization` should be in the shape of `BEARER [API_KEY]`. All request bodies are sent
through JSON.

Model names are found within the dashboard, and details about endpoints are available within the
documentation.