pydo.files.create()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.files.create(
file="batch_requests.jsonl",
purpose="batch",
)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
Creates a file record and returns a file_id plus a short-lived presigned PUT URL (typically valid for ~15 minutes). Upload the raw JSONL bytes to upload_url (see PUT /{upload_path}) before calling POST /v1/batches.
Parameters
filestring or bytes requiredFile content. Accepts a filesystem path, raw bytes, a readable stream, or a
(name, data)tuple.purposestring optionalFree-form label retained on the returned object. Default:
"batch".
Request Sample
Response Example
More Information
See /v1/batches/files in the API reference for additional detail on responses, headers, parameters, and more.