API v1 endpoints
Codexis AI agent API reference: calls, parameters, responses and example requests authenticated with an API key.
For the extended interface, see REST API v2.
Base URL: https://vm.codexis.ai. All requests require the X-Api-Key header. Examples use the CODEXIS_API_KEY environment variable.
Authentication and HTTP errors.
Virtual machine
- GET
/api/v1/vm - POST
/api/v1/vm/start - POST
/api/v1/vm/stop
Chat
- POST
/api/v1/chats - GET
/api/v1/chats - GET
/api/v1/chats/{chatId} - DELETE
/api/v1/chats/{chatId} - POST
/api/v1/chats/{chatId}/stop - GET
/api/v1/chats/{chatId}/messages/{messageId} - GET
/api/v1/chats/{chatId}/messages/{messageId}/events - GET
/api/v1/chats/{chatId}/events - GET
/api/v1/models - GET
/api/v1/jurisdictions - GET
/api/v1/skills - GET
/api/v1/agents
Attachments
- POST
/api/v1/attachments
Files
- POST
/api/v1/files - GET
/api/v1/files/{path} - DELETE
/api/v1/files/{path} - GET
/api/v1/directories - GET
/api/v1/directories/{path} - POST
/api/v1/directories/{path}
Virtual machine
The virtual machine must be RUNNING to process a request.
GET /api/v1/vm
Returns virtual machine status.
Returns
{ "status": "RUNNING" }200. status: RUNNING, STOPPED, STARTING, STOPPING.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/vmPOST /api/v1/vm/start
Starts the virtual machine.
Returns
{ "status": "STARTING" }202. Poll GET /api/v1/vm for RUNNING.
Example request
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/vm/startPOST /api/v1/vm/stop
Stops the virtual machine.
Returns
{ "status": "STOPPING" }202. Poll GET /api/v1/vm for STOPPED.
Example request
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/vm/stopCatalogs
Accept-Language: cs, en, sk. Default label language: cs.
GET /api/v1/models
Lists models and their settings.
Returns
[
{
"id": "GPT_5_6_TERRA",
"label": "GPT-5.6 Terra",
"description": "Balanced GPT-5.6 configuration for intelligence and cost.",
"provider": "OPENAI",
"status": "UP",
"default": true,
"disabled": false,
"supportsWebSearch": true,
"settings": [
{
"key": "reasoningEffort",
"label": "Reasoning effort",
"options": [
{ "value": "LOW", "label": "Low" },
{ "value": "MEDIUM", "label": "Medium" },
{ "value": "HIGH", "label": "High" }
],
"defaultValue": "MEDIUM"
}
]
}
]id: value formodel.provider:OPENAI,ANTHROPIC,GOOGLE,TENSOR_X,OPENROUTER,CODEXIS.status: provider health,UP,DEGRADED,DOWN,UNKNOWN.default: default model.disabled: model disabled for new questions.supportsWebSearch: supportswebSearchEnabled.settings: acceptedkeyandoptions[].valuepairs. Empty fordisabledmodels.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/modelsGET /api/v1/jurisdictions
Lists available jurisdictions.
Returns
[
{ "id": "CZ", "label": "Czech Republic" },
{ "id": "SK", "label": "Slovakia" }
]200. Pass the id values in jurisdictions.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/jurisdictionsGET /api/v1/skills
Lists skills, most used first.
Returns
[
{
"id": "8f2c9d41-5b7e-4a03-9c66-1d4e8b2a7f50",
"name": "planner",
"fullName": "demo-plugin:planner",
"description": "Plans case-law research"
}
]200. skillIds accepts id, name or fullName.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/skillsGET /api/v1/agents
Lists agents.
Returns
200. Same structure as skills. agentId accepts id, name or fullName.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/agentsAttachments
POST /api/v1/attachments
Uploads message attachments.
Parameters
multipart/form-data
filesfile[], required, multipart. Repeat the field for each file. Files require a filename and non-empty content.
Returns
[
{
"id": "62c96c7a-92f7-4b36-b1b8-6e124bc85502",
"name": "contract.pdf",
"size": 284913,
"createdAt": "2026-09-09T09:12:41Z"
}
]201. An attachment array, including for a single file. size is in bytes, createdAt in ISO 8601. Pass the IDs as attachmentIds to POST /api/v1/chats.
Sending a message moves the attachment into the conversation and consumes its ID. Upload the file again to attach it to another message.
Example request
curl -X POST -F "files=@contract.pdf" -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/attachments"Files
All file endpoints require chatId in the query. Paths belong to that conversation workspace.
POST /api/v1/files
Uploads a file into a conversation.
Parameters
multipart/form-data
chatIdstring (UUID), required, query. Conversation identifier.filefile, required, multipart. Non-empty file with a filename.destinationstring, optional, multipart. Existing target directory. Default:/home/codexis.
Returns
{
"name": "contract.pdf",
"path": "/home/codexis/contract.pdf",
"size": 284913
}201. Use path for downloads, deletes or in the question text with the same chatId. size is in bytes.
Example request
curl -X POST -F "file=@contract.pdf" -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/files?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"GET /api/v1/files/{path}
Downloads a file.
Parameters
chatIdstring (UUID), required, query. Conversation identifier.pathstring, required, path. Path from an upload or directory listing. Preserve slashes; URL-encode other special characters.
Returns
200. Binary stream with Content-Type, Content-Length and Content-Disposition headers.
Example request
curl -o contract.pdf -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/files/home/codexis/contract.pdf?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"GET /api/v1/directories
Lists /home/codexis for the conversation.
Parameters
chatIdstring (UUID), required, query. Conversation identifier.
Returns
200. Same format as a directory listing.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/directories?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"GET /api/v1/directories/{path}
Lists one directory level, excluding hidden entries.
Parameters
chatIdstring (UUID), required, query. Conversation identifier.pathstring, required, path. Directory path in the conversation workspace.
Returns
{
"path": "/home/codexis",
"entries": [
{
"name": "contract.pdf",
"path": "/home/codexis/contract.pdf",
"type": "FILE",
"size": 284913,
"modifiedTime": "2026-09-09T09:12:41Z",
"mimeType": "application/pdf"
}
],
"totalEntries": 1
}200. Use entries[].path with the same chatId. entries[].type: FILE, DIRECTORY, SYMLINK, OTHER.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/directories/home/codexis?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"DELETE /api/v1/files/{path}
Deletes a file or directory.
Parameters
chatIdstring (UUID), required, query. Conversation identifier.pathstring, required, path. Path from an upload or directory listing. Preserve slashes; URL-encode other special characters.recursiveboolean, optional, query. Delete a directory with its contents. Default:false.
Returns
204, empty body. Non-empty directories require recursive=true.
Example request
curl -X DELETE -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/files/home/codexis/contract.pdf?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"POST /api/v1/directories/{path}
Creates a directory. The parent directory must exist.
Parameters
chatIdstring (UUID), required, query. Conversation identifier.pathstring, required, path. Directory path in the conversation workspace.
Returns
{
"name": "documents",
"path": "/home/codexis/documents"
}201. Use path as an upload destination.
Example request
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" \
"https://vm.codexis.ai/api/v1/directories/home/codexis/documents?chatId=3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85"Conversations
POST /api/v1/chats
Sends a question.
Parameters
application/json
inputstring, required. Non-empty question text.chatIdstring (UUID), optional. Existing conversation; omit to create one. Existing conversations retainmodel,settings,jurisdictionsandwebSearchEnabled.agentIdstring, optional.id,nameorfullNamefromGET /api/v1/agents. Default: the account’s default agent.skillIdsstring[], optional.id,nameorfullNamefromGET /api/v1/skills.attachmentIdsstring[] (UUID), optional. Single-use IDs fromPOST /api/v1/attachments.modelstring, optional.idfromGET /api/v1/models. Default: model withdefault: true. Unknown ID returns400.jurisdictionsstring[], optional.idvalues fromGET /api/v1/jurisdictions.webSearchEnabledboolean, optional. RequiressupportsWebSearch: trueon the model. Default:false.settingsobject[], optional.keyandvaluepairs fromsettingsinGET /api/v1/models.
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": ""
}202 with status in_progress, or 201 with status completed.
id: agent message UUID.chatId: conversation UUID for follow-up requests.text: current answer in Markdown. Citations are inparts.parts: structured answer parts.createdAt: ISO 8601.
Example request
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "Check the notice periods in the attached contract.", "attachmentIds": ["62c96c7a-92f7-4b36-b1b8-6e124bc85502"]}' \
https://vm.codexis.ai/api/v1/chatsContinue a conversation
Send the same chatId to continue.
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chatId": "3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85", "input": "And what about the warranties?"}' \
https://vm.codexis.ai/api/v1/chatsGET /api/v1/chats
Lists conversations by most recent activity.
Parameters
offsetinteger, optional, query. Conversations to skip, minimum0. Default:0.limitinteger, optional, query. Result count,1to200. Default:50.
Returns
{
"chats": [
{
"chatId": "3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85",
"title": "Notice periods in the contract",
"status": "completed",
"createdAt": "2026-07-30T09:14:22Z",
"modifiedAt": "2026-07-30T09:16:03Z",
"model": "GPT_5_6_TERRA",
"pinned": false,
"webSearchEnabled": false,
"jurisdictions": ["CZ"]
}
],
"offset": 0,
"limit": 50,
"totalCount": 1
}200. status: in_progress while generating, otherwise completed.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" "https://vm.codexis.ai/api/v1/chats?offset=0&limit=50"GET /api/v1/chats/{chatId}
Returns a conversation and its messages in chronological order.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.
Returns
{
"chat": { "chatId": "3f8b1a20-…", "title": "Notice periods in the contract", "status": "completed" },
"messages": [
{ "id": "71d3…", "role": "USER", "status": "completed", "text": "Check the notice periods…" },
{ "id": "9c2e…", "role": "ASSISTANT", "status": "completed", "text": "The notice periods…", "parts": [] }
]
}200. chat matches a conversation list item. messages[].role: USER or ASSISTANT; answers include parts.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85DELETE /api/v1/chats/{chatId}
Stops the active response and deletes the conversation and its messages.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.
Returns
204, empty body. Missing conversation: 404.
Example request
curl -X DELETE -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85POST /api/v1/chats/{chatId}/stop
Stops response generation. Completed conversations are unchanged.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.
Returns
202. Conversation summary; status may remain in_progress while stopping.
Example request
curl -X POST -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/stopGET /api/v1/chats/{chatId}/messages/{messageId}
Returns the current answer state.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.messageIdstring (UUID), required, path. Theidreturned byPOST /api/v1/chats.
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…"
}200. Same object as POST /api/v1/chats, available while the conversation exists. Use SSE for updates.
Example request
curl -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/messages/9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33GET /api/v1/chats/{chatId}/messages/{messageId}/events
SSE stream for one answer.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.messageIdstring (UUID), required, path. Theidreturned byPOST /api/v1/chats.
Returns
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…"}200, text/event-stream. Each message event contains the current answer. The completed event closes the stream.
Example request
curl -N -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/messages/9c2e5b71-0f4d-4c8a-9a11-6b7e2f0d5c33/eventsGET /api/v1/chats/{chatId}/events
Conversation SSE stream. Stays open between requests.
Parameters
chatIdstring (UUID), required, path. Conversation identifier.
Returns
200, text/event-stream. Events message and completed use the answer stream format for the latest answer in the conversation.
Example request
curl -N -H "X-Api-Key: $CODEXIS_API_KEY" \
https://vm.codexis.ai/api/v1/chats/3f8b1a20-77c4-4c19-8d2e-1b9a4e6f0c85/events