Install
fetch required). Works in Node.js, Deno, Bun, and edge runtimes.
Initialize
Configuration
What’s Included
The SDK exports:What’s new in 0.3.x – 0.4.0
@hitheo/sdk@0.4.0 adds programmatic per-key orchestration and account management — all additive, no breaking changes to existing completion/stream code:
theo.keys— create keys and configure their model plan, orchestrator graph, and skill allowlist from code.theo.routingPreferences/theo.routingRules— author and bind keyword/regex routing.theo.guardrails— manage Gateway Guardrails policies, presets, and per-key bindings.theo.billingCheckout/theo.billingPortal— top up credits and open the billing portal.- The
/v1/completionsrequest gained amemory: falseflag (skip long-term memory injection) and richer per-request fields — see Create Completion.
Upgrading to 0.2.0
If you’re upgrading from0.1.x:
- No code changes required for typical
theo.complete()/theo.stream()usage. - If you pinned
baseUrl: "https://hitheo.ai"explicitly, drop it (or switch to"https://www.hitheo.ai") to pick up the new default and avoid header-stripping redirects. theo.stream()now returns aTheoStream.for awaitstill works; you additionally gain.cancel()and post-completion metadata (conversationId,usage,requestId).CompletionResponse.usagenow includesprompt_tokens,completion_tokens,total_tokens, and an optionalcachedboolean. Existingres.usage.cost_centsusage keeps working.- List methods that used to return
Promise<unknown[]>(conversations,skills,tools,workflows,submissions, etc.) now return typed records — remove anyas anycasts. Full release notes: Changelog.
