Skip to main content
The Python SDK is the primary integration surface for Omium. Most teams:
  • use auto-instrumentation for LangGraph / CrewAI
  • add manual tracing for custom steps that matter
  • rely on the CLI for day-two operations (list, logs, replay)
If you haven’t authenticated yet, do Configure first.

Install

pip install omium

Initialize

You can initialize in two common ways.

Auto-instrumentation

LangGraph

import omium

omium.init()
omium.instrument_langgraph()
See the full guide at LangGraph.

CrewAI

import omium

omium.init()
omium.instrument_crewai()
See the full guide at CrewAI.

Manual tracing (decorate the steps you care about)

Use manual tracing when you want stable step names, or when your code doesn’t run inside an auto-instrumented framework.

@trace

import omium

omium.init()

@omium.trace("extract")
def extract(payload: dict) -> dict:
    return {"ok": True, "payload": payload}

@checkpoint

import omium

omium.init()

@omium.checkpoint("after_extract")
def expensive_step(state: dict) -> dict:
    return state

Configuration

Most teams start with defaults. When you want explicit control:
from omium import OmiumConfig
import omium

omium.configure(
    OmiumConfig(
        api_key="omium_xxx",
        api_url="https://api.omium.ai",
        project="my-agent",
        auto_trace=True,
        auto_checkpoint=True,
    )
)
For the hosted platform, set api_url to https://api.omium.ai in SDK config and to https://api.omium.ai (no /api/v1) in CLI config. The SDK/CLI add /api/v1 where needed.

Errors

If you want to catch Omium-specific failures (for example, checkpoint lookups), import the relevant exception classes from omium and handle them at your boundary (HTTP handler, queue worker, etc.). Keep retries and fallbacks at the edge of your system, not inside step functions.

Next steps

CLI reference

Configure, run, list executions, stream logs, and replay.

API overview

Use Omium from any language via HTTP.