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

# Get resource

> Access session-owned resources like screenshots and files.

Returns a redirect to a presigned S3 URL for a session-owned resource (screenshots, downloaded files, etc.).

Auth is optional: supports public shares.

**Returns** `302 Redirect` to the presigned URL.

***

## Path parameters

<ParamField path="id" type="string" required>
  The session ID.
</ParamField>

<ParamField path="bucket" type="string" required>
  The resource bucket (e.g., `screenshots`, `files`).
</ParamField>

<ParamField path="key" type="string" required>
  The resource key (path within the bucket).
</ParamField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -L https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/resources/screenshots/step-5.png \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -o screenshot.png
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  client.sessions.get_session_resource(session_id, "screenshots", "step-5.png")
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  await client.sessions.getSessionResource({
    id: sessionId,
    bucket: "screenshots",
    key: "step-5.png",
  });
  ```
</CodeGroup>

The cURL `-L` flag follows the `302` redirect to download the file from S3.
