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

# 删除文件

> 永久删除指定文件及其所有关联数据。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi.json delete /paas/v4/files/{file_id}
openapi: 3.0.1
info:
  title: ZHIPU AI API
  description: ZHIPU AI 接口提供强大的 AI 能力，包括聊天对话、工具调用和视频生成。
  license:
    name: ZHIPU AI 开发者协议和政策
    url: https://chat.z.ai/legal-agreement/terms-of-service
  version: 1.0.0
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: 模型 API
    description: Chat API
  - name: 工具 API
    description: Web Search API
  - name: Agent API
    description: Agent API
  - name: 文件 API
    description: File API
  - name: 知识库 API
    description: Knowledge API
  - name: 实时 API
    description: Realtime API
  - name: 批处理 API
    description: Batch API
  - name: 助理 API
    description: Assistant API
  - name: 智能体 API（旧）
    description: QingLiu Agent API
paths:
  /paas/v4/files/{file_id}:
    delete:
      tags:
        - 文件 API
      summary: 删除文件
      description: 永久删除指定文件及其所有关联数据。点击 **Try it** 按钮可快速试用。
      parameters:
        - name: file_id
          in: path
          required: true
          description: 文件唯一标识符
          schema:
            type: string
      responses:
        '200':
          description: 业务处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileDeletedResponse'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FileDeletedResponse:
      allOf:
        - $ref: '#/components/schemas/BaseDeletedResponse'
        - type: object
          properties:
            object:
              type: string
              enum:
                - file
    Error:
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    BaseDeletedResponse:
      type: object
      properties:
        id:
          type: string
          description: 删除的资源`ID`
        object:
          type: string
          description: 资源类型
        deleted:
          type: boolean
          description: 是否成功删除
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````