Skip to Content
Getting StartedQuickstart

Quickstart

The in-app onboarding flow is five steps: generate an API key, instrument your agent, verify a trace lands, confirm the map and outcome, and finish. This page walks the same steps and shows the exact commands for each supported runtime.

The five steps

  1. API key — generate an API key scoped to this workspace.
  2. Instrument — pick your runtime (see Pick a runtime below), install the package, and add the snippet. The runtime picker and the snippet live in this one step.
  3. Verify — run your agent once and confirm a trace lands.
  4. Map & outcome — confirm the agent map and record the outcome definition.
  5. Finish — onboarding is complete.

You can move back to any earlier step at any time, and reaching Finish completes onboarding even if your first trace hasn’t arrived yet — a trace that shows up later appears on your dashboard. You won’t be sent back through setup once you’ve finished.

Pick a runtime

Both languages are supported, with the same adapters on each side.

Python — direct instrumentation via a context manager, plus LangChain, LangGraph, OpenAI, OpenAI Agents, Anthropic, and Claude Agent SDK.

TypeScript — direct instrumentation via run(), plus LangChain, LangGraph, OpenAI Agents, Anthropic, Claude Agent SDK, and the Vercel AI SDK.

The Python snippets follow. For the TypeScript equivalents see Frameworks → TypeScript.

Python SDK (direct)

Direct instrumentation of any Python function via a context manager.

pip install morse-ai
import morse_ai morse_ai.init(api_key=MORSE_API_KEY) with morse_ai.run("my-agent") as r: # your agent logic here result = "Hello, world!" r.record(success=True, outcome="completed", cost=0.04)

LangChain

Automatic chain/agent tracing via a callback handler — no code inside the chain changes.

pip install morse-ai[langgraph] langchain
import morse_ai from morse_ai.adapters.langchain import MorseCallbackHandler morse_ai.init(api_key=MORSE_API_KEY) handler = MorseCallbackHandler(agent_name="my-agent") # Add the callback to any LangChain chain or agent chain = your_chain.with_config(callbacks=[handler]) chain.invoke({"input": "Hello, world!"})

LangGraph

Per-node span capture plus automatic sub-agent topology from graph structure.

pip install morse-ai[langgraph] langgraph
import morse_ai from morse_ai.adapters.langchain import MorseCallbackHandler morse_ai.init(api_key=MORSE_API_KEY) handler = MorseCallbackHandler(agent_name="my-graph") # Pass the callback when invoking your StateGraph config = {"callbacks": [handler]} result = your_graph.invoke({"messages": [...]}, config=config)

OpenAI Agents

Runner is patched automatically — every agent run and handoff is traced.

pip install morse-ai[openai_agents] openai-agents
import morse_ai from morse_ai.adapters.openai_agents import install from agents import Agent, Runner morse_ai.init(api_key=MORSE_API_KEY) install() # patches Runner automatically — no further changes needed agent = Agent(name="my-agent", instructions="You are a helpful assistant.") result = Runner.run_sync(agent, "Hello, world!")

Anthropic

Every messages.create call on the wrapped client is traced, including cache/token usage.

pip install morse-ai[anthropic] anthropic
import morse_ai from morse_ai.adapters.anthropic import wrap import anthropic morse_ai.init(api_key=MORSE_API_KEY) # Wrap your Anthropic client — every messages.create call is traced client = wrap(anthropic.Anthropic()) with morse_ai.run("my-agent"): response = client.messages.create( model="claude-opus-4-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello, world!"}], )

Claude Agent SDK

claude_agent_sdk.query is patched automatically — existing code works unchanged.

pip install morse-ai claude-agent-sdk
import morse_ai from morse_ai.adapters.claude_agent_sdk import install import claude_agent_sdk morse_ai.init(api_key=MORSE_API_KEY) install() # patches claude_agent_sdk.query automatically # Your existing claude_agent_sdk code works unchanged result = claude_agent_sdk.query("Hello, world!")

Verify

Run your agent once — for example python my_agent.py for the direct Python SDK, or your framework’s equivalent entry script — then return to the onboarding flow’s Verify step to confirm a trace landed. From there, Map & outcome confirms the agent map and records the outcome definition, and Finish completes onboarding and points you at where to go next.

  • Introduction — what Morse AI correlates and why.
  • Traces — where your first trace shows up once it lands.
Last updated on