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

# Delete file

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

Deletes a file before its automatic expiration. This removes the file from storage immediately.

## Path Parameters

<ParamField path="file_id" type="string" required="true">
  The ID of the file to delete.
</ParamField>

## Response

<ResponseField name="id" type="string">
  The ID of the deleted file.
</ResponseField>

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

<ResponseField name="deleted" type="boolean">
  Confirms whether the file was successfully deleted.
</ResponseField>

<Note>
  Deleting a file removes it from storage before its automatic expiration date. Files are automatically deleted after their retention period expires (7 days by default).
</Note>

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

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

  result = client.files.delete("file_123")

  print(result)
  ```

  ```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 result = await client.files.delete("file_123");

    console.log(result);
  }

  main();
  ```

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

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "file_123",
    "object": "file",
    "deleted": true
  }
  ```
</ResponseExample>
