Skip to main content

KIRHA SDK

PyPI version CI Python versions

🦋 KIRHA • 📚 Documentation • 🔑 Get an API key

KIRHA SDK

Python SDK for the KIRHA Search and Tools APIs.

Installation

pip install kirha
# or
uv add kirha
# or
poetry add kirha

Requires Python 3.10 or later.

Quick Start

from kirha import Kirha

kirha = Kirha()

result = kirha.search("What does the boxed warning on Ozempic say?")

print(result.data)

Kirha() reads your API key from the KIRHA_API_KEY environment variable. Pass api_key="..." to set it in code.

Examples

Summarization

kirha = Kirha(api_key="your-api-key")

result = kirha.search("Summarize latest NVIDIA earning calls", summarization=True)

print(result.summary)

Summarization with instruction

kirha = Kirha(api_key="your-api-key")

result = kirha.search(
    "List top 10 stablecoins yield on Ethereum",
    summarization={
        "instruction": "Format the response as a table with columns: Stablecoin, Protocol, APY",
    },
)

print(result.summary)

Plan mode

Review the steps and the estimated cost before running the query, yourself or with an agent. Planning charges nothing until the plan runs.

kirha = Kirha(api_key="your-api-key")

plan = kirha.plan(
    "Find engineers working at companies behind the latest patents in Machine Learning",
)

print(plan.steps)
print(plan.usage)

result = plan.execute()
print(result.data)

A plan expires 5 minutes after it is created. To run it from another process, after an approval step for example, call kirha.execute_plan(plan_id).

Direct tool calling

tools = kirha.tools(focus="crypto")
print([tool.name for tool in tools])

result = kirha.execute_tool("coingecko_searchCoin", {"query": "avax", "limit": 1})
print(result.output)

Async

import asyncio

from kirha import AsyncKirha


async def main() -> None:
    async with AsyncKirha() as kirha:
        result = await kirha.search("What does the boxed warning on Ozempic say?")
        print(result.data)


asyncio.run(main())

AsyncKirha has the same methods as Kirha, as coroutines. Both clients keep a connection pool open, so close them with close() or use them as context managers.

Documentation

Errors

Error Description
KirhaError Base error class
ConfigurationError No API key passed and KIRHA_API_KEY not set
ApiError API returned an error, with status_code, code and details
AuthenticationError Invalid or missing API key (401)
RateLimitError Rate limit exceeded (429), with retry_after in seconds
PlanExpiredError Plan expired (5 minute limit)
NetworkError Network/connection failure or timeout

AuthenticationError and RateLimitError extend ApiError.

Development

uv sync
uv run pytest

uv run pytest -m integration runs the tests against the live API with your KIRHA_API_KEY. They spend credits.

Releasing

  1. Bump version in pyproject.toml (for example uv version 0.2.0) and merge it to main.
  2. Create a GitHub release with a tag matching that version, prefixed with v (for example v0.2.0).

Publishing the release runs the publish workflow, which checks that the tag matches the package version, runs the tests, builds the package and uploads it to PyPI through trusted publishing. No PyPI token is stored in the repository.

License

MIT

Metadata

Release files for kirha 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kirha 0.1.0
File Size Uploaded
kirha-0.1.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kirha 0.1.0
File Interpreter ABI Platform
kirha-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / kirha-0.1.0.tar.gz

Download URL kirha-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7dbb684072e3ea28bfa7597ea66b9e1633164c6617ddb776b321bd74627e54ff
BLAKE2b-256 checksum
How to use checksums
0fa2c2f18dabba22347b211e4fffce3629463f75069039c1548d00ccb91830de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / kirha-0.1.0-py3-none-any.whl

Download URL kirha-0.1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddb842e74cb976cc929c61b4ce4d19e2554c91f1c7eefddb81d8ef341b4c76e5
BLAKE2b-256 checksum
How to use checksums
df21c8b686477faa8676035a745c573c9342365fcf350b1152833ea8869d2525
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page