Overview
Laminar automatically instruments the official Cohere Python SDK with a single line of code, allowing you to trace and monitor all your Cohere API calls without modifying your existing code. This provides complete visibility into your AI application’s performance, costs, and behavior.Getting Started (Python)
1. Install Laminar and Cohere
2. Set up your environment variables
Store your API keys in a.env file:
3. Initialize Laminar and Cohere client
Just add a single line at the start of your application or file to instrument Cohere with Laminar.Use Cohere as usual
After initialization, make API calls to Cohere exactly as you normally would. Laminar will automatically capture traces for Chat, Embed, and Rerank endpoints.Chat (Command family)
Streaming Chat
RAG with Documents (Observed Pipeline)
Rerank
Semantic Search (Embeddings)
Monitoring Cohere usage
After instrumenting your Cohere calls with Laminar, you’ll be able to:- View detailed traces of each Cohere API call, including request and response
- Track token usage and cost across different models
- Monitor latency and performance metrics
- Open LLM span in Playground for prompt engineering
- Debug issues with failed API calls or unexpected model outputs
Enrich your Cohere traces
- Attach sessions, user IDs, metadata, and tags to Cohere spans via the SDK reference.
- Wrap the functions around your Cohere calls with
observeand mark them as TOOL spans so they show up in the transcript.
Related integrations
OpenAI
Trace the OpenAI SDK directly in TypeScript and Python.
Anthropic
Trace the Anthropic SDK directly in TypeScript and Python.
Gemini
Trace Gemini calls made with the Google Gen AI SDK.
LiteLLM
One integration for every model LiteLLM routes to.
LangChain / LangGraph
Trace LangChain chains and LangGraph graphs.
All integrations
Browse every provider, framework, coding agent, and browser integration Laminar supports.