kirha logo

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

GitHubkirha-ai/kirha-sdk-typescript

2

Installation

npm install kirha
pnpm add kirha
yarn add kirha
bun add kirha

Setup

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:

ErrorDescription
ConfigurationErrorInvalid client configuration (missing API key, invalid vertical)
AuthenticationErrorInvalid or missing API key
RateLimitErrorRate limit exceeded (20 requests/min)
ValidationErrorInvalid request parameters
PlanExpiredErrorPlan expired before execution (5 min TTL)
ApiErrorServer-side error
NetworkErrorConnection 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.

Next steps

On this page