Skip to main content
Cohere

Installation

Install the Netra SDK along with the Cohere client library:

Usage

Netra automatically instruments Cohere API calls when you initialize the SDK. The instrumentation captures chat completions, streaming responses, and rerank operations.

Basic Setup

Initialize Netra at the start of your application to enable automatic Cohere instrumentation: Set your Netra endpoint and API key before you call Netra.init(). Without NETRA_OTLP_ENDPOINT, the SDK prints spans to the console instead of sending them to Netra, and your dashboard stays empty.
Set these wherever your app runs, including Docker containers and CI jobs.

Streaming Responses

Netra automatically handles streaming responses from Cohere:

Rerank Operations

Rerank API calls are also automatically instrumented:

Session Tracking

Associate Cohere operations with user sessions for better analytics:

Selective Instrumentation

Enable only Cohere instrumentation if needed:

Next Steps

Last modified on November 5, 2026