Skip to main content

Hive Minded AI Python SDK

A small, typed Python client and command line interface for the Hive Minded AI beekeeping management API.

Install

Once published to PyPI:

pip install hiveminded-ai

For local development from this repository:

pip install -e sdk/python

Authentication

The client and CLI read credentials from the environment:

Variable Required Default Purpose
HIVEMINDED_API_KEY yes none Bearer token sent as Authorization: Bearer <key>
HIVEMINDED_BASE_URL no https://api.hiveminded.ai API origin

The key is never written to disk, logged, or exposed via repr.

Quickstart (Python)

from hiveminded import HiveMindedClient

# Reads HIVEMINDED_API_KEY from the environment, or pass api_key=...
with HiveMindedClient() as client:
    hives = client.hives.list(limit=10)
    for hive in hives["data"]:
        print(hive["id"])

    one = client.hives.get("hive_123")
    print(one["data"])

    inspection = client.inspections.create(
        hive_id="hive_123",
        notes="Strong laying pattern, no queen cells.",
    )

    result = client.agents.run("health_monitor", input={"hive_id": "hive_123"})

Responses are returned as the parsed JSON body. List endpoints use the standard envelope {"data": [...], "meta": {"total", "limit", "offset", "has_more", "cursor"}}; read response["data"] for the items.

Error handling

from hiveminded import (
    HiveMindedAuthError,
    HiveMindedNotFoundError,
    HiveMindedAPIError,
)

try:
    client.hives.get("does-not-exist")
except HiveMindedNotFoundError:
    ...          # HTTP 404
except HiveMindedAuthError:
    ...          # HTTP 401 / 403
except HiveMindedAPIError as err:
    print(err.status_code, err.code, err.request_id)

Errors never carry request payloads, headers, or credentials, so they are safe to log.

Quickstart (CLI)

export HIVEMINDED_API_KEY=sk_live_...

hiveminded hives list --limit 10
hiveminded hives get hive_123
hiveminded inspections create --hive hive_123 --notes "Looks healthy"
hiveminded tasks list --status open
hiveminded tasks create --title "Add second brood box"
hiveminded agents run health_monitor --input '{"hive_id": "hive_123"}'
hiveminded mcp config

Every command prints the API response as pretty-printed JSON. You can also pass the key inline for a single invocation (it is set for that process only and never persisted):

hiveminded --api-key sk_live_... hives list

Development

cd sdk/python
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest -q
.venv/bin/ruff check src tests

Tests use httpx.MockTransport and a fake client, so no network access is required.

Publishing

Publishing to PyPI is a maintainer step and is intentionally not automated here.

Metadata

Release files for hiveminded-ai 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 hiveminded-ai 0.1.0
File Size Uploaded
hiveminded_ai-0.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

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

Total release size: 16.7 kB

Release files / hiveminded_ai-0.1.0.tar.gz

Download URL hiveminded_ai-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e44a397c7ead5e3b55c7bdc8200438f4d5d1934e795f2cb133fd58b565278ab5
BLAKE2b-256 checksum
How to use checksums
a40187969995a408ab7817e910e32a45ca2981c7c93d07b64b3742bf6ac6d4d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 6, 2026.

Transparency log

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

Download URL hiveminded_ai-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5189d1d219b41ac5f31ce59a28510c3a8cade390e0adc419294cf5c274060851
BLAKE2b-256 checksum
How to use checksums
1b91527da893315e8492209994a4f2c1639a9ea04696ce990c4b8e94ed81120f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 6, 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