Endpoint reference
A reference of every Codexis AI agent API call. Paths are relative to the address of your instance and every call carries the X-Api-Key header. Creating a key, the error codes and the security practice are covered by API integration.
- GET
/api/v1/vmreturns the state of the virtual machine. - POST
/api/v1/vm/startstarts the virtual machine. - POST
/api/v1/vm/stopshuts the virtual machine down. - POST
/api/v1/filesuploads a file into the agent's workspace. - POST
/api/v1/chatssends a question to the agent. - GET
/api/v1/chats/{chatId}/messages/{messageId}collects the answer to a question. - GET
/api/v1/chats/{chatId}/messages/{messageId}/eventsstreams one answer as it is written. - GET
/api/v1/chats/{chatId}/eventsstreams everything happening in a conversation.
Virtual machine
The agent runs on a virtual machine that is yours alone. It processes a question while the machine is in the RUNNING state.
GET /api/v1/vm
Returns the state of the virtual machine your agent runs on.
Parameters
None.
Returns
{ "status": "RUNNING" }The state is one of RUNNING, STOPPED, STARTING, STOPPING.
Example request
curl -H "X-Api-Key: api-…" https://<your-instance>/api/v1/vmPOST /api/v1/vm/start
Starts the virtual machine.
Parameters
None.
Returns
{ "status": "STARTING" }The response is a 202. Reaching RUNNING takes tens of seconds, confirm it with GET /api/v1/vm.
Example request
curl -X POST -H "X-Api-Key: api-…" https://<your-instance>/api/v1/vm/startPOST /api/v1/vm/stop
Shuts the virtual machine down.
Parameters
None.
Returns
{ "status": "STOPPING" }The response is a 202. The shutdown itself takes a while.
Example request
curl -X POST -H "X-Api-Key: api-…" https://<your-instance>/api/v1/vm/stopFiles
POST /api/v1/files
Uploads a file into the agent's workspace so that a question can refer to it.
Parameters
The request body is multipart/form-data.
filefile, required. The contents of the uploaded file. The file needs a name and some content.destinationstring, optional. Target folder in the workspace. Defaults to the upload folder.
Returns
{
"name": "contract.pdf",
"path": "/uploads/contract.pdf",
"size": 284913
}The response is a 201. You pass the path value in filePaths when sending a question, and size is the size in bytes.
Example request
curl -X POST -H "X-Api-Key: api-…" \
-F "file=@contract.pdf" \
https://<your-instance>/api/v1/filesConversations
POST /api/v1/chats
Sends a question to the agent, either into a new conversation or into an existing one.
Parameters
The request body is JSON.
inputstring, required. The text of the question. The only field you have to send.chatIdstring, optional. UUID of the conversation the question is appended to. Defaults to a new conversation. On a continuation,model,fields,jurisdictionsandwebSearchEnabledare taken over from the conversation.agentIdstring, optional. The agent that should answer, given by its ID, name or full name. Defaults to your default agent.skillIdsarray of strings, optional. The skills the agent should have available for this question, given by their IDs, names or full names.filePathsarray of strings, optional. Workspace paths of the files to attach to the question. Take the values from thepathfield of the upload response.modelstring, optional. The language model. One ofGPT_5_6_SOL(GPT-5.6 Sol),GPT_5_6_TERRA(GPT-5.6 Terra),GPT_5_6_LUNA(GPT-5.6 Luna),GPT_5_5(GPT-5.5),GPT_5_4(GPT-5.4),GPT_5_4_MINI(GPT-5.4 mini),GPT_5_4_NANO(GPT-5.4 nano). Defaults to your instance's model.jurisdictionsarray of strings, optional. The jurisdictions the agent should search. ValuesCZ,SK,EU,AT,NL,FR.webSearchEnabledboolean, optional. Lets the agent search the web as well. Default:false.fieldsarray of objects, optional. Model fine-tuning, the same options as in the application.keystring. Name of the option.valuestring. Value of the option.
Returns
{
"id": "9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33",
"chatId": "3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85",
"status": "in_progress",
"createdAt": "2026-07-30T09:14:22Z",
"model": "GPT_5_6_SOL",
"text": ""
}A 202 arrives at once, before the agent has finished thinking. If the agent manages to answer straight away, a 201 arrives with the status completed.
idstring. UUID of the agent's answer. Together withchatIdyou collect the answer by it.chatIdstring. UUID of the conversation. Send it in your next question and the conversation continues.statusstring. One ofin_progressandcompleted. With the statuscompletedthe answer text is whole.textstring. The text of the answer written so far.modelstring. The language model the conversation answers with.createdAtstring. When the answer was created, in ISO 8601 format.
Example request
curl -X POST -H "X-Api-Key: api-…" \
-H "Content-Type: application/json" \
-d '{"input": "Check the notice periods in the attached contract.", "filePaths": ["/uploads/contract.pdf"]}' \
https://<your-instance>/api/v1/chatsContinuing a conversation
To follow up, send another question with the same chatId. The agent knows the whole exchange so far.
curl -X POST -H "X-Api-Key: api-…" \
-H "Content-Type: application/json" \
-d '{"chatId": "3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85", "input": "And what about the warranties?"}' \
https://<your-instance>/api/v1/chatsGET /api/v1/chats/{chatId}/messages/{messageId}
Collects the answer to a question.
Parameters
chatIdstring, required, in the path. UUID of the conversation the answer belongs to. Take it from thechatIdfield of the send response.messageIdstring, required, in the path. UUID of the agent's answer. Take it from theidfield of the send response.
Returns
{
"id": "9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33",
"chatId": "3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85",
"status": "completed",
"createdAt": "2026-07-30T09:14:22Z",
"model": "GPT_5_6_SOL",
"text": "The notice periods in the contract are set out as follows…"
}The same object as POST /api/v1/chats, with the text filled in according to the status. The answer is written gradually, so you come back for it repeatedly, a sensible interval being five to ten seconds. It stays available for as long as the conversation exists.
Example request
curl -H "X-Api-Key: api-…" \
https://<your-instance>/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/messages/9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33GET /api/v1/chats/{chatId}/messages/{messageId}/events
Streams one answer as it is written, over Server-Sent Events, instead of collecting it repeatedly.
Parameters
chatIdstring, required, in the path. UUID of the conversation.messageIdstring, required, in the path. UUID of the agent's answer.
Returns
A text/event-stream. Every message event carries the current shape of the answer in the same form as POST /api/v1/chats; the last event is named completed and ends the stream.
event: message
data: {"id":"9c2e5b71-…","chatId":"3f8b1a20-…","status":"in_progress","text":"The notice periods"}
event: completed
data: {"id":"9c2e5b71-…","chatId":"3f8b1a20-…","status":"completed","text":"The notice periods in the contract are set out as follows…"}Example request
curl -N -H "X-Api-Key: api-…" \
https://<your-instance>/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/messages/9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33/eventsGET /api/v1/chats/{chatId}/events
Streams everything happening in a conversation, over Server-Sent Events. It stays open between questions, which suits an integration that watches a conversation over a long period.
Parameters
chatIdstring, required, in the path. UUID of the conversation.
Returns
A text/event-stream in the same form as the single-answer stream: a message event for every change of the latest answer in the conversation, and completed once it's done.
Example request
curl -N -H "X-Api-Key: api-…" \
https://<your-instance>/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/eventsOpenAPI specification
The machine-readable schema of the whole API is in openapi.yaml. Load it into Postman, Insomnia or a client generator.
For how to handle the key and what the error codes mean, see API integration.