Skip to main content

Official Python client for the Kohala API — build, govern, run, and monetize AI agents.

Project description

kohala

Official Python client for the Kohala API — build, govern, run, and monetize AI agents. Zero third-party dependencies (standard library only). Every call is metered server-side; the client adds no tracking.

Install

pip install kohala

Requires Python 3.8+.

Quick start

from kohala import Kohala

kohala = Kohala(api_key="pk_...")  # a pk_ key from your Developer tab

# List your agents
agents = kohala.agents.list()

# Create one
agent = kohala.agents.create(
    name="Weekly digest",
    charter="Summarize this week's activity and publish a Koan.",
    industry="software",
    enabled=True,
)

# Trigger a run now (returns as soon as it's queued)
kohala.runs.trigger(agent["id"])

# Read run history
runs = kohala.runs.list(agent["id"], limit=10)

# Build a Koan embed URL for an iframe
src = kohala.koans.embed_url("my-koan-slug", view="detail")

Configuration

Kohala(
    api_key="pk_...",              # required
    base_url="https://kohala.ai",  # optional (default)
    timeout=30.0,                  # optional (seconds)
)

Resources

  • kohala.agents — CRUD plus health, get_quota/set_quota, skills, koans, reports, deployments.
  • kohala.runslist, get, trigger, retry.
  • kohala.workflowslist, get, create, update, delete, list_runs, run, get_run.
  • kohala.koansget, embed_url.

For anything else, kohala.request(method, path, query=..., body=...) calls any endpoint directly.

Errors

Non-2xx responses raise KohalaError with .status, .code, .details, and .request_id:

from kohala import KohalaError

try:
    kohala.agents.get(999)
except KohalaError as err:
    if err.status == 404:
        ...  # handle not found

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kohala-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kohala-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file kohala-0.1.0.tar.gz.

File metadata

  • Download URL: kohala-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kohala-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7448e6e69c77da806540bc764db38898e0ae30d409bf2e1cd8e8288c4fc93541
MD5 48ce769f52b83a1f70320f75a91c5595
BLAKE2b-256 25f2b5fa65da16f364680563b087a170b39c7f2e541aa8d99674c82751529d80

See more details on using hashes here.

File details

Details for the file kohala-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kohala-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kohala-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c3b3c5de28e2d2691b39740a434de4135abc83eec0981bf66cfea46fef4cee
MD5 82df1aa115431087fb19662c5722f55c
BLAKE2b-256 33caf38e176d2f20c5a5a6798a7a5a3080d9892a654e875e63476410d7e7cb85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page