file_id, then send natural-language questions referencing that file_id. Nexus AI reads the document, finds the relevant sections, and returns a direct answer along with source excerpts so you can trace where each answer came from.
Working with File Chat is a two-step process: upload the file, then chat with it.
Supported formats: PDF,
.docx, and .csv. Maximum file size: 20 MB.Step 1 — Upload a file
Before you can ask questions, you must upload your document to receive afile_id.
Endpoint
multipart/form-data rather than JSON. Include your file in the file field.
Example upload request
upload-file.sh
Example upload response
upload-response.json
file_id from this response — you will need it for the chat request in Step 2.
Upload response fields
A unique identifier for the uploaded file. Pass this value as
file_id in your chat request to query the document.The original filename of the uploaded document, as provided in the request.
The size of the uploaded file in bytes.
An ISO 8601 timestamp indicating when the file was uploaded and processed.
Step 2 — Chat with the file
Once you have afile_id, send messages to query the document content.
Endpoint
Request parameters
The unique identifier returned when you uploaded the file in Step 1. This tells the API which document to query.
Your natural-language question or instruction about the document content — for example,
"What are the key findings in this report?".Example chat request
chat-with-file.sh
Example response
response.json
Response fields
A unique identifier for this chat interaction.
The AI-generated answer to your question, derived from the content of the uploaded document.
An array of source objects referencing the specific sections of the document the answer was drawn from.
An ISO 8601 timestamp indicating when the chat response was generated.
Error responses
400 Bad Request — Missing parameters
400 Bad Request — Missing parameters
Returned when
file_id or message is absent from the request body.400-response.json
404 Not Found — File not found
404 Not Found — File not found
Returned when the
file_id does not correspond to a file associated with your account.404-response.json
429 Too Many Requests — Rate limited
429 Too Many Requests — Rate limited
Returned when you exceed your plan’s rate limit. Check the
Retry-After response header and wait before retrying.429-response.json