---
title: "Retrieve a container file"
method: GET
path: "/containers/{container_id}/files/{file_id}"
tags: ["Containers"]
---

# Retrieve a container file

`GET /containers/{container_id}/files/{file_id}`

Returns the metadata of a single file in a container.

## Path parameters

- `container_id` string, required — The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.
- `file_id` string, required — Container file id (`cfile_` + base64url of the file path).

## Response `200`

The container file.

- ContainerFile
  - `bytes` integer, required — File size in bytes.
  - `container_id` string, required — The container the file belongs to — echoes the `container_id` path parameter (OpenAI field name).
  - `created_at` integer, required — Unix timestamp (seconds) when the file was last synced.
  - `id` string, required — Container file id: `cfile_` + base64url of the file path.
  - `object` 'container.file', required
  - `path` string, required — Container-relative file path.
  - `source` 'assistant', required — Container files are always produced by the assistant sandbox.

## Other responses

- `400` — Bad Request - Invalid request parameters or malformed input
- `401` — Unauthorized - Authentication required or invalid credentials
- `403` — Forbidden - Authentication successful but insufficient permissions
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - Unexpected server error
- `503` — Service Unavailable - Service temporarily unavailable

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) · [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openrouterteam/openrouter-api/revisions/35609f67adf9/schema)
