openinference-instrumentation-cohere package.
Install
cohere >= 5.13.0.
Setup
Set theCO_API_KEY environment variable to authenticate calls made using the client.
register function, then enable the CohereInstrumentor:
Run Cohere
Observe
Now that you have tracing setup, all chat calls made with the Cohere v2 client will be streamed to your running Phoenix for observability and evaluation. Spans capture the input messages, output message, invocation parameters, tool definitions and tool calls, and token counts from Cohere’susage.tokens.
Coverage
The instrumentor traces the Cohere v2 client (cohere.ClientV2 and cohere.AsyncClientV2), covering both the chat and chat_stream methods. Streamed calls finish their span when the returned iterator is exhausted, with the accumulated output message, tool calls, and token counts.
The following are not traced and produce no spans:
- The v1 client (
cohere.Client) - The embed, rerank, and classify endpoints

