oxDocs
Browse documentation
Introduction
Vision API
Inference API
Realtime
Integrations
LiveKit & SIP
Administration
Reference

API reference

Reusable media API

Upload private image or video bytes once and reuse content-addressed media IDs.

Upload image or video bytes

Send raw bytes to POST /v1/media with an image or video Content-Type. The maximum object size is 256 MiB. The response returns a content-addressed ID; uploading identical content may return the same ID with created: false.

bash

curl --fail-with-body "$OX_API_BASE_URL/v1/media" \
  --request POST \
  --header "Authorization: Bearer $OX_API_KEY" \
  --header "Content-Type: video/mp4" \
  --data-binary @inspection.mp4
json

{
  "id": "media_EXAMPLE",
  "object": "media",
  "content_type": "video/mp4",
  "bytes": 1048576,
  "created": true
}

Reuse a media ID

Pass one or more IDs at the top level of a chat-completion request. This avoids uploading the same private object before each question.

json

{
  "model": "MODEL_ID",
  "media_ids": ["media_EXAMPLE"],
  "messages": [{ "role": "user", "content": "Identify the first safety issue." }],
  "temperature": 0
}

Check availability without downloading content by sending HEAD /v1/media/{media_id}. A 2xx response means the object exists; 404 means it is unavailable to the current API path.

bash

curl --fail-with-body --head "$OX_API_BASE_URL/v1/media/media_EXAMPLE" \
  --header "Authorization: Bearer $OX_API_KEY"
Help improve this guideFound something unclear or incomplete?
Report an issue ↗View source ↗