KIRHA SDKs
KIRHA has an official SDK for TypeScript and one for Python, both published as kirha. They handle authentication, tool planning, provider orchestration, and response parsing so you can focus on building your agent logic.
With either 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 to give your agent access to the data providers without KIRHA's planning
- Run the planner locally to plan queries on your own machine (TypeScript only)
Installation
npm install kirhapnpm add kirhayarn add kirhabun add kirhapip install kirhauv add kirhapoetry add kirhaRequires Python 3.10 or later.
Setup
Initialize the client with your API key:
import { Kirha } from "kirha";
const kirha = new Kirha({ apiKey: process.env.KIRHA_API_KEY });from kirha import Kirha
kirha = Kirha()Kirha() reads your API key from the KIRHA_API_KEY environment variable. Pass api_key="..." to set it in code.
For asyncio, AsyncKirha has the same methods as coroutines:
from kirha import AsyncKirha
async with AsyncKirha() as kirha:
result = await kirha.search("What does the boxed warning on Ozempic say?")Run your first query
import { Kirha } from "kirha";
const kirha = new Kirha({ apiKey: process.env.KIRHA_API_KEY });
const result = await kirha.search("What does the boxed warning on Ozempic say?");
console.log(result.data); from kirha import Kirha
kirha = Kirha()
result = kirha.search("What does the boxed warning on Ozempic say?")
print(result.data) KIRHA picks the providers across every vertical. To restrict a search to one vertical, pass focus, in the constructor or per query:
const result = await kirha.search("List top 10 stablecoins yield on Ethereum", {
focus: "crypto",
});result = kirha.search(
"List top 10 stablecoins yield on Ethereum",
focus="crypto",
)Error handling
All errors extend the base KirhaError class:
| Error | Description |
|---|---|
ConfigurationError | Invalid client configuration (missing API key, missing planner URL) |
AuthenticationError | Invalid or missing API key |
RateLimitError | Rate limit exceeded (20 requests/min) |
ValidationError | Invalid request parameters |
PlanExpiredError | Plan executed more than 5 minutes after it was created |
ApiError | Server-side error |
NetworkError | Connection or timeout failure |
| Error | Description |
|---|---|
ConfigurationError | Invalid client configuration (missing API key) |
AuthenticationError | Invalid or missing API key |
RateLimitError | Rate limit exceeded (20 requests/min) |
PlanExpiredError | Plan executed more than 5 minutes after it was created |
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.