Core Concepts
Key concepts to understand before using the Zihin API.
Tenants
A tenant is an isolated workspace. Each tenant has its own:
- Users and roles
- API keys
- Agents and configurations
- Usage quotas and billing
- Telemetry data
All API calls are scoped to a tenant via the API key or JWT x-tenant-id header.
Providers and Models
Zihin connects to multiple LLM providers (OpenAI, Anthropic, Google, Grok, OpenRouter) through a unified API. You can:
- Specify a model — call a specific model by name (e.g.,
gpt-4.1,claude-sonnet-4-5) - Use auto-routing — set
model: "auto"and let Zihin pick the best model for your task
See Models and Auto-Routing for details.
Agents
An agent is a configured AI assistant with:
- A system prompt defining its behavior
- An LLM model (or auto-routing)
- Optional tools (database queries, HTTP calls, MCP servers)
- Optional triggers (webhooks that start conversations)
Agents are created via the console or MCP Server.
API Keys
API keys follow the format zhn_live_xxxxx (production) or zhn_test_xxxxx (sandbox). Each key is tied to a tenant.
Generate keys at console.zihin.ai > Settings > API Keys.
Tokens and Costs
LLM usage is measured in tokens. Each model has different pricing per million input/output tokens. Auto-routing optimizes cost by selecting the most efficient model for each task.
Track usage and costs in the console dashboard or via the telemetry API.