> ## 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 get /paas/v4/files
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:
    get:
      tags:
        - 文件 API
      summary: 文件列表
      description: 获取已上传文件的分页列表，支持按用途和排序过滤。点击 **Try it** 按钮可快速试用。
      parameters:
        - name: after
          in: query
          description: 分页游标
          schema:
            type: string
        - name: purpose
          in: query
          description: 按用途过滤文件
          schema:
            type: string
            enum:
              - batch
              - code-interpreter
              - agent
          required: true
        - name: order
          in: query
          description: 排序方式
          schema:
            type: string
            enum:
              - created_at
        - name: limit
          in: query
          description: 每页返回的文件数量
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: 业务处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FileListResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileObject'
        has_more:
          type: boolean
          description: 是否有更多数据
    Error:
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    FileObject:
      type: object
      properties:
        id:
          type: string
          description: 文件标识符
        object:
          type: string
          enum:
            - file
        bytes:
          type: integer
          description: 文件大小（字节）
        created_at:
          type: integer
          description: 文件创建的`Unix`时间戳
        filename:
          type: string
          description: 文件名
        purpose:
          type: string
          description: 文件的预期用途
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````