TypeScript SDK
The kirha package is a fully typed TypeScript client for Kirha's real-time data layer. It handles authentication, tool planning, provider orchestration, and response parsing so you can focus on building your agent logic.
With the SDK you can:
- Search across premium data providers with a single natural language query
- Plan and execute workflows where you review providers and costs before running the query
- Execute tools directly give your agent direct access to the data providers without kirha orchestration
- Run the planner locally orchestrate queries on your own machine for privacy
kirha-ai/kirha-sdk-typescript
2
Installation
npm install kirhapnpm add kirhayarn add kirhabun add kirhaSetup
Initialize the client with your API key and a vertical:
import { Kirha } from "kirha";
const kirha = new Kirha({
apiKey: process.env.KIRHA_API_KEY,
vertical: "crypto",
});Verticals
The vertical parameter sets the data domain for your queries. Each vertical has its own domain-specific set of providers and tools. Omitting it searches across all verticals, but this is in beta and results are less accurate than targeting a specific vertical. See the Verticals page for the full list.
Run your first query
import { Kirha } from "kirha";
const kirha = new Kirha({
apiKey: process.env.KIRHA_API_KEY,
vertical: "crypto",
});
const result = await kirha.search("What is the current price of Bitcoin?");
console.log(result.data); Error handling
All errors extend the base KirhaError class:
| Error | Description |
|---|---|
ConfigurationError | Invalid client configuration (missing API key, invalid vertical) |
AuthenticationError | Invalid or missing API key |
RateLimitError | Rate limit exceeded (20 requests/min) |
ValidationError | Invalid request parameters |
PlanExpiredError | Plan expired before execution (5 min TTL) |
ApiError | Server-side error |
NetworkError | Connection or timeout failure |
Rate limits
All API requests are rate-limited to 20 requests per minute per API key. Plans are valid for 5 minutes after creation. If you need a higher quota, feel free to reach out with your use case at developers@kirha.com.