PHPackages                             aisdk/cohere - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aisdk/cohere

ActiveLibrary

aisdk/cohere
============

Official Cohere provider for the PHP AI SDK.

v0.8.3(yesterday)03↑2900%MITPHP ^8.3

Since Jul 22Compare

[ Source](https://github.com/phpaisdk/cohere)[ Packagist](https://packagist.org/packages/aisdk/cohere)[ Docs](https://github.com/phpaisdk/cohere)[ Fund](https://opencollective.com/phpaisdk)[ RSS](/packages/aisdk-cohere/feed)WikiDiscussions Synced today

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

aisdk/cohere
============

[](#aisdkcohere)

[![GitHub Workflow Status](https://camo.githubusercontent.com/831842e809f90ccfb63384e71432c1db743db3d0b9937425a3c6ded365252aa1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870616973646b2f636f686572652f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://github.com/phpaisdk/cohere/actions)[![Latest Version](https://camo.githubusercontent.com/7f3fee0a74fe40d691cbcc5bf88bd05f777b1618e71e8f0c3f32928b0607ab83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616973646b2f636f68657265)](https://packagist.org/packages/aisdk/cohere)[![License](https://camo.githubusercontent.com/3959adb800be1cdd8cc19dd1c4f38b560e939cc3a30024d58b5e48c48eb666f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616973646b2f636f68657265)](https://packagist.org/packages/aisdk/cohere)

---

Official Cohere provider for the PHP AI SDK. Uses Cohere's native v2 Chat and Embed APIs.

Installation
------------

[](#installation)

```
composer require aisdk/cohere
```

Basic Usage
-----------

[](#basic-usage)

```
use AiSdk\Cohere;
use AiSdk\Generate;

Cohere::create(['apiKey' => $_ENV['COHERE_API_KEY']]);

$result = Generate::text('Explain vector databases in one sentence.')
    ->model(Cohere::model('command-a-03-2025'))
    ->run();
```

Embeddings
----------

[](#embeddings)

```
$result = Generate::embedding(['A document to index'])
    ->model(Cohere::model('embed-v4.0'))
    ->providerOptions('cohere', ['inputType' => 'search_document'])
    ->run();
```

Configuration
-------------

[](#configuration)

VariableDescriptionDefault`COHERE_API_KEY`API key for authenticationRequired`COHERE_BASE_URL`Base URL for API requests`https://api.cohere.com`Supported Capabilities
----------------------

[](#supported-capabilities)

CapabilitySupportText generation and streamingNative v2 Chat APITools, structured output, reasoning, image inputNative where supported by the selected modelEmbeddingsNative v2 Embed APIUse `providerOptions('cohere', ['raw' => [...]])` for Cohere fields outside the portable SDK surface. Model IDs are opaque strings and are validated by Cohere.

Documentation
-------------

[](#documentation)

- [Cohere v2 Chat API reference](https://docs.cohere.com/v2/reference/chat)
- [PHP AI SDK documentation](https://phpaisdk.com/docs/cohere)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef29d1962da41e7526023f215cf844494e209b2fd163742084cb919a3b508021?d=identicon)[aisdk](/maintainers/aisdk)

---

Tags

aillmembeddingscohereaisdk

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aisdk-cohere/health.svg)

```
[![Health](https://phpackages.com/badges/aisdk-cohere/health.svg)](https://phpackages.com/packages/aisdk-cohere)
```

###  Alternatives

[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

318123.0k1](/packages/cognesy-instructor-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
