List spans
const url = 'http://localhost:8080/api/v1/projects/example/spans?sort=start_time&order=asc&limit=50';const options = {method: 'GET', headers: {cookie: 'cetra_session=<cetra_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Query Parameters
Section titled “Query Parameters”Filter DSL expression over the spans view (spec 05).
Full-text search (spec 05 § Full-text search). At most 1,024 bytes (D-G-39).
RFC 3339 timestamp or epoch milliseconds.
Inclusive range start. RFC 3339 or epoch milliseconds.
RFC 3339 timestamp or epoch milliseconds.
Exclusive range end. RFC 3339 or epoch milliseconds.
Sort key for span lists.
Spec 09 § Observability data.
Sort key. Defaults to start time.
Sort direction. Default is descending.
Spec 09 § Conventions.
Sort direction. Defaults to descending.
Page size. Default 50, accepted range 1–1000.
Spec 09 § Conventions.
Maximum number of items to return (1–1000, default 50).
Opaque cursor from a previous page.
Include spans from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false. Spec 05 § Default exclusions.
Include experiment spans. Default false. Spec 05 § Default exclusions.
Responses
Section titled “Responses”One page of spans.
One page of results. next_cursor is null when there is no next page.
object
Items in this page.
Light columns of one span, for lists, trees, and the span stream.
Spec 09 § Response shapes.
object
Cache-read tokens.
Cache-write tokens.
Total cost, USD.
end_time - start_time, nanoseconds. Saturates on overflow.
End, nanoseconds since the Unix epoch. JSON is RFC 3339.
Deployment environment.
First 512 characters of the plain-text input rendering.
Input tokens, including cached tokens.
User metadata.
object
Response model, or the request model when the response names none.
Span name.
First 512 characters of the plain-text output rendering.
Output tokens, including reasoning tokens.
Parent span. Omitted when this span is a root of the received trace.
Prompt name from cetra.prompt.name or Langfuse’s prompt attributes (D-V-15, D-V-16).
Prompt version, a number of at least 1, from the convention that named the prompt.
Normalized provider name.
Reasoning tokens.
Release.
Resource service.name.
Session id.
Span id.
Kind of work.
Start, nanoseconds since the Unix epoch. JSON is RFC 3339.
OTel status.
Status description.
Tags.
Total tokens.
Trace id.
Time to first token, nanoseconds.
End-user id.
Opaque cursor for the next page, or null when this is the last page.
Example
{ "data": [ { "span_kind": "llm", "status": "unset" } ]}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
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).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The server is busy or a dependency is unavailable. Retry later.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}