Skip to main content
Zespan instruments your agents and LLM calls by wrapping your existing clients. Once initialized, every agent run, tool call, and model interaction is automatically captured and sent to your project’s dashboard. This guide walks through the setup using Node.js and OpenAI, with a Python alternative included.
1

Create your account and project

Go to app.zespan.com and sign up for a free account. After verifying your email, you’ll be taken through the onboarding wizard (see Sign-up and onboarding for details, including how to send a sample trace):
  1. Create an organization — your billing workspace.
  2. Create a project — an isolated container for agent events. Name it after the application you’re instrumenting (e.g. my-support-agent-production).
  3. Copy your API key — shown once after project creation. It starts with zsp_ followed by 64 hex characters.
On the last screen, above the buttons that open your dashboard, Zespan asks one optional question: What do you mostly do? The default is Skip. Pick an answer such as On-call or Finance to open on the page that fits (for example Issues or Costs) with three matching rows pinned in your sidebar. It never limits what you can see or do, and you can change it any time in Profile.
Your API key is shown in full only once. If you lose it, rotate it from Settings → API Keys — the old key remains valid for 24 hours during rollover.
2

Install the SDK

3

Initialize and wrap your client

Add the following at the entry point of your application — before any agent or LLM calls are made.
zespan.init() initializes the global SDK client. wrapOpenAI() patches the OpenAI client so all calls — and every agent step that goes through it — are automatically traced. Your existing code is unchanged.
Set the ZESPAN_API_KEY environment variable to the API key from the dashboard. The SDK logs a warning if the key format is invalid.
4

Run your agent or make an LLM call

Use your client exactly as you would normally. The SDK captures everything — model name, input and output tokens, cost, latency, tool calls, streaming TTFT, and finish reason.
5

View your trace in the dashboard

Open app.zespan.com and navigate to your project. Within a few seconds you should see your trace in the Traces view. Click any row to open the flame graph — each bar is a span (agent scope, tool call, LLM call) with full cost and latency breakdown.
If no trace appears after 15 seconds, check that your API key is correct and that your process did not exit before the SDK flushed. Call await zespan.getClient().flush() (TypeScript) or zespan.flush() (Python) at the end of your script to force an immediate flush. See the Serverless guide if running in Lambda or Vercel.

Explore the demo

Want to see a populated project before you send your own data? Open the shared demo, a sample project with traces, issues, incidents and evaluations already in it.
  • Signed in: choose Explore the demo in the account menu (bottom of the sidebar), or on the Explore the demo button next to the sample-trace button on an empty Overview and in the setup wizard. Pages that have nothing to show yet can also offer See it on demo data, which opens that same page inside the demo.
  • Signed out: go to app.zespan.com/demo for a short read-only guest session.

What you see in the demo

  • It is read only. You join as a viewer, so you can look at everything and change nothing. Buttons that would create or run something (for example Author a policy, Generate evidence pack, New dataset, Create alert, Apply fix) are not shown as main buttons there: a guest sees a Sign up to … link in their place, and a signed-in person who joined the demo sees a short Read-only demo note. Reading and navigation are never hidden. Everyone who opens the demo sees the same sample data, and nothing you do there reaches your own projects.
  • You see yourself and a fictional team. The demo’s Team page, audit log and member lists show your own name and email, plus three made-up teammates. Other real people who have opened the demo never appear to you, and you never appear to them.
  • It stays out of your way. The demo appears in the organization switcher as Demo (read only), below your own organizations. It does not count toward your limit of 3 organizations, and it never becomes your default organization after you sign in. A banner at the top of every demo page says so and has Back to my project, which returns you to the last project you had open.
  • The Issues page shows a mix of kinds, each proven from its own spans. When the functional checks are switched on for the demo, next to the demo story’s issue it has thirteen more, all made from recorded runs of four fictional agents (CustomerSupportAgent, RefundAgent, ReportsAgent and CampaignAgent) and found by the same checks every project uses, not written by hand. Each has a Type: Technical (a 429 rate-limit retry storm, a provider 503, a context that was too long, a model call that timed out), Functional (a tool called that the agent was never given, a total that is not the sum of its lines) and a domain pack (Support: an order number that is not the one the lookup returned, a refund promised in 24 hours when the policy tool says 5 days; AI product: a card number in a reply; BI: a revenue total that is not the sum of the returned rows, “no data” said when rows came back; Martech: the same campaign created twice, a click-through rate that is not the one the analytics tool returned). Open any of them for its cause, fix and prevention, each from the check’s own wording. An issue appears only if the check proved it at its strongest level; a weaker finding is left out, and checks that need an AI judge are not run in the demo. With the functional checks switched off, only the four Technical ones are shown. Healthy runs of the same agents sit beside them, and none of them is flagged. See Issues → Kinds of issue.
  • ZespanPilot answers sample questions only. Pilot is in the demo’s sidebar and opens from Ask Pilot, with a list of starter questions (why agent success dropped, what caused the delegation loop, how to prevent it, what to set up first, issues versus incidents, why a page is empty, what a span is). Each answer is written in advance from the demo’s own data, so it is the same for everyone and costs no AI usage. Anything else you type gets “Sign up or open your project to ask your own.” Demo conversations are not saved, so nobody can see anyone else’s questions.
  • Policies, compliance and prevention are filled in. The demo’s Policies page lists one applied policy, “Refund agent: keep payment data out of replies”, with the guardrail it created, the test it was checked against (the demo’s recorded traffic from the last 7 days) and its apply record. When prevention drafts are switched on for the demo, it also lists a policy Zespan drafted for the demo story, “Stop repeated identical tool calls” (a repeat guard for RefundAgent, tested on RefundAgent’s own healthy runs and the loop itself). It is a draft: nothing runs until a person applies it, and once applied it starts at dryrun, which only records what it would stop. You find it under Proposed by Zespan and in the Prevent part of the story’s issue page. Compliance has one SOC 2 evidence pack for the last 30 days, and the Audit log shows the matching entries. Every name in them is the fictional team, and all of it is recreated each day with current dates. See Policies, Evidence packs and Audit log.

The demo story

The demo opens with a Demo story panel in the bottom-right corner: one silent failure, followed in five steps. It is a side panel, not a tour. Nothing is dimmed, you go at your own pace, and a step gets a tick when you reach its page (for the cause, fix and prevention steps, when that part of the issue page is at least half in view). It opens by itself once. Minimize it to a small Demo story · n of 5 pill with the arrow button, so it stops covering the page, and select the pill to open it again; your choice is remembered in your browser. Close it with Esc or the close button and bring it back from Demo story in the demo banner or the account menu. The demo’s Overview does not ask which view you want to lead with, and the ZespanPilot footer says “Sample answers only. Nothing runs against a model.” In the story, an agent called RefundAgent calls the same tool, check_refund_status, with the same order id again and again, gets the same “pending” result every time and never answers. No span errors, so an error rate does not show it. Zespan finds it from the spans. The issue is recreated with the current dates every day, so its traces are always recent. On the demo the story replaces the 3-step tour offer, so the two never appear together. The tour is still in the account menu under Take the tour.
If you have no organization of your own yet, the demo banner offers Sign up free instead, and signing in sends you to onboarding to create one.

SDK initialization options

Tracing other frameworks

Anthropic

zespan.wrapAnthropic(new Anthropic())

Google Gemini

zespan.wrapGoogle(new GoogleGenerativeAI(key))

AWS Bedrock

zespan.wrapBedrock(new BedrockRuntimeClient())

Mistral

zespan.wrapMistral(new Mistral())

Groq

zespan.wrapGroq(new Groq())

OpenRouter

zespan.wrapOpenAI(new OpenAI({ baseURL: "..." }))

LiteLLM

Drop-in proxy — point your SDK at the LiteLLM base URL.

LangChain

Full chain, agent executor, and retriever tracing via callback handler.

Google ADK

Multi-agent tracing with instrumentADK, wrapADKRunner, or wrapADKAgent.

CrewAI

Crew and task tracing via the Zespan CrewAI integration.

AutoGen

Multi-agent conversation and tool tracing for AutoGen / AG2.

LlamaIndex

Query engine, retriever, and agent tracing via callback handler.

Vercel AI SDK

generateText, streamText, and generateObject traced automatically.

Haystack

Pipeline component and retriever tracing for Haystack 2.x.

Semantic Kernel

Kernel function and planner tracing for Microsoft Semantic Kernel.