Getting Started
Step 3 of 5
Connect your first agent
One call captures your LLM and framework calls. Add your own steps and decisions where you need more detail.
Choose your approach
Start with auto-instrument; add manual steps for the parts of your agent you need to explain.
Auto-instrument (recommended)
The SDK automatically patches OpenAI, Anthropic, and other LLM libraries. No code changes needed — just initialize and run.
1. Initialize with auto-instrument
import os
import lanternfish
# Call once at startup. Installed providers (OpenAI, Anthropic, LangChain, CrewAI…) are traced from here on.
lanternfish.instrument(
api_key=os.environ["LANTERNFISH_API_KEY"],
endpoint=os.environ["LANTERNFISH_ENDPOINT"],
agent="travel-agent", # shown as the agent name on every run
)
from openai import OpenAI
response = OpenAI().chat.completions.create( # traced automatically
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}],
)What gets captured: Model, tokens, duration, tool calls and errors. Cost is shown for models with a known price. HTTP, SQL and Redis calls are recorded only if you pass include=["http", "sql", "redis"].
Verify your first run
Run your agent once, then open Runs in the sidebar. Spans are sent in the background every few seconds, so the run usually appears within 10 seconds.
The run appears on the Runs page
Its steps are listed when you open the run
Token usage is shown; cost too, if the model's price is known
The agent name matches instrument(agent=...)
Troubleshooting
The run does not appear?
LLM calls are not captured?
Will it slow my agent down?
Next step
Understand your first Briefing
Once runs arrive, the briefing compares them with the previous period and tells you what changed.
Continue to First Briefing