The Opik Python SDK includes a complete REST API client that provides direct access to all Opik platform functionality. This low-level client is available through the rest_client property and is useful for advanced operations, custom integrations, and scenarios where the high-level SDK doesn’t provide the needed functionality.
The REST client is not guaranteed to be backward compatible with future SDK versions. While it provides convenient access to the current REST API, it’s not considered safe to heavily rely on its API as Opik’s REST API contracts may change.
The REST client is accessible through any Opik instance:
The REST API is organized into functional client modules:
traces - Manage traces and their lifecyclespans - Manage spans within tracesdatasets - Manage datasets and dataset itemsexperiments - Manage experiments and resultsprojects - Manage projects and project settingsfeedback_definitions - Define feedback score typesautomation_rule_evaluators - Set up automated evaluation rulesoptimizations - Run optimization experimentsprompts - Manage prompt templates and versionsattachments - Handle file attachments for traces and spanscheck - System health and access verificationworkspaces - Workspace managementllm_provider_key - API key management for LLM providersservice_toggles - Feature flag managementsystem_usage - Usage metrics and monitoringchat_completions - Chat completion endpointsopen_telemetry_ingestion - OpenTelemetry data ingestionguardrails - Content validation and safety checksMost list operations return paginated responses with a consistent structure:
The REST API raises specific exceptions for different error conditions:
Consider using the REST API client when you need to:
For comprehensive documentation of all REST API methods, parameters, and response types, see the complete REST API Reference.
The reference documentation includes: