Skip to main content
The Python SDK is the primary way to integrate DecimalAI into your agent code. It wraps every public REST endpoint, auto-instruments 8 agent framework integrations plus 3 direct LLM provider SDKs (OpenAI, Anthropic, Google) — including native plugins for Google ADK and Anthropic’s Claude Agent SDK — and ships zero-config helpers for tracing, evaluation, and dataset export.
pip install decimalai
import decimalai
decimalai.init(api_key="dai_sk_...", openai_agents=True)
# Every supported framework call is now traced.

Sections

Init & Setup

decimalai.init(), environment variables, framework flags.

Tracing

@trace, start_trace, log_llm_call, log_tool_call, @tool.

Manifests

register_manifest, flush_manifest_for_ci.

Evaluations

eval, score, get_eval_breakdown, batch_eval, @eval, external imports.

Replay & Experiments

get_replay_prompts, create_replay_batch, get_replay_batch.

Datasets & Training

pull_dataset, push_to_hub, load_hf_dataset.

Framework Instrumentation

8 framework integrations — OpenAI Agents, LangChain, LlamaIndex, CrewAI, AutoGen, generic OTel, plus native plugins for Google ADK and Anthropic Claude Agent SDK.

Skills

Sync from disk, pull from platform, SkillRouter CRUD.

Complete API Summary

Top-level functions (in decimalai)

Grouped by surface. Every function below is importable directly from decimalai.
MethodDescription
init()Initialize SDK and auto-instrument frameworks.
@trace()Decorator to trace a function as an agent run.
start_trace()Context manager for manual trace boundaries.
log_llm_call()Log an LLM call inside a trace.
log_tool_call()Log a tool call inside a trace.
@toolDecorator to register a tracked tool.
send()Send a fully-constructed trace payload.
MethodDescription
register_manifest()Explicitly register agent configuration.
flush_manifest_for_ci()Capture and write the manifest ID for the regression-check Action.
MethodDescription
eval()Pushes a single named score to a trace (alias of score()). The custom-evaluator decorator is @decimalai.evals.eval, not this top-level function.
score()Push a single named score to a trace.
batch_eval()Apply evaluators across multiple traces in parallel.
get_eval_breakdown()Get full eval breakdown for a trace.
push_deepeval_results()Import DeepEval scores.
push_langsmith_scores()Import LangSmith feedback as eval scores.
push_custom_scores()Push scores from any source.
MethodDescription
pull_dataset()Materialize a dataset version as a HuggingFace Dataset.
push_to_hub()Push a dataset to HuggingFace Hub.
load_hf_dataset()Convenience loader returning a datasets.Dataset.
MethodDescription
get_replay_prompts()Download stale prompts for replay.
create_replay_batch()Create a batch of replay tasks.
get_replay_batch()Check replay batch progress.
submit_replay_result()Submit a replayed trace result.

Framework instrumentation (subpackages)

8 framework integrations. Google ADK and Anthropic’s Claude Agent SDK use native plugins (not OTel).
ModuleFunctionUse it for
decimalai.langchaininstall()LangChain / LangGraph callbacks
decimalai.openai_agentsinstall(agent=...)OpenAI Agents SDK — pass the Agent object for full schema introspection
decimalai.llamaindexinstall()LlamaIndex span handler
decimalai.crewaiinstall()CrewAI via OpenTelemetry
decimalai.autogeninstall()AutoGen / AG2 via OpenTelemetry
decimalai.adkinstall()Google ADK — native plugin (Gemini-native)
decimalai.claude_agent_sdkinstall()Anthropic Claude Agent SDK — native plugin
decimalai.otelinstall()Generic OpenTelemetry GenAI span exporter

Class-based clients

ClassUse it for
SkillRouter (from decimalai)Registry + skill lifecycle: fork (workspace copy), install (fork + write to disk), preview (read-only snapshot), create_skill, list_skills, get_skill, update_skill, delete_skill, sync_skills, list_versions, get_menu, smart_route, export_to_disk, pull_missing.

REST-only endpoints

For endpoints that don’t yet have a top-level SDK wrapper (list_datasets, get_trace_stats, get_manifest, repair preview/apply, compatibility policy set, etc.), use httpx directly against the REST API:
import httpx

resp = httpx.get(
    "https://api.decimal.ai/api/v1/datasets",
    headers={"Authorization": "Bearer dai_sk_..."},
)
resp.raise_for_status()
See the API Reference for the full endpoint registry.