---
title: "List container files"
method: GET
path: "/containers/{container_id}/files"
tags: ["Containers"]
---

# List container files

`GET /containers/{container_id}/files`

Lists the files in a container, in lexicographic path order. The container id is the canonical id returned in bash/shell tool results; a restarted session is a separate container with its own id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way.

## 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.

## Query parameters

- `limit` integer — Maximum number of files to return (1-1000). Defaults to 100 when absent.
- `after` string — Forward cursor: a container file id from a previous page (typically `last_id`); listing resumes strictly after that file.

## Response `200`

The files in the container.

- ContainerFileListResponse
  - `data` ContainerFile[], required
    - `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.
  - `first_id` string, nullable, required
  - `has_more` boolean, required — True when another page can be fetched by passing `after=last_id`.
  - `last_id` string, nullable, required
  - `object` 'list', required

## 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
- `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/c7f48ab0bdf3/schema)
