Skip to content

REST API

If you’re not on JavaScript/TypeScript, drive Tanzanite over plain HTTP. The SDK is a thin wrapper over this surface.

https://api.tanzanite.dev

The public /v1 surface is authenticated with your Tanzanite API key, sent as either header:

Authorization: Bearer tanzanite_your_key_here
X-Tanzanite-Key: tanzanite_your_key_here

/api/auth/signup is the one unauthenticated endpoint.

The full contract is published as OpenAPI at /openapi.json. Point your codegen, client, or agent at it rather than hand-copying endpoints — it is the source of truth.

MethodPathPurpose
POST/api/auth/signupCreate an account (no API key needed)
POST/v1/sessionsCreate a session — body { goal, context?, guardrails? }
GET/v1/sessions/{id}Get session status, cost, and rounds
POST/v1/sessions/{id}/signalControl a session — { type: pause | resume | cancel | redirect, ... }
POST/v1/sessions/{id}/human-input/{inputId}Respond to a human-input request
GET/v1/sessions/{id}/messagesList messages (limit, after cursor)

There is one control endpoint, POST /v1/sessions/{id}/signal, with a type:

  • pause — optional reason.
  • resume — optional newBudget; resuming a cost-limited session requires a newBudget greater than the current spend.
  • redirectrequires message (the new direction).
  • cancel — optional reason; also cancels active rounds and subagents.

Real-time WebSocket streaming on the public /v1 surface is planned but not yet available. Today, follow a running session by polling:

  • GET /v1/sessions/{id} — status, cost, and completion report.
  • GET /v1/sessions/{id}/messages?after={lastRoundId}&limit=50 — new messages; advance the after cursor (the last roundId you saw) on each poll.

A status of complete, failed, or cancelled is terminal. waiting_human means the agent is blocked on a human-input request — respond via POST /v1/sessions/{id}/human-input/{inputId}, then keep polling.

If you use the SDK but want raw requests, the RestClient is exported:

import { RestClient } from "@tanzanite/sdk";
const client = new RestClient({
baseUrl: "https://api.tanzanite.dev",
apiKey: "tanzanite_your_key_here",
});
const data = await client.get("/v1/sessions/sess_123");