跳转到内容
EN

查看文件

先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。

GET/file/v1/files/{file_id}● 支持

请求参数

  • file_idstring必填

    path: ID of a tenant-owned live file, as returned by upload or list; starts with file-.

返回

200 file

错误按 OpenAI 格式返回,参见 错误码

请求示例

curl
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
curl https://api.deepraxis.com/file/v1/files/file_123 \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepraxis.com/file/v1",
    api_key="$PRAXIS_API_KEY",
)

file = client.files.retrieve("file_123")
TypeScript
// 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepraxis.com/file/v1",
  apiKey: "$PRAXIS_API_KEY",
});

const file = await client.files.retrieve("file_123");

响应示例 200

{
  "id": "file_dp_01M41EAAJ35TB1BK663PKJQD81",
  "object": "file",
  "bytes": 70,
  "created_at": 1791049935,
  "filename": "pixel.png",
  "purpose": "user_data",
  "status": "processed",
  "status_details": null,
  "mime_type": "image/png",
  "downloadable": true
}

响应

HTTP 200

OK

application/json

名称 类型 说明
id string File identifier: file- followed by 24 base62 characters. Use the ID returned by upload or list.
bytes integer The size of the file, in bytes.
created_at integer The Unix timestamp (in seconds) for when the file was created.
expires_at integer | null The Unix timestamp (in seconds) for when the file will expire.
filename string The name of the file.
object string The object type, which is always file.
purpose string Upload purpose. Image references in conversations require user_data.
status string Deprecated. The current status of the file, which can be either uploaded, processed, or error.
mime_type string Content-detected MIME type.
scope object | null Session scope for session outputs; null for other files.
scope.type string Kind of scope; always session.
scope.id string Id of the session the file belongs to.
relative_path string Path within the session output directory; present for session outputs.
revision integer Session output revision; present for session outputs.
state string processing is not yet usable; active is ready; expired cannot be read.
source string upload is user-provided, generated is platform-produced, session is a session output.
sha256 string Content digest, prefixed sha256:. Available after processing completes.