cohere 5.19.0


pip install cohere

  Latest version

Released: Oct 16, 2025

Project Links

Meta
Requires Python: >=3.9,<4.0

Classifiers

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Operating System
  • MacOS
  • Microsoft :: Windows
  • OS Independent
  • POSIX
  • POSIX :: Linux

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.8

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

Cohere Python SDK

version badge license badge fern shield

The Cohere Python SDK allows access to Cohere models across many different platforms: the cohere platform, AWS (Bedrock, Sagemaker), Azure, GCP and Oracle OCI. For a full list of support and snippets, please take a look at the SDK support docs page.

Documentation

Cohere documentation and API reference is available here.

Installation

pip install cohere

Usage

import cohere

co = cohere.ClientV2()

response = co.chat(
    model="command-r-plus-08-2024",
    messages=[{"role": "user", "content": "hello world!"}],
)

print(response)

[!TIP] You can set a system environment variable CO_API_KEY to avoid writing your api key within your code, e.g. add export CO_API_KEY=theapikeyforyouraccount in your ~/.zshrc or ~/.bashrc, open a new terminal, then code calling cohere.Client() will read this key.

Streaming

The SDK supports streaming endpoints. To take advantage of this feature for chat, use chat_stream.

import cohere

co = cohere.ClientV2()

response = co.chat_stream(
    model="command-r-plus-08-2024",
    messages=[{"role": "user", "content": "hello world!"}],
)

for event in response:
    if event.type == "content-delta":
        print(event.delta.message.content.text, end="")

Contributing

While we value open-source contributions to this SDK, the code is generated programmatically. Additions made directly would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

5.19.0 Oct 16, 2025
5.18.0 Sep 12, 2025
5.17.0 Aug 13, 2025
5.16.3 Aug 08, 2025
5.16.2 Aug 04, 2025
5.16.1 Jul 09, 2025
5.16.0 Jul 09, 2025
5.15.0 Apr 15, 2025
5.14.2 Apr 02, 2025
5.14.0 Feb 28, 2025
5.13.12 Feb 06, 2025
5.13.11 Jan 21, 2025
5.13.10 Jan 21, 2025
5.13.9 Jan 21, 2025
5.13.8 Jan 14, 2025
5.13.6 Jan 07, 2025
5.13.5 Jan 03, 2025
5.13.4 Dec 20, 2024
5.13.3 Dec 05, 2024
5.13.2 Dec 04, 2024
5.13.1 Dec 03, 2024
5.13.0 Dec 02, 2024
5.12.0 Nov 28, 2024
5.11.4 Nov 15, 2024
5.11.3 Nov 01, 2024
5.11.2 Oct 28, 2024
5.11.1 Oct 18, 2024
5.11.0 Sep 30, 2024
5.11.0a0 Sep 30, 2024
5.10.0 Sep 25, 2024
5.9.4 Sep 19, 2024
5.9.3 Sep 19, 2024
5.9.2 Sep 13, 2024
5.9.1 Sep 05, 2024
5.9.0 Aug 30, 2024
5.8.1 Aug 15, 2024
5.8.0 Aug 09, 2024
5.7.0a0 Jul 29, 2024
5.6.2 Jul 22, 2024
5.6.1 Jul 16, 2024
5.6.0 Jul 16, 2024
5.5.8 Jun 17, 2024
5.5.7 Jun 11, 2024
5.5.6 Jun 07, 2024
5.5.5 Jun 06, 2024
5.5.4 May 30, 2024
5.5.3 May 23, 2024
5.5.2 May 23, 2024
5.5.1 May 22, 2024
5.5.0 May 14, 2024
5.4.0 May 09, 2024
5.3.5 May 08, 2024
5.3.4 Apr 30, 2024
5.3.3 Apr 23, 2024
5.3.2 Apr 17, 2024
5.3.1 Apr 17, 2024
5.3.0 Apr 16, 2024
5.2.6 Apr 15, 2024
5.2.5 Apr 10, 2024
5.2.4 Apr 08, 2024
5.2.3 Apr 08, 2024
5.2.2 Apr 04, 2024
5.2.1 Apr 03, 2024
5.2.0 Apr 03, 2024
5.1.8 Apr 03, 2024
5.1.7 Mar 28, 2024
5.1.6 Mar 27, 2024
5.1.5 Mar 27, 2024
5.1.4 Mar 27, 2024
5.1.3 Mar 27, 2024
5.1.2 Mar 25, 2024
5.1.1 Mar 22, 2024
5.1.0 Mar 21, 2024
5.0.2 Mar 21, 2024
5.0.1 Mar 21, 2024
5.0.0 Mar 20, 2024
5.0.0a12 Mar 19, 2024
5.0.0a11 Mar 18, 2024
5.0.0a10 Mar 15, 2024
5.0.0a9 Mar 13, 2024
5.0.0a8 Feb 29, 2024
5.0.0a7 Feb 23, 2024
5.0.0a6 Feb 22, 2024
5.0.0a5 Feb 20, 2024
5.0.0a3 Feb 14, 2024
5.0.0a2 Feb 08, 2024
5.0.0a1 Jan 19, 2024
5.0.0a0 Jan 18, 2024
4.57 Mar 19, 2024
4.56 Mar 14, 2024
4.55 Mar 13, 2024
4.54 Mar 12, 2024
4.53 Mar 08, 2024
4.52 Mar 04, 2024
4.51 Feb 26, 2024
4.50 Feb 24, 2024
4.49 Feb 22, 2024
4.48 Feb 20, 2024
4.47 Feb 12, 2024
4.46 Feb 07, 2024
4.45 Jan 26, 2024
4.44 Jan 16, 2024
4.43 Jan 15, 2024
4.42 Jan 10, 2024
4.41 Jan 09, 2024
4.40 Jan 02, 2024
4.39 Dec 15, 2023
4.38 Dec 13, 2023
4.37 Nov 27, 2023
4.36 Nov 21, 2023
4.35 Nov 17, 2023
4.34 Nov 09, 2023
4.33 Nov 08, 2023
4.32 Oct 24, 2023
4.31 Oct 19, 2023
4.30 Oct 17, 2023
4.27 Sep 19, 2023
4.26.1 Sep 15, 2023
4.26 Sep 14, 2023
4.25 Sep 14, 2023
4.24 Sep 08, 2023
4.23 Sep 06, 2023
4.22 Sep 05, 2023
4.21 Aug 22, 2023
4.20.2 Aug 17, 2023
4.20.1 Aug 15, 2023
4.20.0 Aug 14, 2023
4.19.3 Aug 10, 2023
4.19.2 Aug 04, 2023
4.18.0 Jul 26, 2023
4.17.0 Jul 20, 2023
4.16.0 Jul 18, 2023
4.15.0 Jul 17, 2023
4.14.0 Jul 17, 2023
4.13.1 Jul 14, 2023
4.13.0 Jul 12, 2023
4.12.1 Jul 11, 2023
4.12.0 Jul 10, 2023
4.11.2 Jun 15, 2023
4.11.1 Jun 15, 2023
4.11.0 Jun 14, 2023
4.10.0 Jun 14, 2023
4.9.1 Jun 13, 2023
4.9.0 Jun 06, 2023
4.8.0 Jun 05, 2023
4.7.0 Jun 02, 2023
4.6.1 Jun 01, 2023
4.6.0 May 26, 2023
4.5.1 May 17, 2023
4.5.0 May 17, 2023
4.4.2 May 17, 2023
4.4.1 May 09, 2023
4.4.0 May 09, 2023
4.3.1 May 04, 2023
4.3.0 Apr 26, 2023
4.2.1 Apr 25, 2023
4.2.0 Apr 20, 2023
4.1.7 Apr 18, 2023
4.1.6 Apr 18, 2023
4.1.5 Apr 18, 2023
4.1.4 Apr 06, 2023
4.1.3 Mar 27, 2023
4.1.2 Mar 26, 2023
4.1.1 Mar 23, 2023
4.1.0 Mar 21, 2023
4.0.6 Mar 20, 2023
4.0.5 Mar 20, 2023
4.0.4 Mar 16, 2023
4.0.3 Mar 16, 2023
4.0.2 Mar 15, 2023
4.0.1 Mar 14, 2023
4.0.0 Mar 14, 2023
3.10.0 Mar 03, 2023
3.9.1 Mar 03, 2023
3.9.0 Mar 01, 2023
3.8.0 Feb 23, 2023
3.7.0 Feb 22, 2023
3.6.2 Feb 22, 2023
3.6.1 Feb 22, 2023
3.6.0 Feb 15, 2023
3.5.0 Feb 14, 2023
3.4.0 Feb 09, 2023
3.3.4 Feb 08, 2023
3.3.3 Feb 07, 2023
3.3.2 Feb 03, 2023
3.3.1 Feb 03, 2023
3.3.0 Feb 02, 2023
3.2.6 Feb 01, 2023
3.2.5 Feb 01, 2023
3.2.4 Feb 01, 2023
3.2.3 Jan 25, 2023
3.2.2 Jan 25, 2023
3.2.1 Jan 23, 2023
3.2.0 Jan 23, 2023
3.1.9 Jan 21, 2023
3.1.8 Jan 21, 2023
3.1.6 Jan 19, 2023
3.1.5 Jan 12, 2023
3.1.4 Jan 08, 2023
3.1.3 Dec 23, 2022
3.1.2 Dec 22, 2022
3.1.1 Dec 21, 2022
3.0.1 Dec 20, 2022
3.0.0 Dec 20, 2022
2.9.1 Nov 25, 2022
2.9.0 Nov 21, 2022
2.8.0 Oct 28, 2022
2.7.0 Oct 19, 2022
2.6.1 Oct 12, 2022
2.6.0 Oct 12, 2022
2.5.0 Sep 29, 2022
2.4.2 Sep 21, 2022
2.4.1 Sep 19, 2022
2.4.0 Sep 16, 2022
2.3.0 Sep 16, 2022
2.2.5 Sep 01, 2022
2.2.4 Aug 30, 2022
2.2.3 Aug 26, 2022
2.2.2 Aug 26, 2022
2.2.1 Aug 24, 2022
2.2.0 Aug 19, 2022
2.1.0 Aug 18, 2022
2.0.0 Jul 20, 2022
1.3.10 Jun 17, 2022
1.3.9 May 18, 2022
1.3.8 May 16, 2022
1.3.7 May 09, 2022
1.3.6 May 05, 2022
1.3.5 Apr 21, 2022
1.3.4 Apr 19, 2022
1.3.3 Apr 12, 2022
1.3.2 Mar 24, 2022
1.3.1 Mar 09, 2022
1.2.1 Mar 08, 2022
1.2.0 Feb 07, 2022
1.1.0 Jan 18, 2022
1.0.2 Nov 30, 2021
1.0.1 Nov 17, 2021
1.0.0 Nov 15, 2021
0.0.13 Aug 30, 2021
0.0.12 Aug 17, 2021
0.0.11 Jul 22, 2021
0.0.10 Jul 20, 2021
0.0.8 Jun 14, 2021
0.0.7 May 14, 2021
0.0.6 Apr 19, 2021
0.0.5 Feb 18, 2021
0.0.4 Feb 08, 2021
0.0.3 Feb 04, 2021
0.0.2 Jan 20, 2021
0.0.1 Jan 20, 2021

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
fastavro (<2.0.0,>=1.9.4)
httpx (>=0.21.2)
httpx-sse (==0.4.0)
pydantic (>=1.9.2)
pydantic-core (<3.0.0,>=2.18.2)
requests (<3.0.0,>=2.0.0)
tokenizers (<1,>=0.15)
types-requests (<3.0.0,>=2.0.0)
typing_extensions (>=4.0.0)