# Files and results ## Upload an input Use the file selected for this task. A local path is usable only when the host can read its bytes. Inspection's `upload` object gives the purpose, maximum size, accepted MIME types and exact sequence: 1. Request upload authorization with the private Gateway key and actual MIME/size. 2. Upload bytes using the returned method, URL and storage headers. Send no Primex key to storage and do not follow redirects. 3. Finalize with the Gateway key. Require a successful response with status READY. 4. Use the returned `file_id` in the inspected operation request. Authorization/finalization do not run inference. Expired URLs or failed finalization must be resolved before submitting an inference request. File references are account-scoped and expire at the returned time; the temporary transport has no manual delete endpoint. The [Files API](docs/endpoints/files.md) covers its full lifecycle. ## Deliver an output Use the inspection's `output` contract: - **Image:** decode the returned base64 bytes, detect the actual format, save and attach the image. Do not print base64 into the conversation. - **Speech:** save the binary response as MP3 and attach/play it. - **Text or structured data:** return the requested text/fields; attach JSON when useful or requested. Keep transcription segments if returned. Use private task-workspace files and the host's delivery mechanism. Save useful remote results before their stated expiry. A returned ID or failed transfer is not a delivered result. Keep a small receipt with operation/model, operation UUID, safe request ID, HTTP status and returned charge. Exclude keys and signed URLs. Preserve a fully received response if decoding or saving fails; it may be recoverable without a new paid request. See [Errors](errors.md) for interrupted work.