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

# Get Session

> Retrieve session details and statistics

### Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token. Format: `Bearer synthra_live_abc123def456`
</ParamField>

### Path Parameters

<ParamField path="sessionId" type="string" required>
  Unique session identifier. Format: `session_<16 chars>`
</ParamField>

### Response

<ResponseField name="sessionId" type="string">
  Unique session identifier
</ResponseField>

<ResponseField name="userId" type="string">
  User identifier associated with this session
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of session creation
</ResponseField>

<ResponseField name="expiresAt" type="string">
  ISO 8601 timestamp when session will auto-expire
</ResponseField>

<ResponseField name="lastActivity" type="string">
  ISO 8601 timestamp of last message
</ResponseField>

<ResponseField name="messageCount" type="number">
  Total number of messages in session
</ResponseField>

<ResponseField name="tokenUsage" type="object">
  Token usage statistics
</ResponseField>

<ResponseField name="metadata" type="object">
  Custom metadata attached to session
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.synthra.ai/v1/sessions/session_abc123def456 \
    --header 'Authorization: Bearer synthra_live_abc123def456'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.synthra.ai/v1/sessions/session_abc123def456',
    {
      headers: {
        'Authorization': `Bearer ${process.env.SYNTHRA_API_KEY}`
      }
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.synthra.ai/v1/sessions/session_abc123def456',
      headers={
          'Authorization': f'Bearer {api_key}'
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "sessionId": "session_abc123def456",
    "userId": "user_9f8e7d6c5b4a",
    "createdAt": "2024-03-08T14:30:00Z",
    "expiresAt": "2024-03-09T14:30:00Z",
    "lastActivity": "2024-03-08T15:45:23Z",
    "messageCount": 15,
    "tokenUsage": {
      "total": 1847,
      "prompt": 923,
      "completion": 924
    },
    "metadata": {
      "source": "web",
      "language": "en"
    }
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": {
      "code": "session_not_found",
      "message": "Session does not exist or has expired"
    }
  }
  ```
</ResponseExample>
