Get a session
const url = 'http://localhost:8080/api/v1/projects/example/sessions/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/sessions/example \ --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. Turns are the session’s traces by start time, at most 1000. input and output are the root span’s payloads, omitted when the trace has no root.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Session id.
Query Parameters
Section titled “Query Parameters”Include traces from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false.
Include experiment traces. Default false.
Responses
Section titled “Responses”The session and its turns.
Session summary plus its turns.
Spec 09 § Response shapes.
object
Session row.
object
Sum of trace costs, USD. Omitted when every trace omitted the field.
end_time - start_time, nanoseconds.
Latest trace end, nanoseconds since the Unix epoch. JSON is RFC 3339.
Sum of the traces’ error_count.
Number of the session’s traces whose status is error.
input_preview of the session’s earliest-starting trace. Omitted when there is none.
output_preview of the session’s latest-starting trace. Omitted when there is none.
Latest score of each name attached to this session.
The latest score of one name on a trace or session row.
Spec 09 § Response shapes.
object
Score name.
Score id.
Who wrote the score.
Score value.
A finite number.
object
A finite number.
True or false. Stored numerically as 1 or 0.
object
True or false. Stored numerically as 1 or 0.
A label and an optional numeric mapping.
object
A label and an optional numeric mapping.
object
Category label. Stored in value_str.
Optional numeric mapping. Stored in value_num. Omitted from JSON when absent.
Free text.
object
Free text.
Session id.
Earliest trace start, nanoseconds since the Unix epoch. JSON is RFC 3339.
Sorted distinct union of the session’s trace tags.
Sum of trace token totals. Omitted when every trace omitted the field.
Number of traces in the session.
End-user id.
True when traces were omitted because the session is larger than [MAX_SESSION_TRACES].
Traces by start_time. At most [MAX_SESSION_TRACES].
One trace in a session, oldest first, with the root span’s payloads.
input and output are omitted when the trace has no root. Spec 09 § Response shapes.
object
Root span input.
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.
Root span output.
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.
Trace row.
object
Sum of cache-read tokens. Omitted when every span omitted the field.
Sum of cache-write tokens. Omitted when every span omitted the field.
Sum of span costs, USD. Omitted when every span omitted the field.
end_time - start_time, nanoseconds.
Latest span end, nanoseconds since the Unix epoch. JSON is RFC 3339.
Deployment environment.
Number of spans with status error.
Whether a span with no parent is present.
Root input preview, or the first llm span’s.
Sum of span input tokens. Omitted when every span omitted the field.
Number of llm spans.
Root metadata, filled with keys from later spans when absent.
object
Sorted distinct model names.
Root span name, or the earliest span’s name when there is no root.
Root output preview, or the first llm span’s.
Sum of span output tokens. Omitted when every span omitted the field.
Distinct name@version of the prompt versions that this trace’s spans link (D-V-15).
Omitted when no span links a prompt version.
Sum of reasoning tokens. Omitted when every span omitted the field.
Release.
Span id of the root. Omitted when the trace has no root.
Latest score of each name attached to this trace.
The latest score of one name on a trace or session row.
Spec 09 § Response shapes.
object
Score name.
Score id.
Who wrote the score.
Score value.
A finite number.
object
A finite number.
True or false. Stored numerically as 1 or 0.
object
True or false. Stored numerically as 1 or 0.
A label and an optional numeric mapping.
object
A label and an optional numeric mapping.
object
Category label. Stored in value_str.
Optional numeric mapping. Stored in value_num. Omitted from JSON when absent.
Free text.
object
Free text.
Session id.
Number of spans.
Earliest span start, nanoseconds since the Unix epoch. JSON is RFC 3339.
error when any span errored, otherwise the root’s status, otherwise unset.
Sorted distinct tags of every span.
Sum of total tokens. Omitted when every span omitted the field.
Trace id.
End-user id.
Example
{ "session": { "scores": [ { "source": "api", "value": { "data_type": "numeric" } } ] }, "turns": [ { "input": { "format": "messages", "value": [ { "parts": [ { "type": "text" } ] } ] }, "output": { "format": "messages", "value": [ { "parts": [ { "type": "text" } ] } ] }, "trace": { "scores": [ { "source": "api", "value": { "data_type": "numeric" } } ], "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"}