Installation
Quick Start
decimalai.init()
Initialize the SDK. Must be called once before any other method.
Your DecimalAI API key. Falls back to
DECIMAL_API_KEY environment variable.Backend URL. Override for self-hosted deployments.
Optional project grouping for multi-project workspaces.
Set
False to disable all tracing (useful in tests).Default agent name for all traces. Auto-detected from framework if not set.
Instrumentation flags
All instrumentation flags arebool, default False. Pass True to auto-instrument that surface. 8 framework integrations plus 3 direct LLM providers.
Framework integrations
| Flag | Instruments | Type |
|---|---|---|
openai_agents | OpenAI Agents SDK | bool |
langchain | LangChain / LangGraph | bool |
llamaindex | LlamaIndex (v0.10.20+) | bool |
crewai | CrewAI (via OpenTelemetry) | bool |
autogen | AutoGen / AG2 (via OpenTelemetry) | bool |
adk | Google ADK (Agent Development Kit) — native plugin, Gemini-native | bool |
claude_agent_sdk | Anthropic Claude Agent SDK (claude-agent-sdk) — native plugin | bool |
otel | Generic OpenTelemetry span exporter for any framework | bool |
openai with openai_agents or langchain) or the call is captured twice.
| Flag | Instruments | Type |
|---|---|---|
openai | Direct OpenAI SDK calls | bool |
anthropic | Direct Anthropic SDK calls | bool |
google | Direct Google GenAI (google.genai) SDK calls | bool |
Other parameters
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.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
install() form. Passing a framework flag (langchain=True, openai_agents=True, …) is shorthand for init() + auto-running the matching install(). Use the explicit form only when you need to pass arguments to install(...) — e.g., install(agent=my_agent) for OpenAI Agents (full schema), or install(prompts={...}) for LangChain (override dynamic prompts). Don’t combine the two for the same framework — pick one or the other.Environment Variables
| Variable | Description |
|---|---|
DECIMAL_API_KEY | API key (alternative to api_key= parameter) |
DECIMAL_BASE_URL | Backend URL override |
DECIMAL_AUTO_TRACE | Auto-instrument on import. Values: langchain, openai-agents, adk, llamaindex, crewai, autogen, otel, openai, anthropic, google |
What’s next
Tracing
Decorators and helpers to capture LLM and tool calls.
Frameworks
8 framework integrations — OpenAI Agents, LangChain, LlamaIndex, CrewAI, AutoGen, OTel, plus native Google ADK and Anthropic Claude Agent SDK — explicit
install() forms.