Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

List spans

GET
/api/v1/projects/{project}/spans
curl --request GET \
--url 'http://localhost:8080/api/v1/projects/example/spans?sort=start_time&order=asc&limit=50' \
--cookie cetra_session=<cetra_session>

Evaluation, playground and assistant traces (environment = cetra-eval, environment = cetra-playground or environment = cetra-assistant) and experiment traces are excluded unless include_eval or include_experiments is set.

project
required
string

Project UUID, URL-encoded org-slug/project-slug, or current.

filter
string

Filter DSL expression over the spans view (spec 05).

search
string

Full-text search (spec 05 § Full-text search). At most 1,024 bytes (D-G-39).

from

RFC 3339 timestamp or epoch milliseconds.

string

Inclusive range start. RFC 3339 or epoch milliseconds.

to

RFC 3339 timestamp or epoch milliseconds.

string

Exclusive range end. RFC 3339 or epoch milliseconds.

sort

Sort key for span lists.

Spec 09 § Observability data.

string
Allowed values: start_time duration cost_total total_tokens

Sort key. Defaults to start time.

order

Sort direction. Default is descending.

Spec 09 § Conventions.

string
Allowed values: asc desc

Sort direction. Defaults to descending.

limit

Page size. Default 50, accepted range 1–1000.

Spec 09 § Conventions.

integer format: int32
default: 50 >= 1 <= 1000

Maximum number of items to return (1–1000, default 50).

cursor
string

Opaque cursor from a previous page.

include_eval
boolean

Include spans from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false. Spec 05 § Default exclusions.

include_experiments
boolean

Include experiment spans. Default false. Spec 05 § Default exclusions.

One page of spans.

Media typeapplication/json

One page of results. next_cursor is null when there is no next page.

object
data
required

Items in this page.

Array<object>

Light columns of one span, for lists, trees, and the span stream.

Spec 09 § Response shapes.

object
cache_read_tokens

Cache-read tokens.

integer format: int64
cache_write_tokens

Cache-write tokens.

integer format: int64
cost_total

Total cost, USD.

number format: double
duration_ns
required

end_time - start_time, nanoseconds. Saturates on overflow.

integer format: int64
end_time
required

End, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
environment

Deployment environment.

string
input_preview

First 512 characters of the plain-text input rendering.

string
input_tokens

Input tokens, including cached tokens.

integer format: int64
metadata
required

User metadata.

object
key
additional properties
string
model

Response model, or the request model when the response names none.

string
name
required

Span name.

string
output_preview

First 512 characters of the plain-text output rendering.

string
output_tokens

Output tokens, including reasoning tokens.

integer format: int64
parent_span_id

Parent span. Omitted when this span is a root of the received trace.

string
/^[0-9a-fA-F]{16}$/
prompt_name

Prompt name from cetra.prompt.name or Langfuse’s prompt attributes (D-V-15, D-V-16).

string
prompt_version

Prompt version, a number of at least 1, from the convention that named the prompt.

integer format: int64
provider

Normalized provider name.

string
reasoning_tokens

Reasoning tokens.

integer format: int64
release

Release.

string
service_name

Resource service.name.

string
session_id

Session id.

string
span_id
required

Span id.

string
/^[0-9a-fA-F]{16}$/
span_kind
required

Kind of work.

string
Allowed values: llm embedding tool agent chain retriever reranker guardrail evaluator span
start_time
required

Start, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
status
required

OTel status.

string
Allowed values: unset ok error
status_message

Status description.

string
tags
required

Tags.

Array<string>
total_tokens

Total tokens.

integer format: int64
trace_id
required

Trace id.

string
/^[0-9a-fA-F]{32}$/
ttft_ns

Time to first token, nanoseconds.

integer format: int64
user_id

End-user id.

string
next_cursor
required

Opaque cursor for the next page, or null when this is the last page.

string | null

Example

{
"data": [
{
"span_kind": "llm",
"status": "unset"
}
]
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The query took longer than its time limit, needed more memory or temporary disk space than allowed, a filter deletion matched more than 100,000 traces, or the owner cannot be that user (code owner_not_allowed).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The server is busy or a dependency is unavailable. Retry later.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}