> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Session

> A group of inference results that make up a full conversation

## What is a Session?

A session groups the turns of a single conversation between a user and your AI product. It contains one or more [inference results](/concepts/product/version/session/inference-result) (input/output pairs) and can be evaluated as a whole using conversational metrics.

You create sessions explicitly with `sessions.create()` for full control over session lifecycle and grouping. If you give a session your own `custom_id`, you can then reference it by that id when [creating an inference result](/sdk/api/inference-result/create): pass it as `session_custom_id` (with a `version_id` or `product_id` anchor) and Galtea appends the turn to that existing session. Production sessions can also be created automatically by ingesting OpenTelemetry traces; see [Monitor Real User Traffic via OpenTelemetry](/sdk/tutorials/monitor-real-user-traffic-with-opentelemetry).

You can create, view, and manage sessions programmatically using the [Galtea SDK](/sdk/api/session/service).

## SDK Integration

<Card title="Session Service SDK" icon="clock-rotate-left" iconType="solid" href="/sdk/api/session/service">
  Manage sessions using the Python SDK
</Card>

## Session Properties

<ResponseField name="Custom ID" type="Text" required>
  The custom ID associated with the session.
  This is usually a client-side generated ID that identifies the conversation session between a user and a LLM app.
  It is unique per version: logging an inference result with a `session_custom_id` finds the existing session with that custom ID and appends to it (see [Create Inference Result](/sdk/api/inference-result/create)).
</ResponseField>

<ResponseField name="Version" type="Version" required>
  The version associated with the session.
</ResponseField>

<ResponseField name="Test Case" type="Test Case" optional>
  The test case associated with the session. This is typically used for non-production evaluations.
</ResponseField>

<ResponseField name="Is Production" type="Boolean" optional>
  Indicates whether the session represents real production traffic. Defaults to `True` when `test_case_id` is omitted at creation and `False` when a `test_case_id` is provided. Externally-ingested sessions (e.g. imported traces) may be classified as non-production without supplying a `test_case_id`. The only forbidden combination is `test_case_id` set together with `is_production=True`. When `test_case_id` is set, the session `context` is derived from the test case; otherwise the `context` from the request is used directly.
</ResponseField>

<ResponseField name="Context" type="Text" optional>
  The context provided to the AI product during the session or ground-truth related context. For production sessions, this value is taken from the request. For non-production sessions, it is derived from the linked test case.
</ResponseField>

<ResponseField name="Metadata" type="Object" optional>
  Additional custom metadata about the session. This can be used to store any relevant information that doesn't fit into the other fields.
</ResponseField>

<ResponseField name="Status" type="Enum">
  The current status of the session. Possible values:

  * `PENDING`: The session has been created but has not yet received all inference results.
  * `COMPLETED`: The session has finished successfully.
  * `FAILED`: The session encountered an error during processing.
</ResponseField>

<ResponseField name="Error" type="Text" optional>
  Any error message associated with the session. This is useful for tracking failed sessions or sessions that encountered issues.
</ResponseField>

<ResponseField name="Recording URI" type="Text" optional>
  The canonical storage URI of the full-call recording for telephony sessions. This field is read-only and populated by the API after a phone-call session's recording is captured and processed. Null for non-telephony sessions or before the recording is available. Resolve to a playable URL via the storage endpoint.
</ResponseField>

## Related

<CardGroup cols={3}>
  <Card title="Concepts overview" icon="diagram-project" iconType="solid" href="/concepts/overview">
    How Galtea's concepts connect — diagram + per-entity quick reference.
  </Card>

  <Card title="Evaluation" icon="clipboard-check" href="/concepts/product/version/session/evaluation">
    Learn how evaluations score inference results within a session.
  </Card>

  <Card title="Inference Result" icon="message-bot" href="/concepts/product/version/session/inference-result">
    Understand the input/output pairs that make up a session.
  </Card>

  <Card title="Simulating Conversations" icon="comments" href="/sdk/tutorials/simulating-conversations">
    Tutorial on running multi-turn conversation simulations.
  </Card>
</CardGroup>
