Models
Theazo's model gateway routes to the best LLM for your agent. Use managed models (Theazo handles the API keys) or bring your own model credentials.
Managed models
By default, Theazo manages model credentials via OpenRouter. You select a model and Theazo handles routing, rate limiting, and billing. No API keys to manage.
managed-model.ts
const agent = await session.agents.create({
compute: class="cb-str">'python',
model: class="cb-str">'anthropic/claude-sonnet', class="cb-cmt">// Theazo handles the API key
})
// Available managed models:
// anthropic/claude-sonnet — Best for complex reasoning + tool use
// anthropic/claude-haiku — Fast + cheap for simple tasks
// openai/gpt-4o — Strong general-purpose model
// openai/gpt-4o-mini — Budget option, good for classification
// google/gemini-2.0-flash — 1M context, fast, very cheapAvailable models
anthropic/claude-sonnet200K contextInput: $3.00/1MOutput: $15.00/1Mtext, vision, tools
anthropic/claude-haiku200K contextInput: $0.25/1MOutput: $1.25/1Mtext, vision, tools
openai/gpt-4o128K contextInput: $2.50/1MOutput: $10.00/1Mtext, vision, tools
openai/gpt-4o-mini128K contextInput: $0.15/1MOutput: $0.60/1Mtext, vision, tools
google/gemini-2.0-flash1M contextInput: $0.10/1MOutput: $0.40/1Mtext, vision, tools
List models programmatically
const models = await theazo.models.list()
models.forEach(m => {
console.log(m.id, m.name, m.capabilities)
})Get model details
const model = await theazo.models.get(class="cb-str">'anthropic/claude-sonnet')
console.log(model.name) class="cb-cmt">// 'Claude Sonnet'
console.log(model.maxTokens) class="cb-cmt">// 200000
console.log(model.capabilities) class="cb-cmt">// ['text', 'vision', 'tool_use']
console.log(model.inputCostPer1M) class="cb-cmt">// 300 (cents)Cost estimation
Estimate the cost of a model call before running it. Useful for setting cost caps and budgeting.
estimate-cost.ts
const estimate = await theazo.models.estimate({
model: class="cb-str">'anthropic/claude-sonnet',
inputTokens: class="cb-num">50000,
outputTokens: class="cb-num">2000,
})
console.log(estimate.estimatedCost.modelCost) class="cb-cmt">// { amount: 45, currency: 'usd' }
console.log(estimate.estimatedCost.theazoMargin) class="cb-cmt">// { amount: 5, currency: 'usd' }
console.log(estimate.estimatedCost.total) class="cb-cmt">// { amount: 50, currency: 'usd' }Theazo applies a 10% margin on managed model usage. This covers routing, rate limit management, and fallback handling. BYOI model usage has no margin.
Bring your own models (BYOI)
If you have your own API keys for model providers, pass them in the Theazo constructor. Theazo will route model calls through your credentials instead of managed ones.
byoi-models.ts
const theazo = new Theazo({
apiKey: class="cb-str">'th_live_...',
models: {
anthropic: { apiKey: process.env.ANTHROPIC_API_KEY },
openai: { apiKey: process.env.OPENAI_API_KEY },
},
})
// Now model calls use YOUR API keys
// Theazo charges only for orchestration, not model usage
const session = await theazo.sessions.forUser(class="cb-str">'user_123')
const result = await session.run(class="cb-str">'analyst', class="cb-str">'summarize Q2 results')With BYOI models, you pay the model provider directly. Theazo still tracks token usage for observability and billing data, but does not charge a model margin.
API reference
theazo.models.list()Promise<Model[]>List all available models with pricing and capabilities.theazo.models.get(id)Promise<Model>Get a specific model by ID (e.g., 'anthropic/claude-sonnet').theazo.models.estimate(opts)Promise<CostEstimate>Estimate cost for a model call given input/output token counts.REST endpoints
GET
/v1/modelsList all available modelsGET
/v1/models/:idGet model details by IDPOST
/v1/models/estimateEstimate cost for token counts