Skip to main content

Installation

npm install @hitheo/sdk
Requirements: Node.js 18+ with native fetch support.

Initialize the Client

import { Theo } from "@hitheo/sdk";

const theo = new Theo({
  apiKey: process.env.THEO_API_KEY!,
  // Optional:
  // baseUrl: "https://hitheo.ai",   // default
  // timeoutMs: 30_000,              // default
  // maxRetries: 2,                  // default — retries on 429/5xx
});

Configuration Options

OptionTypeDefaultDescription
apiKeystringrequiredYour theo_sk_... API key
baseUrlstringhttps://hitheo.aiAPI base URL
timeoutMsnumber30000Request timeout in milliseconds
maxRetriesnumber2Max retry attempts on 429/5xx errors

Retry Behavior

The SDK automatically retries on:
  • 429 Too Many Requests — respects the Retry-After header
  • 5xx Server Errors — exponential backoff (1s, 2s, 4s, max 8s)
Client errors (400, 401, 403, 404) are not retried.

Also Available

CLI

The SDK includes a CLI for terminal usage:
npm install -g @hitheo/sdk
theo init        # Set up Theo in a project
theo status      # Check connection health
theo complete "What is quantum computing?"
See the CLI Reference for all commands.

MCP Server — IDE Integration

Use Theo inside Cursor, Claude Code, Warp, Windsurf, and VS Code via MCP: