Aggregate trace metrics using the structured trace filter contract.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.aggregate()
# Handle response
print(res)
models.AggregateTracesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
List trace fields that support facet value discovery.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.list_facets()
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListTraceFacetsResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
List values and counts for one trace facet field.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.list_facet_values(field="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
field |
str |
✔️ |
N/A |
from_ |
date |
➖ |
N/A |
to |
date |
➖ |
N/A |
limit |
Optional[int] |
➖ |
N/A |
filter_operator |
Optional[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListTraceFacetValuesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
List currently supported static trace fields.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.list_fields()
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListTraceFieldsResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Run an OQL trace query. OQL is validated against the trace field registry and compiled through the trace planner.
from orq_ai_sdk import Orq
from orq_ai_sdk.utils import parse_datetime
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.query(from_=parse_datetime("2025-02-10T08:55:05.233Z"), to=parse_datetime("2024-12-12T15:00:42.128Z"), oql="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
from_ |
date |
✔️ |
N/A |
to |
date |
✔️ |
N/A |
oql |
str |
✔️ |
N/A |
limit |
Optional[int] |
➖ |
N/A |
page_token |
Optional[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.QueryTracesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Search trace summaries using the structured trace filter contract.
from orq_ai_sdk import Orq
from orq_ai_sdk.utils import parse_datetime
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.search(from_=parse_datetime("2025-05-02T22:00:26.030Z"), to=parse_datetime("2025-09-17T16:33:38.335Z"))
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
from_ |
date |
✔️ |
N/A |
to |
date |
✔️ |
N/A |
filters |
List[models.TraceFilter] |
➖ |
N/A |
filter_operator |
Optional[str] |
➖ |
N/A |
query |
Optional[str] |
➖ |
N/A |
sort |
List[models.TraceSort] |
➖ |
N/A |
limit |
Optional[int] |
➖ |
N/A |
page_token |
Optional[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.SearchTracesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieve one trace summary by trace id.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.get(trace_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
trace_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.GetTraceResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
List canonical span summaries for a trace.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.list_spans(trace_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
trace_id |
str |
✔️ |
N/A |
limit |
Optional[int] |
➖ |
N/A |
page_token |
Optional[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListTraceSpansResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieve one hydrated span.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.traces.get_span(trace_id="<id>", span_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
trace_id |
str |
✔️ |
N/A |
span_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.GetTraceSpanResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |