pydo.inference.upload_batch_file()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.inference.upload_batch_file(body={...})Serverless inference methods can authenticate with a model access key instead of a DigitalOcean API token:
client = Client(token=os.environ.get("MODEL_ACCESS_KEY"))Description
Uploads the raw JSONL bytes to the presigned upload_url returned by POST /v1/batches/files.
The URL is dynamic — do not construct it. Use the upload_url value from the previous step verbatim. Its host, path, and query parameters are part of the short-lived (~15 minute) signature and change per request; the server and path shown here are illustrative. If the URL expires before the upload completes, create a new file intent and retry.
POST /v1/batches performs a HEAD check on the uploaded object and will reject the batch if this upload has not completed.
Send the raw JSONL bytes verbatim. Presigned PUT URLs are signature-sensitive to request headers — prefer application/octet-stream or omit Content-Type entirely. A custom value (for example application/jsonl) can cause signature mismatches unless the URL was signed for that exact header.
Parameters
bodyJSON or IO[bytes] requiredRaw JSONL bytes — one request per line.
Request Sample
More Information
See /<upload_url> in the API reference for additional detail on responses, headers, parameters, and more.