Get trace span
Retrieve one hydrated span.
GET
/
v2
/
traces
/
{trace_id}
/
spans
/
{span_id}
Get trace span
curl --request GET \
--url https://api.orq.ai/v2/traces/{trace_id}/spans/{span_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.orq.ai/v2/traces/{trace_id}/spans/{span_id}', 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/{span_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"span": {
"summary": {
"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
},
"attributes": {}
}
}Was this page helpful?
⌘I
Get trace span
curl --request GET \
--url https://api.orq.ai/v2/traces/{trace_id}/spans/{span_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.orq.ai/v2/traces/{trace_id}/spans/{span_id}', 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/{span_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"span": {
"summary": {
"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
},
"attributes": {}
}
}