Model APIs
Files API and file lifecycle
Upload, list, retrieve, download and delete files; distinguish Files API objects, static assets and model input.
Updated
/v1/files/v1/files/v1/files/{file_id}/v1/files/{file_id}/v1/files/{file_id}/contentEndpoints 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.
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/files | Upload multipart file and purpose |
| GET | /v1/files | List accessible files |
| GET | /v1/files/{file_id} | Read file metadata |
| GET | /v1/files/{file_id}/content | Download 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 --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.