Get a span
const url = 'http://localhost:8080/api/v1/projects/example/traces/example/spans/example';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/traces/example/spans/example \ --cookie cetra_session=<cetra_session>Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Trace id, 16 bytes as hex. Responses use lowercase; requests may use either case. All zeros is invalid.
Trace id, 16 bytes as hex.
Span id, 8 bytes as hex. Responses use lowercase; requests may use either case. All zeros is invalid.
Span id, 8 bytes as hex.
Responses
Section titled “Responses”The span, including payloads.
Every stored span column except project_id, plus computed duration_ns and model.
input_format and output_format are the format tag of [Payload]. Spec 01 § Span.
object
Span attributes not consumed by normalization.
object
Cache-read tokens.
Cache-write tokens.
Conventions detected on the span.
Input cost, USD.
Output cost, USD.
How cost was obtained.
Total cost, USD.
end_time - start_time, nanoseconds. Saturates on overflow.
End, nanoseconds since the Unix epoch. JSON is RFC 3339.
Deployment environment.
Span events.
One span event as returned by the API.
Absent stored attributes become {}. Spec 01 events.
object
Event attributes. {} when the stored span had none.
Event name.
Event time, nanoseconds since the Unix epoch. JSON is RFC 3339.
Server receive time, nanoseconds since the Unix epoch. JSON is RFC 3339.
Parsed input. Omitted when the stored span has no input text.
A JSON array of canonical messages.
object
Payload encoding.
One message in a conversation. Spec 01 § Canonical message format.
object
Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).
Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).
Message parts. Always present; empty when the message has none.
One part of a canonical message. Spec 01 § Canonical message format.
Plain text.
object
The text.
Part type.
Model reasoning, separate from the user-visible text.
object
The reasoning text.
Part type.
A tool or function call requested by the model.
object
Arguments, as JSON. Absent for a call without arguments.
Provider call id, when the source has one. Omitted when absent. An explicit null from the source is kept (D65).
Tool name.
Part type.
The result of a tool call.
object
Provider call id, when the source has one. Omitted when absent. An explicit null from the source is kept (D65).
Tool result, as JSON.
Part type.
Media addressed by a URI, including media:// after extraction.
object
MIME type, when known. Omitted when absent. An explicit null from the source is kept (D65).
Spoken text of the media (an audio part’s transcript), when known. Omitted when absent. An explicit null from the source is kept (D65).
Part type.
The URI.
Inline base64 media, before extraction replaces it with a URI.
object
Base64 payload.
MIME type, when known. Omitted when absent. An explicit null from the source is kept (D65).
Spoken text of the media (an audio part’s transcript), when known. Omitted when absent. An explicit null from the source is kept (D65).
Part type.
A part type this version does not model; render as JSON. Its type is never one of the modelled types, so exactly one Part branch matches a valid part. Parts that are not objects, or modelled types missing a required field, are kept verbatim by the server but are outside this schema.
object
Part type, when the payload has one.
Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.
Any JSON value.
object
Payload encoding.
Any JSON value.
Plain text.
object
Payload encoding.
Plain text.
First 512 characters of the plain-text input rendering.
Input tokens, including cached tokens.
Span links.
One span link as returned by the API.
Absent stored attributes become {}. Spec 01 links.
object
Link attributes. {} when the stored span had none.
Linked span id.
Linked trace id.
SHA-256 hex of extracted media blobs.
User metadata.
object
Response model, or the request model when the response names none.
Span name.
GenAI operation name.
Parsed output. Omitted when the stored span has no output text.
A JSON array of canonical messages.
object
Payload encoding.
One message in a conversation. Spec 01 § Canonical message format.
object
Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).
Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).
Message parts. Always present; empty when the message has none.
One part of a canonical message. Spec 01 § Canonical message format.
Plain text.
object
The text.
Part type.
Model reasoning, separate from the user-visible text.
object
The reasoning text.
Part type.
A tool or function call requested by the model.
object
Arguments, as JSON. Absent for a call without arguments.
Provider call id, when the source has one. Omitted when absent. An explicit null from the source is kept (D65).
Tool name.
Part type.
The result of a tool call.
object
Provider call id, when the source has one. Omitted when absent. An explicit null from the source is kept (D65).
Tool result, as JSON.
Part type.
Media addressed by a URI, including media:// after extraction.
object
MIME type, when known. Omitted when absent. An explicit null from the source is kept (D65).
Spoken text of the media (an audio part’s transcript), when known. Omitted when absent. An explicit null from the source is kept (D65).
Part type.
The URI.
Inline base64 media, before extraction replaces it with a URI.
object
Base64 payload.
MIME type, when known. Omitted when absent. An explicit null from the source is kept (D65).
Spoken text of the media (an audio part’s transcript), when known. Omitted when absent. An explicit null from the source is kept (D65).
Part type.
A part type this version does not model; render as JSON. Its type is never one of the modelled types, so exactly one Part branch matches a valid part. Parts that are not objects, or modelled types missing a required field, are kept verbatim by the server but are outside this schema.
object
Part type, when the payload has one.
Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.
Any JSON value.
object
Payload encoding.
Any JSON value.
Plain text.
object
Payload encoding.
Plain text.
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.
Model named in the request.
Request parameters. A JSON string when the stored text is not JSON.
Resource attributes except service.name.
object
Model named in the response.
Normalization version of this row.
Instrumentation scope name.
Instrumentation scope version.
Resource service.name.
Session id.
Span id.
Kind of work.
Start, nanoseconds since the Unix epoch. JSON is RFC 3339.
OTel status.
Status description.
System instructions. A JSON string when the stored text is not JSON.
Tags.
Tool definitions. A JSON string when the stored text is not JSON.
Total tokens.
Trace id.
Names of attributes truncated at ingest.
Time to first token, nanoseconds.
End-user id.
Example
{ "conventions": [ "cetra" ], "cost_source": "computed", "input": { "format": "messages", "value": [ { "parts": [ { "type": "text" } ] } ] }, "output": { "format": "messages", "value": [ { "parts": [ { "type": "text" } ] } ] }, "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"}