CODEXIS AI

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

Chat

Attachments

Files

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/vm

POST /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/start

POST /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/stop

Catalogs

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 for model.
  • 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: supports webSearchEnabled.
  • settings: accepted key and options[].value pairs. Empty for disabled models.

Example request

curl -H "X-Api-Key: $CODEXIS_API_KEY" https://vm.codexis.ai/api/v1/models

GET /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/jurisdictions

GET /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/skills

GET /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/agents

Attachments

POST /api/v1/attachments

Uploads message attachments.

Parameters

multipart/form-data

  • files file[], 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

  • chatId string (UUID), required, query. Conversation identifier.
  • file file, required, multipart. Non-empty file with a filename.
  • destination string, 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

  • chatId string (UUID), required, query. Conversation identifier.
  • path string, 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

  • chatId string (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

  • chatId string (UUID), required, query. Conversation identifier.
  • path string, 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

  • chatId string (UUID), required, query. Conversation identifier.
  • path string, required, path. Path from an upload or directory listing. Preserve slashes; URL-encode other special characters.
  • recursive boolean, 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

  • chatId string (UUID), required, query. Conversation identifier.
  • path string, 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

  • input string, required. Non-empty question text.
  • chatId string (UUID), optional. Existing conversation; omit to create one. Existing conversations retain model, settings, jurisdictions and webSearchEnabled.
  • agentId string, optional. id, name or fullName from GET /api/v1/agents. Default: the account’s default agent.
  • skillIds string[], optional. id, name or fullName from GET /api/v1/skills.
  • attachmentIds string[] (UUID), optional. Single-use IDs from POST /api/v1/attachments.
  • model string, optional. id from GET /api/v1/models. Default: model with default: true. Unknown ID returns 400.
  • jurisdictions string[], optional. id values from GET /api/v1/jurisdictions.
  • webSearchEnabled boolean, optional. Requires supportsWebSearch: true on the model. Default: false.
  • settings object[], optional. key and value pairs from settings in GET /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 in parts.
  • 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/chats

Continue 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/chats

GET /api/v1/chats

Lists conversations by most recent activity.

Parameters

  • offset integer, optional, query. Conversations to skip, minimum 0. Default: 0.
  • limit integer, optional, query. Result count, 1 to 200. 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

  • chatId string (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-1b9a4e6f0c85

DELETE /api/v1/chats/{chatId}

Stops the active response and deletes the conversation and its messages.

Parameters

  • chatId string (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-1b9a4e6f0c85

POST /api/v1/chats/{chatId}/stop

Stops response generation. Completed conversations are unchanged.

Parameters

  • chatId string (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/stop

GET /api/v1/chats/{chatId}/messages/{messageId}

Returns the current answer state.

Parameters

  • chatId string (UUID), required, path. Conversation identifier.
  • messageId string (UUID), required, path. The id returned by POST /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-6b7e2f0d5c33

GET /api/v1/chats/{chatId}/messages/{messageId}/events

SSE stream for one answer.

Parameters

  • chatId string (UUID), required, path. Conversation identifier.
  • messageId string (UUID), required, path. The id returned by POST /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/events

GET /api/v1/chats/{chatId}/events

Conversation SSE stream. Stays open between requests.

Parameters

  • chatId string (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

OpenAPI specification

openapi.yaml