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

Get a session

GET
/api/v1/projects/{project}/sessions/{session_id}
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.

project
required
string

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

session_id
required
string

Session id.

include_eval
boolean

Include traces from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false.

include_experiments
boolean

Include experiment traces. Default false.

The session and its turns.

Media typeapplication/json

Session summary plus its turns.

Spec 09 § Response shapes.

object
session
required

Session row.

object
cost_total

Sum of trace costs, USD. Omitted when every trace omitted the field.

number format: double
duration_ns
required

end_time - start_time, nanoseconds.

integer format: int64
end_time
required

Latest trace end, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
error_count
required

Sum of the traces’ error_count.

integer format: int64
error_trace_count
required

Number of the session’s traces whose status is error.

integer format: int64
first_input_preview

input_preview of the session’s earliest-starting trace. Omitted when there is none.

string
last_output_preview

output_preview of the session’s latest-starting trace. Omitted when there is none.

string
scores
required

Latest score of each name attached to this session.

Array<object>

The latest score of one name on a trace or session row.

Spec 09 § Response shapes.

object
name
required

Score name.

string
score_id
required

Score id.

string format: uuid
source
required

Who wrote the score.

string
Allowed values: api sdk human end_user llm_judge check webhook issue
value
required

Score value.

One of:

A finite number.

object
data_type
required
string
Allowed values: numeric
value
required

A finite number.

number format: double
session_id
required

Session id.

string
start_time
required

Earliest trace start, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
tags
required

Sorted distinct union of the session’s trace tags.

Array<string>
total_tokens

Sum of trace token totals. Omitted when every trace omitted the field.

integer format: int64
trace_count
required

Number of traces in the session.

integer format: int64
user_id

End-user id.

string
truncated
required

True when traces were omitted because the session is larger than [MAX_SESSION_TRACES].

boolean
turns
required

Traces by start_time. At most [MAX_SESSION_TRACES].

Array<object>

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
input

Root span input.

One of:

A JSON array of canonical messages.

object
format
required

Payload encoding.

string
Allowed values: messages
value
required
Array<object>

One message in a conversation. Spec 01 § Canonical message format.

object
finish_reason

Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).

string | null
name

Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).

string | null
parts
required

Message parts. Always present; empty when the message has none.

Array

One part of a canonical message. Spec 01 § Canonical message format.

One of:

Plain text.

object
content
required

The text.

string
type
required

Part type.

string
Allowed values: text
key
additional properties
any
role
required

Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.

string
key
additional properties
any
output

Root span output.

One of:

A JSON array of canonical messages.

object
format
required

Payload encoding.

string
Allowed values: messages
value
required
Array<object>

One message in a conversation. Spec 01 § Canonical message format.

object
finish_reason

Why generation stopped. Omitted when absent. An explicit null from the source is kept (D65).

string | null
name

Optional speaker name. Omitted when absent. An explicit null from the source is kept (D65).

string | null
parts
required

Message parts. Always present; empty when the message has none.

Array

One part of a canonical message. Spec 01 § Canonical message format.

One of:

Plain text.

object
content
required

The text.

string
type
required

Part type.

string
Allowed values: text
key
additional properties
any
role
required

Message speaker. Known values are system, user, assistant, and tool. Any other string is kept.

string
key
additional properties
any
trace
required

Trace row.

object
cache_read_tokens

Sum of cache-read tokens. Omitted when every span omitted the field.

integer format: int64
cache_write_tokens

Sum of cache-write tokens. Omitted when every span omitted the field.

integer format: int64
cost_total

Sum of span costs, USD. Omitted when every span omitted the field.

number format: double
duration_ns
required

end_time - start_time, nanoseconds.

integer format: int64
end_time
required

Latest span end, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
environment

Deployment environment.

string
error_count
required

Number of spans with status error.

integer format: int64
has_root
required

Whether a span with no parent is present.

boolean
input_preview

Root input preview, or the first llm span’s.

string
input_tokens

Sum of span input tokens. Omitted when every span omitted the field.

integer format: int64
llm_count
required

Number of llm spans.

integer format: int64
metadata
required

Root metadata, filled with keys from later spans when absent.

object
key
additional properties
string
models
required

Sorted distinct model names.

Array<string>
name
required

Root span name, or the earliest span’s name when there is no root.

string
output_preview

Root output preview, or the first llm span’s.

string
output_tokens

Sum of span output tokens. Omitted when every span omitted the field.

integer format: int64
prompts

Distinct name@version of the prompt versions that this trace’s spans link (D-V-15). Omitted when no span links a prompt version.

Array<string>
reasoning_tokens

Sum of reasoning tokens. Omitted when every span omitted the field.

integer format: int64
release

Release.

string
root_span_id

Span id of the root. Omitted when the trace has no root.

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

Latest score of each name attached to this trace.

Array<object>

The latest score of one name on a trace or session row.

Spec 09 § Response shapes.

object
name
required

Score name.

string
score_id
required

Score id.

string format: uuid
source
required

Who wrote the score.

string
Allowed values: api sdk human end_user llm_judge check webhook issue
value
required

Score value.

One of:

A finite number.

object
data_type
required
string
Allowed values: numeric
value
required

A finite number.

number format: double
session_id

Session id.

string
span_count
required

Number of spans.

integer format: int64
start_time
required

Earliest span start, nanoseconds since the Unix epoch. JSON is RFC 3339.

string format: date-time
status
required

error when any span errored, otherwise the root’s status, otherwise unset.

string
Allowed values: unset ok error
tags
required

Sorted distinct tags of every span.

Array<string>
total_tokens

Sum of total tokens. Omitted when every span omitted the field.

integer format: int64
trace_id
required

Trace id.

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

End-user id.

string

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.

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"
}