Docs

Model APIs

Files API and file lifecycle

Upload, list, retrieve, download and delete files; distinguish Files API objects, static assets and model input.

Updated

GET/v1/files
POST/v1/files
GET/v1/files/{file_id}
DELETE/v1/files/{file_id}
GET/v1/files/{file_id}/content

Endpoints and permissions

The Files API provides an OpenAI-compatible file management surface scoped to the current tenant. Uploading does not mean a model has read the file or that it entered a knowledge base. Verify the protocol, model and application workflow accept its reference before using it for generation.

MethodPathPurpose
POST/v1/filesUpload multipart file and purpose
GET/v1/filesList accessible files
GET/v1/files/{file_id}Read file metadata
GET/v1/files/{file_id}/contentDownload original content
DELETE/v1/files/{file_id}Delete the file

Upload example

Save the returned file id and associate it with your application record. Reads require assets.read; uploads and deletions require assets.write. Size and purpose values are subject to endpoint validation and deployment. A purpose label does not prove that batch processing, training or another downstream workflow is enabled.

cURL
curl --fail-with-body https://api.token4ai.cloud/v1/files \
  -H "Authorization: Bearer $TOKEN4AI_API_KEY" \
  -F "purpose=user_data" \
  -F "file=@./notes.txt"

Lifecycle management

Delete files explicitly when they are no longer needed. Check for active task references and retain appropriate audit records before deletion. Vega Static Assets manages files and folders, while support evidence belongs to support conversations and is not public file hosting.

Related guides