Skip to main content
POST
/
openai
/
v1
/
files
Upload file (OpenAI format)
curl --request POST \
  --url http://localhost:8080/openai/v1/files \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form purpose=assistants \
  --form 'provider=<string>' \
  --form 'storage_config={
  "s3": {
    "bucket": "<string>",
    "region": "<string>",
    "prefix": "<string>"
  },
  "gcs": {
    "bucket": "<string>",
    "project": "<string>",
    "prefix": "<string>"
  }
}'
{
  "id": "<string>",
  "object": "<string>",
  "bytes": 123,
  "created_at": 123,
  "filename": "<string>",
  "purpose": "batch",
  "status": "uploaded",
  "status_details": "<string>",
  "expires_at": 123,
  "storage_backend": "<string>",
  "storage_uri": "<string>",
  "extra_fields": {
    "request_type": "<string>",
    "provider": "openai",
    "model_requested": "<string>",
    "model_deployment": "<string>",
    "latency": 123,
    "chunk_index": 123,
    "raw_request": {},
    "raw_response": {},
    "cache_debug": {
      "cache_hit": true,
      "cache_id": "<string>",
      "hit_type": "<string>",
      "provider_used": "<string>",
      "model_used": "<string>",
      "input_tokens": 123,
      "threshold": 123,
      "similarity": 123
    }
  }
}

Body

multipart/form-data
file
file
required

File to upload

purpose
enum<string>
required

Purpose of the file

Available options:
assistants,
assistants_output,
batch,
batch_output,
fine-tune,
fine-tune-results,
vision,
user_data,
evals
provider
string

Provider for file storage

storage_config
object

Storage configuration for cloud storage backends

Response

Successful response

id
string
object
string
bytes
integer<int64>
created_at
integer<int64>
filename
string
purpose
enum<string>
Available options:
batch,
assistants,
fine-tune,
vision,
batch_output,
user_data,
responses,
evals
status
enum<string>
Available options:
uploaded,
processed,
processing,
error,
deleted
status_details
string
expires_at
integer<int64>
storage_backend
string
storage_uri
string
extra_fields
object

Additional fields included in responses