Skip to main content
Upload a JSONL batch file from Java.
The Java SDK’s JSON helpers do not encode multipart uploads. Use Java’s standard HTTP client to send the file bytes as shown below.
Save your batch requests as requests.jsonl in the working directory.

Retrieve a file with the SDK

Replace file_123 with the ID returned by the upload.
File endpoints are in preview and require an enabled provider. File listing is unavailable with shared gateway keys; keep the returned file IDs and retrieve them directly.
Last modified on October 18, 2026