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

# List files

<Callout icon="lock" color="#b2b1b1ff" iconType="regular">
  This feature is in [Private Preview](/support/preview-releases). For access or more information, [contact us](https://www.cerebras.ai/contact) or reach out to your account representative.
</Callout>

Lists all files that have been uploaded. Returns metadata for each file including size, status, and expiration.

## Query Parameters

<ParamField path="limit" type="integer">
  The maximum number of files to return.

  Default: `20`\
  Maximum: `100`
</ParamField>

<ParamField path="after" type="string">
  A cursor for pagination. Pass a file ID to retrieve all files created after that file. For example, if you have files `[file-abc123, file-def456, file-jkl789, file-mno123]` and pass `after=file-def456`, the response will return `[file-jkl789, file-mno123]`.
</ParamField>

## Response

<ResponseField name="object" type="string">
  The object type, which is always `list`.
</ResponseField>

<ResponseField name="data" type="array">
  An array of file objects.

  <Expandable title="file properties">
    <ResponseField name="id" type="string">
      A unique identifier for the file.
    </ResponseField>

    <ResponseField name="object" type="string">
      The object type, which is always `file`.
    </ResponseField>

    <ResponseField name="bytes" type="integer">
      The size of the file in bytes.
    </ResponseField>

    <ResponseField name="filename" type="string">
      The name of the uploaded file.
    </ResponseField>

    <ResponseField name="created_at" type="integer">
      The Unix timestamp (in seconds) of when the file was created.
    </ResponseField>

    <ResponseField name="expires_at" type="integer">
      The Unix timestamp (in seconds) of when the file will be automatically deleted.
    </ResponseField>

    <ResponseField name="purpose" type="string">
      The intended purpose of the file (e.g., `batch`).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="has_more" type="boolean">
  Whether there are more files available beyond this page.
</ResponseField>

<RequestExample>
  ```python Python theme={null}
  from cerebras.cloud.sdk import Cerebras
  import os

  client = Cerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  files = client.files.list(limit=20)

  print(files)
  ```

  ```javascript Node.js theme={null}
  import Cerebras from '@cerebras/cerebras_cloud_sdk';

  const client = new Cerebras({
    apiKey: process.env['CEREBRAS_API_KEY'],
  });

  async function main() {
    const files = await client.files.list({
      limit: 20
    });

    console.log(files);
  }

  main();
  ```

  ```bash cURL theme={null}
  curl --location 'https://api.cerebras.ai/v1/files?limit=20/' \
  --header "Authorization: Bearer ${CEREBRAS_API_KEY}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "object": "list",
    "data": [
      {
        "id": "file_123",
        "object": "file",
        "bytes": 1048576,
        "filename": "batch-requests.jsonl",
        "created_at": 1726315200,
        "expires_at": 1726920000,
        "purpose": "batch"
      },
      {
        "id": "file_124",
        "object": "file",
        "bytes": 2097152,
        "created_at": 1726315200,
        "expires_at": 1726920000,
        "filename": "batch-results.jsonl",
        "purpose": "batch"
      }
    ],
    "has_more": false
  }
  ```
</ResponseExample>
