For the complete documentation index, see llms.txt. This page is also available as Markdown.

Files

Upload and manage files used by other endpoints.

List files

get

Return the list of files that have been uploaded.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
afterstringOptional

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.

limitinteger · uint32 · min: 1Optional

A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.

Default: 10000
orderstring · enumOptional

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

Default: descPossible values:
purposestring · enumOptional

The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.

Possible values:
Responses
200

Successful response with list of files

application/json

A list of uploaded files.

objectstring · enumRequired

The object type, which is always list.

Possible values:
hasMorebooleanOptional

Indicates if there are more items to be fetched.

firstIdstringOptional

The ID of the first item in the list.

lastIdstringOptional

The ID of the last item in the list.

get/v1/files
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"
}

Upload file

post

Upload a file that other endpoints can reference, such as the request file consumed by the Batch API.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
filestring · binaryRequired

The File object (not file name) to be uploaded.

purposestring · enumRequired

The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.

Possible values:
Responses
200

Successful response with file upload details

application/json

A document that has been uploaded and can be referenced by other endpoints.

bytesintegerOptional

The size of the file, in bytes.

created_atintegerOptional

The Unix timestamp (in seconds) for when the file was created.

expires_atintegerOptional

The Unix timestamp (in seconds) for when the file will expire.

filenamestringOptional

The name of the file.

idstringOptional

The file identifier, which can be referenced in the API endpoints.

objectstring · enumOptional

The object type, which is always "file".

Possible values:
purposestring · enumOptional

The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.

Possible values:
statusstring · enumOptionalDeprecated

Deprecated. The current status of the file.

Possible values:
post/v1/files
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"
}

Get file

get

Return the metadata for a single file by its ID.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
file_idstringRequired

The ID of the file to use for this request.

Responses
200

Successful response with file details

application/json

A document that has been uploaded and can be referenced by other endpoints.

bytesintegerOptional

The size of the file, in bytes.

created_atintegerOptional

The Unix timestamp (in seconds) for when the file was created.

expires_atintegerOptional

The Unix timestamp (in seconds) for when the file will expire.

filenamestringOptional

The name of the file.

idstringOptional

The file identifier, which can be referenced in the API endpoints.

objectstring · enumOptional

The object type, which is always "file".

Possible values:
purposestring · enumOptional

The intended purpose of the file. Only "batch" is supported — uploaded files may only be used as input for the Batch API.

Possible values:
statusstring · enumOptionalDeprecated

Deprecated. The current status of the file.

Possible values:
get/v1/files/{file_id}
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"
}

Delete file

delete

Permanently delete a single file by its ID.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
file_idstringRequired
Responses
200

Successful response with deletion status.

application/json

The status of a file deletion.

idstringRequired

The file identifier.

objectstring · enumRequired

The object type, which is always file.

Possible values:
deletedbooleanRequired

Indicates whether the file has been deleted.

delete/v1/files/{file_id}
DELETE /v1/files/{file_id} HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "object": "file",
  "deleted": true
}

Get file contents

get

Download the raw contents of a single file by its ID.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
file_idstringRequired
Responses
200

Successful response with file contents

application/octet-stream
string · binaryOptional
get/v1/files/{file_id}/content
GET /v1/files/{file_id}/content HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
binary

Last updated