Skip to main content

Installation

Framework dependencies:

Quick Start


decimalai.init()

Initialize the SDK. Must be called once before any other method.
str
default:"DECIMAL_API_KEY env"
Your DecimalAI API key. Falls back to DECIMAL_API_KEY environment variable.
str
default:"https://api.decimal.ai"
Backend URL. Override to point the SDK at a different DecimalAI API host.
str
default:"None"
Deprecated and inert — the platform never read this label, so it has never grouped traces. Passing it emits a DeprecationWarning. Group traces with workspaces instead (scoped by your API key).
bool
default:"True"
Set False to disable all tracing (useful in tests).
str
default:"None"
Default agent name for all traces. Auto-detected from framework if not set.

Instrumentation flags

All instrumentation flags are bool, default False. Pass True to auto-instrument that surface. 8 framework integrations plus 3 direct LLM providers. Framework integrations Direct LLM providers — auto-trace raw SDK calls with no framework in between. Don’t combine a direct-provider flag with a framework flag that already traces the same provider (e.g. openai with openai_agents or langchain) or the call is captured twice.

Other parameters

bool
default:"True"
If True (the default), init() synchronously probes the backend once to validate the API key and detect a wrong or unreachable base_url. Raises DecimalConfigError on a 401/403 or a connection failure — failing loud at init beats a silent day of background-send 401s. Pass verify=False in CI or cold-start-sensitive paths where the ~50–200ms probe is unacceptable.
float
default:"3.0"
Seconds before the verify probe gives up. On timeout, init() logs a warning and continues (does not raise), so a transiently slow backend doesn’t break startup.
Flag form vs explicit instrument() form. Passing a framework flag (langchain=True, openai_agents=True, …) is shorthand for init() + auto-running the matching instrument(). Use the explicit form only when you need to pass arguments to instrument(...) — e.g., instrument(agent=my_agent) for OpenAI Agents (full schema), or instrument(prompts={...}) for LangChain (override dynamic prompts). Don’t combine the two for the same framework — pick one or the other.This entry point was called install() in 0.10.0 and earlier; install() still works and emits a DeprecationWarning.

Environment Variables

Zero-code setup — set env vars and run your script with no code changes:

What’s next

Tracing

Decorators and helpers to capture LLM and tool calls.

Frameworks

8 framework integrations — OpenAI Agents, LangChain, LlamaIndex, Pydantic AI, CrewAI, OTel, plus native Google ADK and Anthropic Claude Agent SDK — explicit instrument() forms.