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

# Get Session Info

> Retrieve information about a session

## Request

<ParamField path="sessionId" type="string" required>
  The session ID to retrieve information for
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

## Response

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

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp when session was created
</ResponseField>

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

<ResponseField name="lastActive" type="string">
  ISO 8601 timestamp of last activity
</ResponseField>

<ResponseField name="state" type="string">
  Session state: "active", "idle", or "deep-sleep"
</ResponseField>

<ResponseField name="filesCount" type="integer">
  Number of files in /workspace
</ResponseField>

<ResponseField name="activeProcesses" type="integer">
  Number of running processes
</ResponseField>

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

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.buntime.sh/sessions/ses_abc123 \
    -H "Authorization: Bearer $BUNTIME_API_KEY"
  ```

  ```typescript TypeScript theme={null}
  const info = await client.sessions.info({
    sessionId: 'ses_abc123'
  });

  console.log('Created:', info.createdAt);
  console.log('Files:', info.filesCount);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "sessionId": "ses_abc123def456",
    "createdAt": "2024-01-19T10:30:00Z",
    "expiresAt": "2024-01-20T10:30:00Z",
    "lastActive": "2024-01-19T11:00:00Z",
    "state": "active",
    "filesCount": 12,
    "activeProcesses": 1,
    "metadata": {
      "userId": "user_123"
    }
  }
  ```
</ResponseExample>
