TokenLab

檔案與批次

檢索檔案內容

下載檔案內容。

GET
/v1/files/{file_id}/content

下載批次輸入、輸出或錯誤檔案。透過 Anthropic Files 標頭,相同的 API 可下載目前工作區中 Anthropic 格式的檔案。

範例

請求

cURL
curl -X GET "https://api.tokenlab.sh/v1/files/file_abc123/content" \
  -H "Authorization: Bearer sk-your-api-key" \
  --output batch-output.jsonl

內容類型

批次檔案以 JSONL 或純文字格式回傳。影像參考檔案則以二進位內容回傳。

回應範例

回應

200 OK
{"custom_id":"request-1","response":{"status_code":200,"body":{"id":"chatcmpl_abc123"}}}
{"custom_id":"request-2","error":{"code":"invalid_request_error","message":"Invalid model"}}

重要欄位

bodybinary|string
檔案內容。請根據 Content-Type 儲存或解析;若為 JSONL 格式,請逐行解析。
custom_idstring
用於將批次輸入項目與其結果進行配對的 ID。

授權

BearerAuth
AuthorizationBearer <token>

API Key 驗證。請在 Dashboard > API > API Keys 建立或管理 API 金鑰。

位置: header

路徑參數

file_id*string

回應

text/plain

application/json