API reference

Base URL https://tengsuan.cloud/api/v1. Authenticate with Authorization: Bearer <token-id>:<token-secret>. Select an environment with X-Environment: main. Streams are server-sent events.

EndpointPurpose
GET /accountCurrent user, workspace, environments
GET|POST /apps, GET|DELETE /apps/{name}, GET /apps/{name}/runsApps
GET|POST /machines, GET|DELETE /machines/{id}, POST /machines/{id}/terminate, POST /machines/{id}/exec (SSE), WS /machines/{id}/sshSandboxes
GET|POST /jobs, GET|DELETE /jobs/{id}, GET /jobs/{id}/logs (SSE), POST /jobs/{id}/cancelRuns (fields: command, script, script_name, gpu, gpu_count, image, app, secrets[], volumes[], timeout_hours)
GET|POST /volumes, DELETE /volumes/{name}, GET /volumes/{name}/ls?path=, PUT|GET|DELETE /volumes/{name}/files?path=Volumes
GET|POST /secrets, GET|DELETE /secrets/{name}, GET /secrets/templatesSecrets
GET|POST /environments, DELETE /environments/{name}Environments
GET|POST /tokens, DELETE /tokens/{id}API tokens
GET|POST /workspaces, POST /workspaces/{id}/activate, GET /workspace/members, POST /workspace/invitesWorkspaces
GET /usage?days=30, GET /billing, GET /billing/ledger, POST /billing/payments, POST /billing/withdrawalsUsage & billing
GET /catalog, GET /statusPublic
# submit a run and stream its logs curl -s https://tengsuan.cloud/api/v1/jobs -H "Authorization: Bearer $TS_TOKEN" -H "Content-Type: application/json" \ -d '{"command":"nvidia-smi","gpu":"h100","image":"cuda","app":"smoke"}' curl -sN https://tengsuan.cloud/api/v1/jobs/j-xxxx/logs -H "Authorization: Bearer $TS_TOKEN"