For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • POSTAdd thread comment
        • POSTAdd trace comment
        • PUTAdd trace feedback score
        • POSTCreate traces
        • PATCHBatch update traces
        • PATCHBatch update threads
        • PUTClose trace thread(s)
        • GETGet traces by project_name or project_id
        • POSTCreate trace
        • GETGet trace by id
        • DELDelete trace by id
        • PATCHUpdate trace by id
        • POSTDelete thread comments
        • POSTDelete thread feedback scores
        • POSTDelete trace comments
        • POSTDelete trace feedback score
        • POSTDelete trace threads
        • POSTDelete traces
        • GETFind Feedback Score names
        • GETFind Trace Threads Feedback Score names
        • GETGet trace stats
        • GETGet thread comment
        • GETGet trace thread stats
        • GETGet trace comment
        • POSTGet trace thread
        • GETGet trace threads
        • PUTOpen trace thread
        • PUTBatch feedback scoring for threads
        • PUTBatch feedback scoring for traces
        • POSTSearch trace threads
        • POSTSearch traces
        • PATCHUpdate thread
        • PATCHUpdate thread comment by id
        • PATCHUpdate trace comment by id
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferenceTraces

Get trace by id

GET
/v1/private/traces/:id
GET
/api/v1/private/traces/:id
$curl http://localhost:5173/api/v1/private/traces/id
200Retrieved
1{
2 "start_time": "2024-01-15T09:30:00Z",
3 "id": "string",
4 "project_id": "string",
5 "name": "string",
6 "end_time": "2024-01-15T09:30:00Z",
7 "input": {},
8 "output": {},
9 "metadata": {},
10 "tags": [
11 "string"
12 ],
13 "error_info": {
14 "exception_type": "string",
15 "traceback": "string",
16 "message": "string"
17 },
18 "usage": {},
19 "created_at": "2024-01-15T09:30:00Z",
20 "last_updated_at": "2024-01-15T09:30:00Z",
21 "created_by": "string",
22 "last_updated_by": "string",
23 "feedback_scores": [
24 {
25 "name": "string",
26 "value": 1.1,
27 "source": "ui",
28 "category_name": "string",
29 "reason": "string",
30 "created_at": "2024-01-15T09:30:00Z",
31 "last_updated_at": "2024-01-15T09:30:00Z",
32 "created_by": "string",
33 "last_updated_by": "string",
34 "value_by_author": {}
35 }
36 ],
37 "span_feedback_scores": [
38 {
39 "name": "string",
40 "value": 1.1,
41 "source": "ui",
42 "category_name": "string",
43 "reason": "string",
44 "created_at": "2024-01-15T09:30:00Z",
45 "last_updated_at": "2024-01-15T09:30:00Z",
46 "created_by": "string",
47 "last_updated_by": "string",
48 "value_by_author": {}
49 }
50 ],
51 "comments": [
52 {
53 "text": "string",
54 "id": "string",
55 "created_at": "2024-01-15T09:30:00Z",
56 "last_updated_at": "2024-01-15T09:30:00Z",
57 "created_by": "string",
58 "last_updated_by": "string"
59 }
60 ],
61 "guardrails_validations": [
62 {
63 "span_id": "string",
64 "checks": [
65 {
66 "name": "TOPIC",
67 "result": "passed"
68 }
69 ]
70 }
71 ],
72 "total_estimated_cost": 1.1,
73 "span_count": 1,
74 "duration": 1.1,
75 "ttft": 1.1,
76 "thread_id": "string",
77 "visibility_mode": "default",
78 "llm_span_count": 1,
79 "has_tool_spans": true,
80 "providers": [
81 "string"
82 ],
83 "experiment": {
84 "id": "string",
85 "name": "string",
86 "dataset_id": "string",
87 "dataset_item_id": "string"
88 },
89 "source": "sdk",
90 "environment": "string"
91}
Get trace by id
Was this page helpful?
Previous

Delete trace by id

Next
Built with

Path parameters

idstringRequiredformat: "uuid"

Query parameters

strip_attachmentsbooleanOptionalDefaults to false

Response

Trace resource
start_timedatetime
idstringformat: "uuid"
project_idstringRead-onlyformat: "uuid"
namestring
end_timedatetime
inputmap from strings to any or list of objects or string
outputmap from strings to any or list of objects or string
metadatamap from strings to any or list of objects or string
tagslist of strings
error_infoobject
usagemap from strings to longsRead-only
created_atdatetimeRead-only
last_updated_atdatetime
created_bystringRead-only
last_updated_bystringRead-only
feedback_scoreslist of objectsRead-only
span_feedback_scoreslist of objectsRead-only
Aggregated feedback scores from all spans in this trace, averaged by score name
commentslist of objectsRead-only
guardrails_validationslist of objectsRead-only
total_estimated_costdoubleRead-only
span_countintegerRead-only
durationdoubleRead-only

Duration in milliseconds as a decimal number to support sub-millisecond precision

ttftdouble
Time to first token in milliseconds
thread_idstring
visibility_modeenumRead-only
Allowed values:
llm_span_countintegerRead-only
has_tool_spansbooleanRead-only
providerslist of stringsRead-only
List of unique provider names from all spans in this trace, sorted alphabetically
experimentobjectRead-only
Experiment reference with ID, name, dataset ID, and dataset item ID
sourceenum
Allowed values:
environmentstring0-150 characters