cURL
curl --request POST \ --url https://api.qclawrouter.com/v1/files
上传图片文件用于图生图、图生视频等任务
Documentation IndexFetch the complete documentation index at: https://docs.qclawrouter.com/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://docs.qclawrouter.com/llms.txt
Use this file to discover all available pages before exploring further.
curl https://api.qclawrouter.com/v1/files \ -H "Authorization: Bearer sk-your-api-key" \ -F "file=@/path/to/image.jpg" \ -F "purpose=image"
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 }