Tanvrit Compute
API reference

REST API · v0

Stable bearer-auth REST surface. The shapes below are illustrative — full OpenAPI lands at public alpha. Until then, expect minor breaking changes; the version header lets you pin to v0.

API surface evolves until public alpha — expect minor breaking changes. Versioning header X-Compute-API-Version supports v0 today.

Authentication

Send the bearer token in the Authorization header. Use either a short-lived OAuth token (tanvrit-compute auth print-token) or an admin-issued PAT for headless workloads.

curl https://api.compute.tanvrit.com/v0/jobs \
  -H "Authorization: Bearer $(tanvrit-compute auth print-token)" \
  -H "X-Compute-API-Version: v0"

Rate limits

PlanLimitBurst
Hobby (local only)n/a (local control plane)n/a
PAYG100 req/sec200 over 10s
Team1000 req/sec2000 over 10s
EnterpriseCustomCustom

Jobs

POST/v0/jobs

Submit a job. Body matches the Job manifest used by `jobs run`.

request
{
  "type": "COMMAND",
  "command": "echo hello",
  "timeoutSeconds": 30,
  "labels": { "arch": "arm64" }
}
response
{
  "id": "job_01jt9hello",
  "state": "QUEUED",
  "createdAt": "2026-04-26T09:13:21Z"
}
GET/v0/jobs/{id}

Get a job's current state.

response
{
  "id": "job_01jt9hello",
  "state": "SUCCEEDED",
  "exitCode": 0,
  "runtimeMs": 420,
  "agentId": "local-01"
}
GET/v0/jobs

List jobs in the active workspace; filter by state, label, time.

POST/v0/jobs/{id}:cancel

Cancel a running or queued job. Idempotent.

GET/v0/jobs/{id}/logs

Tail the job log buffer; supports `?follow=true` (SSE).

Agents

GET/v0/agents

List agents registered to the active workspace.

GET/v0/agents/{id}

Get an agent's labels, last heartbeat, current job.

POST/v0/agents/{id}:drain

Drain an agent — finish current jobs, refuse new ones.

DELETE/v0/agents/{id}

Deregister an agent (requires admin).

Workspaces

POST/v0/workspaces

Create a workspace. Caller becomes owner.

GET/v0/workspaces

List workspaces the caller has access to.

PATCH/v0/workspaces/{id}

Update workspace metadata (name, default region).

POST/v0/workspaces/{id}/members

Invite a member with role owner / admin / member.

GET/v0/workspaces/{id}/audit

Query the audit log; JSON-Lines export with `?format=jsonl`.

Billing

GET/v0/billing/usage

Per-workspace usage in CPU-seconds, GPU-seconds, GB-seconds.

response
{
  "windowStart": "2026-04-01T00:00:00Z",
  "windowEnd":   "2026-04-26T00:00:00Z",
  "cpuSeconds":  18432,
  "gpuSeconds":  0,
  "estimateUsd": 0.26
}
GET/v0/billing/invoices

Past invoices (Team / PAYG only).

GET/v0/billing/limits

Read soft / hard caps configured for the workspace.

PATCH/v0/billing/limits

Update caps; takes effect at the next meter tick.

Webhooks

POST/v0/webhooks

Register a webhook; events: job.created, job.transitioned, job.terminal.

GET/v0/webhooks

List configured webhooks for the workspace.

DELETE/v0/webhooks/{id}

Disable + remove a webhook.

POST/v0/webhooks/{id}:rotate-secret

Rotate the HMAC signing secret used by outbound webhook requests.

Stability promise

Once we ship public alpha, v0 freezes for additive changes only. Breaking changes go into v1 with a 90-day deprecation window. See changelog.