Upload file
Upload a JSONL file to use as Batch input. The upload is checked right away: the file must be UTF-8 and every line must be a JSON object, and an error names the line. Each request in the file is checked against the endpoint when you create the batch.
ApiKeyAuthAuthorization<token>multipart/form-data- body
expires_after[anchor]?"created_at""created_at"expires_after[seconds]?integerSeconds after upload until the file expires. Without expires_after, the file expires after 30 days.
3600 <= value <= 2592000file*fileThe batch input: JSONL with one request per line, each line a JSON object with custom_id, method, url, and body. At most 128 MB.
binarypurpose*"batch"Only batch is accepted. Files are used as Batch input.
"batch"The uploaded file
application/json- response
bytes*integercreated_at*integerUnix seconds.
expires_at?integerUnix seconds. Absent on batch result files, which the provider keeps for its own retention period.
filename*stringid*stringfile-… for an uploaded file; <batch_id>_output or <batch_id>_error for a batch result file.
object*"file""file"purpose*string"batch""batch_output"status*"processed""processed"curl -X POST 'https://api.ohmygpt.com/v1/files' \ -F 'file=string' \ -F 'purpose=batch'{ "bytes": 0, "created_at": 0, "expires_at": 0, "filename": "string", "id": "string", "object": "file", "purpose": "batch", "status": "processed"}Still stuck? Live chat · [email protected] · Telegram group
Retrieve file GET
An uploaded file, or the output or error file of one of your batches once the batch is settled.
Create image POST
Generate images from a text prompt. Image models are billed per image or per token, as listed in each model's pricing. GPT Image models return images only as base64 in `data[].b64_json`. On these models, `response_format: "b64_json"` isn't sent and the `X-Parameters-Dropped` response header names it. Any other `response_format` returns 400. A model that lists `limits.image.sizes` in `GET /v1/models` takes `size`, not `aspect_ratio`. An `aspect_ratio` that matches exactly one listed size is sent as that size. Any other `aspect_ratio` returns 400.