Skip to Content
Keko
API reference

Keko Cloud

Your machines

GET
/v1/machines

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

OK

application/json
  1. response
machines*array<>
Example Request
curl -X GET 'https://engine.keko.run/v1/machines'
Example Response
{  "machines": [    {      "id": "string",      "provider": "string",      "providerId": "string",      "key": "string",      "purpose": "thread",      "projectId": "string",      "userId": "string",      "snapshot": "string",      "image": "string",      "deviceId": "string",      "state": "creating",      "size": "small",      "region": "string",      "threadIds": [        "string"      ],      "leaseUntil": 0,      "lastAgentActivityAt": 0,      "lastHumanActivityAt": 0,      "createdAt": 0,      "updatedAt": 0,      "stoppedAt": 0,      "clearedAt": 0,      "prewarmedUntil": 0,      "automatic": true,      "error": "string",      "status": {        "phase": "starting",        "label": "string",        "percent": 0,        "reason": "string",        "at": 0,        "source": "engine"      },      "previews": [        {          "port": 0,          "name": "",          "url": "string",          "access": "private",          "state": "live",          "firstSeenAt": 0,          "lastSeenAt": 0        }      ],      "tunnels": [        {          "id": "string",          "threadId": "string",          "fromDeviceId": "string",          "localPort": 0,          "remotePort": 0,          "state": "requested",          "requestedAt": 0,          "approvedAt": 0,          "error": "string"        }      ],      "mirror": {        "at": 0,        "terminals": [          {            "title": "string",            "status": "string",            "tail": "string"          }        ]      },      "forkedFrom": {        "threadId": "string",        "machineId": "string",        "turn": 0,        "entryId": 0      }    }  ]}
GET
/v1/machines/settings

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

OK

application/json
  1. response
settings*
Example Request
curl -X GET 'https://engine.keko.run/v1/machines/settings'
Example Response
{  "settings": {    "agentIdleMs": 0,    "humanIdleMs": 0,    "leaseSeconds": 0,    "renewBelowMs": 0,    "tickMs": 0,    "size": "small",    "region": "string",    "prewarmTtlMs": 0,    "maxPrewarmed": 0,    "bootTimeoutMs": 0,    "autoSnapshot": true,    "clearAfterDays": 0,    "stopGraceMs": 0  }}
PATCH
/v1/machines/settings

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
agentIdleMs?number
Range0 < value
humanIdleMs?number
Range0 < value
leaseSeconds?number
Range0 < value
renewBelowMs?number
Range0 < value
tickMs?number
Range0 < value
size?string
Value in"small""default""large""xlarge"
prewarmTtlMs?number
Range0 < value
maxPrewarmed?number
Range0 <= value
bootTimeoutMs?number
Range0 < value
autoSnapshot?boolean
clearAfterDays?number
Range0 <= value
stopGraceMs?number
Range0 <= value

Response Body

OK

application/json
  1. response
settings*
Example Request
curl -X PATCH 'https://engine.keko.run/v1/machines/settings' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "settings": {    "agentIdleMs": 0,    "humanIdleMs": 0,    "leaseSeconds": 0,    "renewBelowMs": 0,    "tickMs": 0,    "size": "small",    "region": "string",    "prewarmTtlMs": 0,    "maxPrewarmed": 0,    "bootTimeoutMs": 0,    "autoSnapshot": true,    "clearAfterDays": 0,    "stopGraceMs": 0  }}
POST
/v1/machines/prewarm

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
projectId*string
Default""
repoUrl?string
branch?string
testBranch?string
Length1 <= length <= 255

Response Body

OK

application/json
  1. response
machine*|null
Example Request
curl -X POST 'https://engine.keko.run/v1/machines/prewarm' \  -H 'Content-Type: application/json' \  -d '{  "projectId": ""}'
Example Response
{  "machine": {    "id": "string",    "provider": "string",    "providerId": "string",    "key": "string",    "purpose": "thread",    "projectId": "string",    "userId": "string",    "snapshot": "string",    "image": "string",    "deviceId": "string",    "state": "creating",    "size": "small",    "region": "string",    "threadIds": [      "string"    ],    "leaseUntil": 0,    "lastAgentActivityAt": 0,    "lastHumanActivityAt": 0,    "createdAt": 0,    "updatedAt": 0,    "stoppedAt": 0,    "clearedAt": 0,    "prewarmedUntil": 0,    "automatic": true,    "error": "string",    "status": {      "phase": "starting",      "label": "string",      "percent": 0,      "reason": "string",      "at": 0,      "source": "engine"    },    "previews": [      {        "port": 0,        "name": "",        "url": "string",        "access": "private",        "state": "live",        "firstSeenAt": 0,        "lastSeenAt": 0      }    ],    "tunnels": [      {        "id": "string",        "threadId": "string",        "fromDeviceId": "string",        "localPort": 0,        "remotePort": 0,        "state": "requested",        "requestedAt": 0,        "approvedAt": 0,        "error": "string"      }    ],    "mirror": {      "at": 0,      "terminals": [        {          "title": "string",          "status": "string",          "tail": "string"        }      ]    },    "forkedFrom": {      "threadId": "string",      "machineId": "string",      "turn": 0,      "entryId": 0    }  }}
POST
/v1/machines/{machineId}/stop

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

machineId*string

Response Body

OK

application/json
  1. response
machine*
Example Request
curl -X POST 'https://engine.keko.run/v1/machines/string/stop'
Example Response
{  "machine": {    "id": "string",    "provider": "string",    "providerId": "string",    "key": "string",    "purpose": "thread",    "projectId": "string",    "userId": "string",    "snapshot": "string",    "image": "string",    "deviceId": "string",    "state": "creating",    "size": "small",    "region": "string",    "threadIds": [      "string"    ],    "leaseUntil": 0,    "lastAgentActivityAt": 0,    "lastHumanActivityAt": 0,    "createdAt": 0,    "updatedAt": 0,    "stoppedAt": 0,    "clearedAt": 0,    "prewarmedUntil": 0,    "automatic": true,    "error": "string",    "status": {      "phase": "starting",      "label": "string",      "percent": 0,      "reason": "string",      "at": 0,      "source": "engine"    },    "previews": [      {        "port": 0,        "name": "",        "url": "string",        "access": "private",        "state": "live",        "firstSeenAt": 0,        "lastSeenAt": 0      }    ],    "tunnels": [      {        "id": "string",        "threadId": "string",        "fromDeviceId": "string",        "localPort": 0,        "remotePort": 0,        "state": "requested",        "requestedAt": 0,        "approvedAt": 0,        "error": "string"      }    ],    "mirror": {      "at": 0,      "terminals": [        {          "title": "string",          "status": "string",          "tail": "string"        }      ]    },    "forkedFrom": {      "threadId": "string",      "machineId": "string",      "turn": 0,      "entryId": 0    }  }}

Your project snapshots

GET
/v1/snapshots

Authorization

bearer
headerAuthorizationBearer <token>

Query Parameters

projectId?string

Response Body

OK

application/json
  1. response
snapshots*array<>
Example Request
curl -X GET 'https://engine.keko.run/v1/snapshots'
Example Response
{  "snapshots": [    {      "userId": "string",      "projectId": "string",      "name": "string",      "state": "building",      "fingerprint": {        "lockfiles": "string",        "setup": "string",        "image": "string"      },      "createdAt": 0,      "readyAt": 0,      "error": "string",      "machineId": "string",      "test": true,      "branch": "string",      "source": "file",      "setupCommit": "string",      "setupError": "string",      "logs": [        {          "phase": "initialize",          "command": "string",          "status": "done",          "code": 0,          "ms": 0,          "output": "string",          "failingLine": "string"        }      ]    }  ]}
POST
/v1/snapshots

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
projectId*string
Default""
repoUrl?string
branch?string
testBranch?string
Length1 <= length <= 255

Response Body

OK

application/json
  1. response
snapshot*|null
Example Request
curl -X POST 'https://engine.keko.run/v1/snapshots' \  -H 'Content-Type: application/json' \  -d '{  "projectId": ""}'
Example Response
{  "snapshot": {    "userId": "string",    "projectId": "string",    "name": "string",    "state": "building",    "fingerprint": {      "lockfiles": "string",      "setup": "string",      "image": "string"    },    "createdAt": 0,    "readyAt": 0,    "error": "string",    "machineId": "string",    "test": true,    "branch": "string",    "source": "file",    "setupCommit": "string",    "setupError": "string",    "logs": [      {        "phase": "initialize",        "command": "string",        "status": "done",        "code": 0,        "ms": 0,        "output": "string",        "failingLine": "string"      }    ]  }}