List trace spans
List canonical span summaries for a trace.
GET
/
v2
/
traces
/
{trace_id}
/
spans
List trace spans
curl --request GET \
--url https://api.orq.ai/v2/traces/{trace_id}/spans \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.orq.ai/v2/traces/{trace_id}/spans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.orq.ai/v2/traces/{trace_id}/spans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "<string>",
"data": [
{
"object": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"parent_span_id": "<string>",
"name": "<string>",
"type": "<string>",
"operation": "<string>",
"status": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"provider": "<string>",
"model": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_cached_tokens": 123,
"prompt_audio_tokens": 123,
"completion_reasoning_tokens": 123,
"completion_audio_tokens": 123,
"completion_accepted_prediction_tokens": 123,
"completion_rejected_prediction_tokens": 123
},
"cost": {
"input": 123,
"output": 123,
"cache_read": 123,
"cache_write": 123,
"reasoning": 123,
"web_search": 123,
"total": 123,
"currency": "<string>",
"cached": 123,
"audio_input": 123,
"audio_output": 123,
"accepted_prediction": 123,
"rejected_prediction": 123,
"billable": true,
"pricing_tier": "<string>",
"threshold_exceeded": true,
"integration_id": "<string>"
},
"has_detail": true
}
],
"has_more": true,
"next_page_token": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Was this page helpful?
⌘I
List trace spans
curl --request GET \
--url https://api.orq.ai/v2/traces/{trace_id}/spans \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.orq.ai/v2/traces/{trace_id}/spans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.orq.ai/v2/traces/{trace_id}/spans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "<string>",
"data": [
{
"object": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"parent_span_id": "<string>",
"name": "<string>",
"type": "<string>",
"operation": "<string>",
"status": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"provider": "<string>",
"model": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_cached_tokens": 123,
"prompt_audio_tokens": 123,
"completion_reasoning_tokens": 123,
"completion_audio_tokens": 123,
"completion_accepted_prediction_tokens": 123,
"completion_rejected_prediction_tokens": 123
},
"cost": {
"input": 123,
"output": 123,
"cache_read": 123,
"cache_write": 123,
"reasoning": 123,
"web_search": 123,
"total": 123,
"currency": "<string>",
"cached": 123,
"audio_input": 123,
"audio_output": 123,
"accepted_prediction": 123,
"rejected_prediction": 123,
"billable": true,
"pricing_tier": "<string>",
"threshold_exceeded": true,
"integration_id": "<string>"
},
"has_detail": true
}
],
"has_more": true,
"next_page_token": "<string>"
}