跳转到主要内容
GET
/
openai
/
v1
/
files
/
{file_id}
/
content
查询文件内容
curl --request GET \
  --url https://api.ppio.com/openai/v1/files/{file_id}/content \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'
import requests

url = "https://api.ppio.com/openai/v1/files/{file_id}/content"

headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};

fetch('https://api.ppio.com/openai/v1/files/{file_id}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/openai/v1/files/{file_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.ppio.com/openai/v1/files/{file_id}/content"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.ppio.com/openai/v1/files/{file_id}/content")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ppio.com/openai/v1/files/{file_id}/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
根据文件 ID 获取指定文件的内容。通常用于下载批处理的输出文件或错误文件。

请求头

Content-Type
string
必填
枚举值: application/json
Authorization
string
必填
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。

路径参数

file_id
string
必填
要获取内容的文件唯一标识符。

响应

响应返回原始文件内容。对于批处理输出文件,内容为 JSONL 格式,其中每一行包含一个批处理请求的结果。 示例响应 对于批处理输出文件,每一行的内容类似如下:
{
  "custom_id": "request-2589",
  "error": null,
  "id": "batch_req_task_d2c",
  "response": {
    "body": {
      "id": "29e1432c-edfb-44a4-b531-c23c600abfae",
      "object": "chat.completion",
      "created": 1754902266,
      "model": "deepseek-test",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "你好!👋 今天我能为你做些什么?😊"
          },
          "finish_reason": "stop"
        }
      ],
      "usage": {
        "prompt_tokens": 5,
        "completion_tokens": 13,
        "total_tokens": 18
      }
    },
    "request_id": "request-2589",
    "status_code": 200
  }
}
最后修改于 2026年1月12日