跳转到内容
EN

读取自己上传文件的地址(扩展)

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

POST/agent/v1/uploads/{file_id}/content_url● 支持

请求参数

  • file_idstring必填

    path: File id (file-… ) the File service returned after the bytes were uploaded; only the caller's own upload is readable.

返回

200

仅在 /agent/v1 提供,只给终端用户令牌。file_id 是 File 在字节上传后返回的标识。只有本人名下的上传记录、且文件存在时才返回 { url, expires_at },读取地址有效 900 秒,不要保存或写进日志。别人的文件、不存在的文件、或不是上传产生的文件一律返回 404 FILE_NOT_FOUND,不泄露别人的文件是否存在。请求体为空。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

请求示例

curl
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
curl -X POST https://api.deepraxis.com/agent/v1/uploads/file_123/content_url \
  -H "Authorization: Bearer $CUSTOMER_ACCESS_TOKEN" \
  -H "Origin: https://docs.example.com"
Python
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
    f"{opts['base_url']}/v1/uploads/file_123/content_url",
    headers={"Authorization": f"Bearer {customer_access_token}", "Origin": "https://docs.example.com"},
)
print(resp.status_code, resp.json())
TypeScript
// 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/uploads/file_123/content_url`, {
  method: "POST",
  headers: { Authorization: `Bearer ${customerAccessToken}`, Origin: "https://docs.example.com", "Content-Type": "application/json" },
});
console.log(resp.status, await resp.json());

响应示例 200

{
  "url": "<redacted>",
  "expires_at": "2026-11-18T11:06:51.000Z"
}

响应

HTTP 200

Short-lived read address for the caller’s own uploaded file.

application/json

名称 类型 说明
url string Short-lived GET address for the file's bytes; fetch it within the lifetime and never store or log it.
expires_at string RFC 3339 time the address stops working; at most 900 seconds after it was issued.