Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

On this pageOverview

Opik REST API

The Opik REST API is currently in beta and subject to change. If you have any questions or feedback about the APIs, please reach out on GitHub: https://github.com/comet-ml/opik.

All of the methods listed in this documentation are used by either the SDK or the UI to interact with the Opik server. As a result, the methods have been optimized for these use-cases in mind. If you are looking for a method that is not listed above, please create and issue on GitHub or raise a PR!

Opik includes two main deployment options that results in slightly different API usage:

  • Self-hosted Opik instance: You will simply need to specify the URL as http://localhost:5173/api/<endpoint_path> or similar. This is the default option for the docs.
  • Opik Cloud: You will need to specify the Opik API Key and Opik Workspace in the header. The format of the header should be:
  {
    "Comet-Workspace": "your-workspace-name",
    "authorization": "your-api-key"
  }

The full payload would therefore look like:

  curl -X GET 'https://www.comet.com/opik/api/v1/private/projects' \
  -H 'Accept: application/json' \
  -H 'Comet-Workspace: <your-workspace-name>' \
  -H 'authorization: <your-api-key>'

Do take note here that the authorization header value does not include the Bearer prefix. To switch to using the Opik Cloud in the documentation, you can click on the edit button displayed when hovering over the Base URL displayed on the right hand side of the docs.

Version
1.0.0
Base URL
https://www.comet.com/opik/api

MCP OAuth8 operations

MCP OAuth 2.1 Authorization Server resources

System analytics queries1 operation

Internal endpoint to run Agent Insights free-form SQL

System usage7 operations

System usage related resource

Agent Configs13 operations

Agent configuration management

Agent Insights Jobs4 operations

Per-(workspace, project) Agent Insights report configuration

Agent Insights4 operations

Agent Insights report results

Alerts7 operations

Alert resources

Annotation Queues11 operations

Private annotation queue operations

Assertion Results1 operation

Assertion result related resources

Attachments6 operations

Attachments related resources

Check2 operations

Access check resources

Automation rule evaluators6 operations

Automation rule evaluators resource

Chat Completions1 operation

Chat Completions related resources

Dashboards6 operations

Workspace Dashboard resources

Datasets36 operations

Dataset resources

GETFind datasets/v1/private/datasetsPOSTCreate dataset/v1/private/datasetsPOSTDelete dataset by name/v1/private/datasets/deletePOSTDelete datasets/v1/private/datasets/delete-batchGETGet all dataset export jobs/v1/private/datasets/export-jobsGETGet dataset export job status/v1/private/datasets/export-jobs/{jobId}GETDownload dataset export file/v1/private/datasets/export-jobs/{jobId}/downloadPUTMark dataset export job as viewed/v1/private/datasets/export-jobs/{jobId}/mark-viewedPUTCreate/update dataset items/v1/private/datasets/itemsPATCHBatch update dataset items/v1/private/datasets/items/batchPOSTDelete dataset items/v1/private/datasets/items/deletePOSTCreate dataset items from CSV file/v1/private/datasets/items/from-csvPOSTCreate dataset items from JSON file/v1/private/datasets/items/from-jsonPOSTStream dataset items/v1/private/datasets/items/streamGETGet dataset item by id/v1/private/datasets/items/{itemId}PATCHPartially update dataset item by id/v1/private/datasets/items/{itemId}POSTGet dataset by name/v1/private/datasets/retrievePOSTCreate dataset items from spans/v1/private/datasets/{dataset_id}/items/from-spansPOSTCreate dataset items from traces/v1/private/datasets/{dataset_id}/items/from-tracesDELETEDelete dataset by id/v1/private/datasets/{id}GETGet dataset by id/v1/private/datasets/{id}PUTUpdate dataset by id/v1/private/datasets/{id}POSTExpand dataset with synthetic samples/v1/private/datasets/{id}/expansionsPOSTStart dataset CSV export/v1/private/datasets/{id}/exportGETGet dataset items/v1/private/datasets/{id}/itemsPOSTApply changes to dataset items/v1/private/datasets/{id}/items/changesGETFind dataset items with experiment items/v1/private/datasets/{id}/items/experiments/itemsGETGet dataset items output columns/v1/private/datasets/{id}/items/experiments/items/output/columnsGETGet experiment items stats for dataset/v1/private/datasets/{id}/items/experiments/items/statsGETList dataset versions/v1/private/datasets/{id}/versionsGETCompare latest version with draft/v1/private/datasets/{id}/versions/diffPATCHUpdate dataset version/v1/private/datasets/{id}/versions/hash/{versionHash}POSTCreate version tag/v1/private/datasets/{id}/versions/hash/{versionHash}/tagsPOSTRestore dataset to a previous version/v1/private/datasets/{id}/versions/restorePOSTRetrieve dataset version by name/v1/private/datasets/{id}/versions/retrieveDELETEDelete version tag/v1/private/datasets/{id}/versions/{versionHash}/tags/{tag}

Environments5 operations

Environment related resources

Experiments17 operations

Experiment resources

Feedback-definitions6 operations

Feedback definitions related resources

Guardrails1 operation

Guardrails related resources

Insights Views6 operations

Insights View resources

LLM Models1 operation

LLM model registry resources

LlmProviderKey6 operations

LLM Provider Key

Runners18 operations

Local runner management endpoints

Manual Evaluation3 operations

Manual evaluation resources for traces, threads, and spans

Ollama2 operations

Ollama provider configuration endpoints with OpenAI-compatible API support.

Ollie State3 operations

Ollie pod state persistence

OpenTelemetry Ingestion1 operation

Resource to ingest Traces and Spans via OpenTelemetry

Optimizations7 operations

Optimization resources

Pairing2 operations

Pairing sessions for the opik connect and opik endpoint CLI commands

Projects19 operations

Project related resources

Prompts17 operations

Prompt resources

Report Failures2 operations

Generic failure log for reports/jobs

Reports5 operations

Ollie daily report management

Retention Rules4 operations

Data retention rule management

Service Toggles1 operation

Service Toggles resources

Spans18 operations

Span related resources

Traces35 operations

Trace related resources

GETGet traces by project_name or project_id/v1/private/tracesPOSTCreate trace/v1/private/tracesPATCHBatch update traces/v1/private/traces/batchPOSTCreate traces/v1/private/traces/batchPOSTDelete trace comments/v1/private/traces/comments/deletePATCHUpdate trace comment by id/v1/private/traces/comments/{commentId}POSTDelete traces/v1/private/traces/deleteGETCheck whether a project has traces/v1/private/traces/existsPUTBatch feedback scoring for traces/v1/private/traces/feedback-scoresGETFind Feedback Score names/v1/private/traces/feedback-scores/namesPOSTSearch traces/v1/private/traces/searchGETGet trace stats/v1/private/traces/statsGETGet trace threads/v1/private/traces/threadsPATCHBatch update threads/v1/private/traces/threads/batchPUTClose trace thread(s)/v1/private/traces/threads/closePOSTDelete thread comments/v1/private/traces/threads/comments/deletePATCHUpdate thread comment by id/v1/private/traces/threads/comments/{commentId}POSTDelete trace threads/v1/private/traces/threads/deletePUTBatch feedback scoring for threads/v1/private/traces/threads/feedback-scoresPOSTDelete thread feedback scores/v1/private/traces/threads/feedback-scores/deleteGETFind Trace Threads Feedback Score names/v1/private/traces/threads/feedback-scores/namesPUTOpen trace thread/v1/private/traces/threads/openPOSTGet trace thread/v1/private/traces/threads/retrievePOSTSearch trace threads/v1/private/traces/threads/searchGETGet trace thread stats/v1/private/traces/threads/statsPOSTAdd thread comment/v1/private/traces/threads/{id}/commentsGETGet thread comment/v1/private/traces/threads/{threadId}/comments/{commentId}PATCHUpdate thread/v1/private/traces/threads/{threadModelId}DELETEDelete trace by id/v1/private/traces/{id}GETGet trace by id/v1/private/traces/{id}PATCHUpdate trace by id/v1/private/traces/{id}POSTAdd trace comment/v1/private/traces/{id}/commentsPUTAdd trace feedback score/v1/private/traces/{id}/feedback-scoresPOSTDelete trace feedback score/v1/private/traces/{id}/feedback-scores/deleteGETGet trace comment/v1/private/traces/{traceId}/comments/{commentId}

Welcome Wizard2 operations

Welcome wizard tracking resources

Workspace permissions1 operation

Workspace permissions related resources

Workspaces9 operations

Workspace related resources

Redirect4 operations

Redirects for SDK generated links

Operations2 operations

Documentation menu