> ## 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 Service

> Session Service API methods in the Galtea SDK

> [!WARNING]
>
> You are reading the docs of Galtea 5.17. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/session/service.md).

The Session Service in the Galtea SDK allows you to manage [sessions](https://docs.galtea.ai/v5.17/concepts/product/version/session.md) for evaluating your products.
This Service is exposed by the `galtea.sessions` object.

> [!NOTE]
>
> Remember that we will be using the `galtea` object. More information [here](https://docs.galtea.ai/v5.17/sdk/api/galtea.md).

## Quick Example

First, initialize the Galtea SDK:

```python theme={"system"}
galtea = Galtea(api_key="YOUR_API_KEY")
```

Create a session:

```python theme={"system"}
session = galtea.sessions.create(version_id=version_id, test_case_id=test_case_id, is_production=False)
```

Get or create a session with a custom ID:

```python theme={"system"}
session = galtea.sessions.get_or_create(
    custom_id=custom_session_id,
    version_id=version_id,
    test_case_id=test_case_id,
    metadata={"authenticated_user_id": "user-123"},
)
```

List sessions for a version:

```python theme={"system"}
sessions = galtea.sessions.list(version_id=version_id, limit=10)
```

## Service Methods

* [Create Session](https://docs.galtea.ai/v5.17/sdk/api/session/create.md)
* [Get Or Create Session](https://docs.galtea.ai/v5.17/sdk/api/session/get-or-create.md)
* [Update Session](https://docs.galtea.ai/v5.17/sdk/api/session/update.md)
* [Finish Session](https://docs.galtea.ai/v5.17/sdk/api/session/finish.md)
* [List Sessions](https://docs.galtea.ai/v5.17/sdk/api/session/list.md)
* [Get Session](https://docs.galtea.ai/v5.17/sdk/api/session/get.md)
* [Get Session By Custom ID](https://docs.galtea.ai/v5.17/sdk/api/session/get-by-custom-id.md)
* [Delete Session](https://docs.galtea.ai/v5.17/sdk/api/session/delete.md)

## Related

> [card] [Session](https://docs.galtea.ai/v5.17/concepts/product/version/session.md)
>
> A full conversation between a user and an AI system.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.