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

# Sessions

A <code>session</code> groups events related to long-term user interactions and can include multiple traces, with each trace potentially having many LLM requests. In a chatbot, a session might represent the whole conversation, while for an agent, it might cover a single task execution. The session's scope depends on your application's needs. Baserun uses a session identifier to organize traces and LLM requests into sessions.

```python theme={null}
OpenAI(session: Optional[str], **kwargs) -> OpenAI:
```

### Arguments

<ParamField path="session" type="string">
  An identifier for the current session. For example, you might user a session
  ID from your application framework or authenticiation library.
</ParamField>

### Instructions

To create a session, simply pass the session when creating the client, or set the property post-instantiation.

```python theme={null}
client = OpenAI(session="session123")
# Alternatively
client.session = "session123"
```
