Files
A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.
10000Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
descPossible values: The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.
Successful response with list of files
A list of uploaded files.
The object type, which is always list.
Indicates if there are more items to be fetched.
The ID of the first item in the list.
The ID of the last item in the list.
Server error.
Client error.
GET /v1/files HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"bytes": 1,
"created_at": 1,
"expires_at": 1,
"filename": "text",
"id": "text",
"object": "file",
"purpose": "batch"
}
],
"object": "list",
"hasMore": true,
"firstId": "text",
"lastId": "text"
}The File object (not file name) to be uploaded.
The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.
Successful response with file upload details
A document that has been uploaded and can be referenced by other endpoints.
The size of the file, in bytes.
The Unix timestamp (in seconds) for when the file was created.
The Unix timestamp (in seconds) for when the file will expire.
The name of the file.
The file identifier, which can be referenced in the API endpoints.
The object type, which is always "file".
The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.
Deprecated. The current status of the file.
Invalid request data.
Server error.
POST /v1/files HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 35
{
"file": "binary",
"purpose": "batch"
}{
"bytes": 1,
"created_at": 1,
"expires_at": 1,
"filename": "text",
"id": "text",
"object": "file",
"purpose": "batch"
}The ID of the file to use for this request.
Successful response with file details
A document that has been uploaded and can be referenced by other endpoints.
The size of the file, in bytes.
The Unix timestamp (in seconds) for when the file was created.
The Unix timestamp (in seconds) for when the file will expire.
The name of the file.
The file identifier, which can be referenced in the API endpoints.
The object type, which is always "file".
The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.
Deprecated. The current status of the file.
File not found.
Server error.
GET /v1/files/{file_id} HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"bytes": 1,
"created_at": 1,
"expires_at": 1,
"filename": "text",
"id": "text",
"object": "file",
"purpose": "batch"
}Successful response with deletion status.
The status of a file deletion.
The file identifier.
The object type, which is always file.
Indicates whether the file has been deleted.
File not found.
Server error.
DELETE /v1/files/{file_id} HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "text",
"object": "file",
"deleted": true
}Successful response with file contents
File not found.
Server error.
GET /v1/files/{file_id}/content HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
binaryLast updated

