Image Host API
Image / video APIs often require a **publicly reachable image URL**. The console (and some samples) upload a local file to a separate image-host service, then pass the returned URL into business APIs.
Image / video APIs often require a publicly reachable image URL. The console (and some samples) upload a local file to a separate image-host service, then pass the returned URL into business APIs.
Relationship to the business gateway
| Item | Note |
|---|---|
| Business calls | Chat / image / video use the site Base URL + sk- API key |
| Image upload | Not a route inside new--api; defaults to an external imageproxy |
| Docs page | See System → Account & Tokens → “Upload image” (POST /api/upload) |
Default console upload URL:
https://imageproxy.zhongzhuan.chat/api/uploadjson(Source constant: IMAGEPROXY_UPLOAD_URL.)
Example request
curl -X POST 'https://imageproxy.zhongzhuan.chat/api/upload' \ -H "Authorization: Bearer sk-YOUR_KEY" \ -F 'file=@./demo.png'json- Content-Type:
multipart/form-data - Form field:
file - Auth: Bearer (follow the image-host service; the console usually sends the business key)
On success, use the returned public URL (field names depend on the service) in parameters such as image-to-video or reference images.
Notes
- Do not mix with token CRUD:
/api/token*uses the business gateway with session /access_token; the image host is a different service. - URL lifetime: some hosts return temporary URLs; expired links cause upstream fetch failures — store important assets yourself.
- Size / format: oversized or non-image MIME types may fail; compress to the limits of the target API.
- Privacy: uploads may be fetched publicly — do not upload sensitive originals.
Related
- API docs: Account & Tokens · Upload image (slug:
system) - Token management: same page (“List tokens”, “Create token”, …)
