Get Started

Configuration

Initialize the Theazo client with your API key and optional provider overrides. Compute and model credentials can be supplied at construction time or per-session.

Basic initialization

The simplest configuration only requires your API key. Theazo manages compute routing and model credentials automatically.

theazo.ts
import { Theazo } from class="cb-str">'theazo'

const theazo = new Theazo({ apiKey: class="cb-str">'th_live_...' })

Full configuration

Supply BYOI compute credentials to route agents to your own provider account, and BYOI model credentials to use your own model API keys.

theazo.ts
import { Theazo } from class="cb-str">'theazo'

const theazo = new Theazo({
  class="cb-cmt">// Required
  apiKey: class="cb-str">'th_live_...',

  class="cb-cmt">// Optional: BYOI compute — use your own E2B / Fly.io account
  compute: {
    provider: class="cb-str">'e2b',          class="cb-cmt">// 'e2b' | 'fly' | 'docker'
    credentials: {
      apiKey: process.env.E2B_API_KEY!,
    },
  },

  class="cb-cmt">// Optional: BYOI models — use your own Anthropic / OpenAI key
  models: {
    provider: class="cb-str">'anthropic',    class="cb-cmt">// 'anthropic' | 'openai' | 'openrouter'
    credentials: {
      apiKey: process.env.ANTHROPIC_API_KEY!,
    },
  },

  class="cb-cmt">// Optional: base URL override (enterprise dedicated deployment)
  baseUrl: class="cb-str">'https://api.yourcompany.com'/api.yourcompany.com',
})
Never hardcode API keys. Use environment variables and ensure they are only loaded server-side. See the Authentication page for guidance on keeping keys out of client bundles.

Options reference

apiKey

Required. Your platform API key. Live keys begin with th_live_; test keys with th_test_. Test keys never provision real compute and cost nothing.

compute

Optional. Bring your own compute provider. When omitted, Theazo routes agents to managed infrastructure and bills compute to your platform account.

compute.providerstringProvider name: 'e2b', 'fly', or 'docker'.
compute.credentialsobjectProvider-specific auth. For E2B: { apiKey }. For Fly: { apiKey, org }. For Docker: { host, tlsCert }.

models

Optional. Bring your own model API key. When omitted, Theazo uses its managed OpenRouter account and bills model tokens to your platform.

models.providerstringModel provider: 'anthropic', 'openai', or 'openrouter'.
models.credentialsobjectProvider-specific auth. Always { apiKey } for cloud providers.

baseUrl

Optional. Override the default API base URL. Use this for enterprise dedicated deployments. Defaults to https://api.theazo.com.

BYOI compute modes

BYOI (Bring Your Own Infrastructure) lets you pay your compute provider directly. Theazo charges only for orchestration — typically 90% margin improvement over fully managed.

byoi.ts
// E2B: isolated microVMs, best for browser + code tasks
const theazo = new Theazo({
  apiKey: class="cb-str">'th_live_...',
  compute: {
    provider: class="cb-str">'e2b',
    credentials: { apiKey: process.env.E2B_API_KEY! },
  },
})

// Fly.io: Firecracker VMs, best for long-running stateful agents
const theazo = new Theazo({
  apiKey: class="cb-str">'th_live_...',
  compute: {
    provider: class="cb-str">'fly',
    credentials: {
      apiKey: process.env.FLY_API_KEY!,
      org: class="cb-str">'my-org',
    },
  },
})

Test vs live environments

Use test keys during development and CI. Test keys return mocked responses, never provision compute, and do not appear in billing.

theazo.ts
// Development / CI
const theazo = new Theazo({
  apiKey: process.env.NODE_ENV === class="cb-str">'production'
    ? process.env.THEAZO_LIVE_KEY!
    : process.env.THEAZO_TEST_KEY!,
})
Was this page helpful?
Ask anything...⌘I