Skip to main content
POST
/
v3
/
files
Upload a file
curl --request POST \
  --url https://api.opper.ai/v3/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "bytes": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "filename": "<string>",
  "id": "<string>",
  "mime_type": "<string>",
  "object": "file",
  "purpose": "<string>",
  "status": "<string>"
}
Returns a file_<id> you can pass as a media source on later calls. See the Files guide.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

multipart/form-data
file
file
required

The file bytes.

filename
string

Optional advisory filename (defaults to the upload's filename).

purpose
string
default:reference_media

Intended use; gates the accepted MIME types.

ttl_seconds
integer

Optional lifetime in seconds; may only shorten the default/retention-capped TTL.

Response

Successful response

bytes
integer
created_at
string<date-time>
expires_at
string<date-time>
filename
string
id
string

file_… id

mime_type
string
object
string
Example:

"file"

purpose
string
status
string