跳轉到

取得單一檔案資料

此 API 用於查詢單一檔案的詳細資訊。

你可以透過檔案的 file_id 取得該檔案的原始檔名、格式、上傳時間、檔案大小等資訊。

此功能常用於查詢單一檔案的基本資訊,以及確認該檔案在不同解析模式下的文件解析結果與處理狀態。在建立 Fileset 前,也可先透過此 API 檢查檔案是否已完成所需的解析流程。

curl -X 'GET' \
  'http://127.0.0.1:8000/v1/files/{file_id}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your-api-key>'

Request Headers

Key Value
Request Method GET
accept application/json
Authorization Bearer

Query Parameters

Field Type Note Required
file_id string uuid true

Response Body

{
  "object": "file",
  "id": "b0d1bdbc-4f94-40b0-9358-68c579c99e8c",
  "filename": "Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones.pdf",
  "filetype": "application/pdf",
  "bytes": 1463728,
  "metadata": {
    "parsed_results": {
      "HQ": {
        "parsing_state": "draft",
        "character_count": null,
        "page_count": null,
        "failed_page_numbers": null
      },
      "LQ": {
        "parsing_state": "draft",
        "character_count": null,
        "page_count": null,
        "failed_page_numbers": null
      }
    },
    "fail_detail": []
  },
  "purpose": "user_data",
  "created_at": "2025-01-01T00:00:14.173Z",
  "expires_at": null
}

Field Explanation

回傳「檔案物件」章節列表內容。

備註:此 API 回傳的是 File 物件本身的資訊,不包含 fileset file state 與 used_quality。若需查詢檔案在特定 Fileset 中的 commit 狀態,請改用取得單一知識版本檔案列表的 API。