Cohere
Build with Cohere's language models and embeddings
Pythoneasy
The Cohere SDK provides access to Cohere's language models. Decyra captures all Cohere API calls, providing visibility into your Cohere model interactions.
Prerequisites
- Decyra account with API key
- Node.js 18+ installed
- cohere-ai package installed
Installation
npm install cohere-ai @decyra/sdk
Integration
Wrap fetch to route through Decyra:
import { CohereClient } from 'cohere-ai';
import { wrapFetch } from '@decyra/sdk';
const customFetch = wrapFetch(fetch, {
baseURL: 'https://proxy.decyra.com',
apiKey: process.env.DECYRA_API_KEY!,
});
const cohere = new CohereClient({
token: process.env.COHERE_API_KEY!,
// Configure to use custom fetch if SDK supports it
});
Use the client for chat:
const chatResponse = await cohere.chat({
model: 'command-r-plus',
message: 'Explain the concept of embeddings',
temperature: 0.7,
});
console.log(chatResponse.text);
What Gets Captured
| Field | Description |
|---|---|
| Model | Cohere model identifier |
| Temperature | Temperature setting |
| Message | Input message text |
| Prompt Hash | Hash of the message |
| Response Time | API call duration |
| Token Usage | Input/output tokens |
| Cost | Estimated API cost |
| Preamble | System preamble if used |
Verify
Navigate to your Decyra dashboard and check the traces page. Each Cohere API call will be visible with complete context.