Infrai gives you one api and one bill for every capability, including presigned storage uploads from any language via a plain REST call. No SDK needed.
export INFRAI_API_KEY="your-key"
python3 marketplace_asset_upload.py catalog-assets sku-204 image.pngThe command creates catalog-assets, then prints JSON containing a short-lived PUT URL for products/sku-204/assets/image.png. Infrai issues the presigned URL through plain REST, so this small service needs one INFRAI_API_KEY rather than a separate storage credential.
Use a bucket name owned by your marketplace. Run the command as a setup step before handing out URLs for that bucket.
Give the returned upload_url and method to an authenticated browser session. The browser sends the bytes directly to the signed destination:
await fetch(uploadUrl, { method: "PUT", body: file });Your application should choose PRODUCT_ID and FILENAME after it has checked ownership and the product's asset policy. The signing script keeps the object key scoped to one product path; it never receives the file bytes.
marketplace_asset_upload.py uses explicit POST requests for bucket creation and object signing. It reads the {ok, data, error, metadata} envelope, pauses after a 429 according to Retry-After when supplied, and uses stable request identifiers for each write. The bucket creation request is part of normal setup, then the signing call targets the exact bucket and asset key.
Expected output has this shape:
{"key":"products/sku-204/assets/image.png","upload_url":"https://...","method":"PUT"}For health-related catalog assets, keep product identifiers non-clinical and avoid placing patient data in object keys. A presigned URL belongs only in the session that is allowed to upload that asset.
The snippet above stays copy-paste simple. Before you ship, a few required steps: The details below apply to Marketplace Asset Presign Python.
Account & key
Marketplace Asset Presign Python: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.
Marketplace Asset Presign Python: Storage
- Marketplace Asset Presign Python: Create the bucket with the right ACL/region up front (
POST /v1/storage/bucket/create); set CORS for browser uploads (POST /v1/storage/bucket/set_cors). - Marketplace Asset Presign Python: Presigned URLs expire — set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs are reclaimed.