Skip to main content
POST
/
v1
/
files
上传图片
curl --request POST \
  --url https://api.qclawrouter.com/v1/files

Documentation Index

Fetch the complete documentation index at: https://docs.qclawrouter.com/llms.txt

Use this file to discover all available pages before exploring further.

说明

上传本地图片文件,获取可在 API 中使用的 URL。

请求示例

cURL
curl https://api.qclawrouter.com/v1/files \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "file=@/path/to/image.jpg" \
  -F "purpose=image"
Python
import requests

with open("image.jpg", "rb") as f:
    response = requests.post(
        "https://api.qclawrouter.com/v1/files",
        headers={"Authorization": "Bearer sk-your-api-key"},
        files={"file": f},
        data={"purpose": "image"}
    )

url = response.json()["url"]
print(url)  # 使用此 URL 传入其他 API

返回示例

{
  "id": "file_xxx",
  "url": "https://cdn.qclawrouter.com/uploads/xxx.jpg",
  "size": 102400,
  "created_at": 1677652288
}