Docs
Get an API key

Upload File

POST /v1/files View .md

Uploads a document once, to use in any number of requests by its id. The file is converted to text ahead of time: its status is processing until then, processed when it can be used, or error with the reason in status_details. Poll GET /files/{id} for the status. Reference a processed file as {"type": "file", "file": {"file_id": "file-..."}} in chat, {"type": "input_file", "file_id": "file-..."} in Responses, or a document block with {"type": "file", "file_id": "file-..."} as its source in Messages: the stored text is used, with no conversion in the request. Documents only (the types listed under chat-content-part), up to 100 MB; at most 1,000 files per account; a file expires 30 days after upload. The file's text counts as prompt tokens in the requests that use it.

  • file string (binary) required

    The document. Its type is read from its name, then its content.

  • purpose string

    Stored and reported as given (OpenAI's user_data, assistants and so on).

    default user_dataat most 32 characters

OK

application/json · file-object

9 fields
  • id string
  • object string
    file
  • bytes integer
  • created_at integer

    Unix seconds.

  • expires_at integer

    Unix seconds; 30 days after upload. The file and its text are gone after.

  • filename string
  • purpose string

    As uploaded; user_data when none was given. Any purpose can be referenced.

  • status string

    processed once the file can be referenced by file_id.

    processingprocessederror
  • status_details string or null

    Why the file is in error, for example The PDF has 301 pages; the limit is 300.

curl https://api.vultrinference.com/v1/files \
  -H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
  -F "file=@file.pdf"
Response · 200
{
    "id": "file-6f1d2c9a4b7e8f0a1c2d3e4f",
    "object": "file",
    "bytes": 0,
    "created_at": 1790000000,
    "expires_at": 1790000000,
    "filename": "string",
    "purpose": "string",
    "status": "processing",
    "status_details": "string"
}