Skip to content

Traces endpoints

List Filter Values

Parameter In Type Required Notes
project_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: FiltersOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/sessions

Section titled “GET /api/v1/projects/{project_id}/sessions”

List Sessions

Parameter In Type Required Notes
project_id path string (uuid) yes
environment query string or null no max length 256
limit query integer no min 1, max 200 Default 50.
cursor query string or null no
from query string (date-time) or null no
to query string (date-time) or null no
Status Description Body
200 Successful Response application/json: Page_SessionSummaryOut_
422 Validation Error application/json: HTTPValidationError

List Traces

Parameter In Type Required Notes
project_id path string (uuid) yes
name query string or null no max length 256
environment query string or null no max length 256
release query string or null no max length 256
model query string or null no max length 256
status query "ok" | "error" or null no
error_class query ErrorClass or null no
prompt_version_id query string (uuid) or null no
score_name query string or null no max length 256
score_min query number or string or null no pattern ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
score_max query number or string or null no pattern ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
score_value query string or null no max length 256
has_scores query boolean or null no
has_retries query boolean or null no
user_id query string or null no max length 256
session_id query string or null no max length 256
tag query string or null no max length 256
metadata_key query string or null no pattern ^[a-z0-9_.-]{1,64}$
metadata_value query string or null no max length 256
q query string or null no Matches the trace name (substring, ignoring case), an exact trace id, or, with 3+ characters, a preview of the input and output of a span started in the window. max length 256
sort query "started_at" | "retry_cost_usd" no Default "started_at".
limit query integer no min 1, max 200 Default 50.
cursor query string or null no
from query string (date-time) or null no
to query string (date-time) or null no
Status Description Body
200 Successful Response application/json: Page_TraceSummaryOut_
422 A parameter is invalid (VALIDATION_ERROR), or a q search matched too much to finish (SEARCH_TOO_BROAD). none

GET /api/v1/projects/{project_id}/traces/{trace_id}

Section titled “GET /api/v1/projects/{project_id}/traces/{trace_id}”

Get Trace

Parameter In Type Required Notes
project_id path string (uuid) yes
trace_id path string yes
Status Description Body
200 Successful Response application/json: TraceDetailOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/traces/{trace_id}/spans/{span_id}

Section titled “GET /api/v1/projects/{project_id}/traces/{trace_id}/spans/{span_id}”

Get Span

One span with its payloads: what trace detail leaves out past its payload budget.

Parameter In Type Required Notes
project_id path string (uuid) yes
trace_id path string yes
span_id path string yes
Status Description Body
200 Successful Response application/json: SpanOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/traces/{trace_id}/spans/{span_id}/cost-explanation

Section titled “GET /api/v1/projects/{project_id}/traces/{trace_id}/spans/{span_id}/cost-explanation”

Explain a span’s cost

Explains a span’s stored cost, one line per token class and fee.

Each line has its quantity, rate, tier factor and amount, and the recomputed total is shown beside the stored one with a status that compares them. The figure is rebuilt from the price row the span was priced with, never from today’s prices. 404 NOT_FOUND when the span is not visible in the project.

Parameter In Type Required Notes
project_id path string (uuid) yes
trace_id path string yes
span_id path string yes
Status Description Body
200 Successful Response application/json: CostExplanationOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/traces/compare

Section titled “GET /api/v1/projects/{project_id}/traces/compare”

Compare Traces

Two traces of this project, step by step: B’s change against A.

Registered before /traces/{trace_id}, which would otherwise take compare as an id. A missing trace is a 404 that does not say which one, as trace detail’s.

Parameter In Type Required Notes
project_id path string (uuid) yes
a query string yes min length 1, max length 256
b query string yes min length 1, max length 256
Status Description Body
200 Successful Response application/json: TraceCompareOut
422 Validation Error application/json: HTTPValidationError