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.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • API Reference
      • POSTCreate an experiment
      • POSTFilter experiments
      • GETRetrieve an experiment
      • DELDelete an experiment
      • GETList or export experiment traces
      • POSTFilter experiment traces
      • GETRetrieve an experiment trace
      • PATCHResume a wait workflow trace
      • GETGet experiment trace summary
      • GETList experiments
      • GETList experiments with filters
      • GETGet experiments summary
      • POSTFilter experiments summary
      • PUTReplace an experiment
      • PATCHUpdate an experiment
      • POSTFilter experiment trace summary
      • GETGet experiment score histogram
      • POSTGet experiment score histogram with filters
  • Reference
    • Filters API Reference
LogoLogo
DiscordPlatform
API ReferenceExperiments

Retrieve an experiment trace

GET
https://api.respan.ai/api/v2/experiments/:experiment_id/logs/:log_id/
GET
/api/v2/experiments/:experiment_id/logs/:log_id/
$curl https://api.respan.ai/api/v2/experiments/experiment_id/logs/log_id/ \
> -H "Authorization: Bearer sk_live_xxxxx" \
> -H "Content-Type: application/json"
1{
2 "id": "trace_789abc",
3 "trace_unique_id": "trace_789abc",
4 "root_span_unique_id": "root_span_123xyz",
5 "environment": "production",
6 "customer_identifier": "customer_42",
7 "name": "Dataset Entry 1",
8 "input": {
9 "prompt": "Translate the following English text to French: 'Hello, how are you?'"
10 },
11 "output": {
12 "translation": "Bonjour, comment ça va ?"
13 },
14 "expected_output": {
15 "translation": "Bonjour, comment allez-vous ?"
16 },
17 "status": "success",
18 "comparison_key": "translate_en_fr_001",
19 "start_time": "2024-01-15T09:30:00Z",
20 "end_time": "2024-01-15T09:30:01Z",
21 "duration": 1,
22 "span_count": 3,
23 "llm_call_count": 1,
24 "total_cost": 0.0012,
25 "total_tokens": 45,
26 "total_prompt_tokens": 20,
27 "total_completion_tokens": 25,
28 "error_count": 0,
29 "scores": {
30 "evaluator_grammar": {
31 "evaluator_id": "evaluator_grammar",
32 "evaluator_slug": "grammar_check",
33 "evaluator_name": "Grammar Evaluator",
34 "score_value_type": "numerical",
35 "numerical_value": 0.95,
36 "avg_score": 0.95
37 },
38 "evaluator_fluency": {
39 "evaluator_id": "evaluator_fluency",
40 "evaluator_slug": "fluency_check",
41 "evaluator_name": "Fluency Evaluator",
42 "score_value_type": "percentage",
43 "numerical_value": 92.5,
44 "avg_score": 92.5
45 }
46 },
47 "span_tree": [
48 {
49 "id": "span_001",
50 "trace_unique_id": "trace_789abc",
51 "root_span_unique_id": "root_span_123xyz",
52 "environment": "production",
53 "customer_identifier": "customer_42",
54 "name": "Dataset Entry 1",
55 "input": {
56 "prompt": "Translate the following English text to French: 'Hello, how are you?'"
57 },
58 "output": {
59 "translation": "Bonjour, comment ça va ?"
60 },
61 "expected_output": {
62 "translation": "Bonjour, comment allez-vous ?"
63 },
64 "status": "success",
65 "comparison_key": "translate_en_fr_001",
66 "start_time": "2024-01-15T09:30:00Z",
67 "end_time": "2024-01-15T09:30:01Z",
68 "duration": 1,
69 "span_count": 1,
70 "llm_call_count": 1,
71 "total_cost": 0.0012,
72 "total_tokens": 45,
73 "total_prompt_tokens": 20,
74 "total_completion_tokens": 25,
75 "error_count": 0,
76 "scores": {
77 "evaluator_grammar": {
78 "evaluator_id": "evaluator_grammar",
79 "evaluator_slug": "grammar_check",
80 "evaluator_name": "Grammar Evaluator",
81 "score_value_type": "numerical",
82 "numerical_value": 0.95,
83 "avg_score": 0.95
84 },
85 "evaluator_fluency": {
86 "evaluator_id": "evaluator_fluency",
87 "evaluator_slug": "fluency_check",
88 "evaluator_name": "Fluency Evaluator",
89 "score_value_type": "percentage",
90 "numerical_value": 92.5,
91 "avg_score": 92.5
92 }
93 },
94 "span_name": "workflow.completion",
95 "log_type": "chat",
96 "model": "gpt-4",
97 "children": [
98 {}
99 ]
100 }
101 ]
102}
Retrieve one experiment trace with its full span tree and enriched evaluator scores.
Was this page helpful?
Previous

Resume a wait workflow trace

Next
Built with

Path parameters

experiment_idstringRequired

Experiment ID returned as id in experiment responses.

log_idstringRequired

Trace ID returned as id in experiment trace list responses.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY for API key auth or Bearer <JWT> for dashboard auth.

Response

Experiment trace details.
idstring

Trace ID. Use this value as log_id for trace detail and wait-workflow resume routes.

trace_unique_idstring
Trace unique ID.
root_span_unique_idstring or null
environmentstring or null
customer_identifierstring or null
namestring or null
inputany or null
Trace input. May be a JSON value or serialized JSON string depending on storage.
outputany or null
Trace output. May be a JSON value or serialized JSON string depending on storage.
expected_outputany or null
Expected output from the dataset row, when available.
statusstring or null
comparison_keystring or null
Stable key for comparing the same input across experiments.
start_timedatetime or null
end_timedatetime or null
durationdouble or null
Trace duration in seconds.
span_countinteger or null
llm_call_countinteger or null
total_costdouble or null
total_tokensinteger or null
total_prompt_tokensinteger or null
total_completion_tokensinteger or null
error_countinteger or null
scoresmap from strings to objects

Scores keyed by evaluator ID or slug. Each value includes evaluator metadata and the score value field matching score_value_type.

span_treelist of objects
Hierarchical span tree for this trace.

Errors

401
Unauthorized Error
404
Not Found Error