Skip to main content

API Reference

The ColabHive Builder API lets you discover and register compatible HuggingFace models, use the curated base catalog, train and merge your own models, and run inference — all over one HTTP API.

Two things are true at once:

  1. Register a compatible HuggingFace model. POST /models/hf/search → GET /models/hf/{repo_id}/info → POST /models/hf/register. Registering creates a model_config + an inference_endpoint, and the model becomes callable (first request triggers a cold start). See Models API.
  2. Use the curated base catalog. LLMs, specialists, tools, generative models, and trainable templates maintained by ColabHive. Discover them live — never hardcode a list — via GET /api/builder/v1/actions or GET /api/builder/v1/endpoints?visibility=public.

The catalog is data-driven and changes over time. This reference documents the contracts; for the current set of models and endpoints, always query the live discovery endpoints below.


Base URL​

https://api.colabhive.com
  • Builder API is mounted under /api/builder/v1 — e.g. https://api.colabhive.com/api/builder/v1/endpoints.
  • OpenAI-compatible API is mounted under /v1 — e.g. https://api.colabhive.com/v1/chat/completions.

Protected requests authenticate with an API key. Public discovery and health exceptions are marked below and in the live OpenAPI document. See Authentication.


Endpoints​

Discovery (no list is hardcoded)​

EndpointPurpose
GET /api/builder/v1/inference/modelsAll models available for inference (base + registered), optionally with readiness. No auth.
GET /api/builder/v1/endpointsInference endpoints, filterable by source (catalog vs trained), owner, base_model, visibility, task_type, search.
GET /api/builder/v1/actionsAuthenticated, account-aware view for plugins and agents (LLMs, specialists, tools, trained, generative).
GET /api/builder/v1/capabilitiesSupported capability types.

Reference pages​

  • Authentication — API keys (hive_…), headers, account context.
  • Account Preferences — read account settings and opt spare capacity into or out of Share Hive.
  • Datasets — upload and manage training datasets.
  • Training — create, monitor, and manage training runs.
  • Merge & Retrain — merge models/adapters, retrain-on-top, lineage, rename.
  • Models — trained-model catalog, HuggingFace import, model registry, capabilities.
  • Inference — run predictions on endpoints (sync/async), readiness, binary/multimodal I/O.
  • OpenAI-Compatible API — POST /v1/chat/completions drop-in for OpenAI clients.
  • Actions — discover and invoke any capability by slug (n8n, Zapier, MCP, LangChain).
  • Quick Reference — the shortest path to a first request.
  • Agent & LLM Integration — machine-readable resources, readiness-aware routing.
  • Outbound Webhooks — optional terminal notifications for inference, Actions/MCP invocations, training runs, and merges.

Full endpoint index​

Every route the gateway exposes. The Builder API is under /api/builder/v1; the OpenAI-compatible surface is under /v1. This mirrors the live openapi.json.

MethodPathReference
GET PATCH/api/builder/v1/account/preferencesAccount Preferences
GET/api/builder/v1/capabilitiesModels → Capabilities
GET/api/builder/v1/healthService health
GET/api/builder/v1/inference/healthInference service health
POST/api/builder/v1/models/hf/searchModels → HF search
GET/api/builder/v1/models/hf/{repo_id}/infoModels → HF info
POST/api/builder/v1/models/hf/registerModels → HF register
GET/api/builder/v1/models/registryModels → List registry
PATCH/api/builder/v1/models/registry/{model_config_id}/lifecycleModels → Update lifecycle
POST GET/api/builder/v1/modelsModels → Trained models
GET/api/builder/v1/models/{model_id}Models → Get model
GET/api/builder/v1/models/{model_id}/versionsModels → List versions
GET/api/builder/v1/models/{model_id}/lineageMerge & Retrain → Lineage
PATCH/api/builder/v1/models/{model_id}/versions/{version_id}Merge & Retrain → Rename
GET/api/builder/v1/datasetsDatasets
POST/api/builder/v1/datasets/uploadDatasets → Direct upload
GET DELETE/api/builder/v1/datasets/{dataset_id}Datasets
POST GET/api/builder/v1/training/runsTraining
GET DELETE/api/builder/v1/training/runs/{run_id}Training → Get run
GET/api/builder/v1/training/runs/{run_id}/logsTraining → Logs
GET/api/builder/v1/training/runs/{run_id}/metricsTraining → Metrics
GET/api/builder/v1/training/runs/{run_id}/eventsTraining → Events
GET/api/builder/v1/training/runs/{run_id}/artifactsTraining → Artifacts
GET/api/builder/v1/training/runs/{run_id}/artifacts/download-urlsTraining → Download URLs
POST/api/builder/v1/training/runs/{run_id}/cancelTraining → Cancel
POST/api/builder/v1/training/runs/{run_id}/register-for-inferenceTraining → Register
POST/api/builder/v1/training/mergesMerge & Retrain → Merge
GET/api/builder/v1/training/model-configsTraining → Model configs
GET/api/builder/v1/training/model-configs/{model_id}Training → Get config
GET/api/builder/v1/training/model-configs/{model_id}/schemaTraining → Config schema
GET/api/builder/v1/inference/modelsInference → List models
GET/api/builder/v1/endpointsInference → List endpoints
GET DELETE/api/builder/v1/endpoints/{endpoint_id}Inference → Get/Delete
POST/api/builder/v1/endpoints/{endpoint_id}/inferInference → Predictions
POST/api/builder/v1/endpoints/{endpoint_id}/infer:asyncInference — HTTP 202 + task_id
POST/api/builder/v1/endpoints/{endpoint_id}/upload-inputInference → Binary input
GET/api/builder/v1/tasks/{task_id}Inference → Poll task
GET/api/builder/v1/queue/statsInference → Queue stats
GET/api/builder/v1/actionsActions → Discover
GET/api/builder/v1/actions/{slug}Actions → Detail
POST/api/builder/v1/actions/{slug}:invokeActions → Invoke
GET/api/builder/v1/invocations/{invocation_id}Actions → Poll
GET/api/builder/v1/mcp/manifest · /mcp/manifest/{slug}MCP Tools Reference
POST/v1/chat/completionsOpenAI-Compatible API
GET/v1/modelsOpenAI-Compatible API
GET/v1/models/{model}OpenAI-Compatible API

Token-by-token streaming lives here: POST /v1/chat/completions with "stream": true returns real SSE and works with unmodified OpenAI clients. There is no :stream route on the typed inference surface.

Optional webhook routes​

The Builder API serves the webhook management route patterns below, and the published openapi.json includes them together with the delivery-history routes listed in Outbound Webhooks. Polling remains available.

MethodsPathReference
POST GET/api/builder/v1/webhook-endpointsOutbound Webhooks
GET PATCH DELETE/api/builder/v1/webhook-endpoints/{endpoint_id}Outbound Webhooks
POST/api/builder/v1/webhook-endpoints/{endpoint_id}/rotate-secretOutbound Webhooks
POST/api/builder/v1/webhook-endpoints/{endpoint_id}/testOutbound Webhooks

Machine-readable specs​

ColabHive publishes two contracts because the public gateway and the control plane have different lifecycles. A route absent from Builder is not undocumented if it appears in the Orchestrator contract; clients must generate against the service they call.

ResourceScopeURL
Builder OpenAPI 3.1/api/builder/v1, /v1/openapi.json
Orchestrator OpenAPI 3.1/api/v1, including data-protection and placement attestation/openapi-orchestrator.json
Builder Swagger UIBuilderapi.colabhive.com/api/builder/v1/docs
Builder ReDocBuilderapi.colabhive.com/api/builder/v1/redoc
llm.txt / llms-full.txtDocumentation corpus/llm.txt · /llms-full.txt

The published openapi.json is regenerated from the live gateway and reflects the real routes, including /v1/chat/completions and /api/builder/v1/training/merges.

Response-schema migration

Runtime errors use the stable error.code, error.message, error.details, and error.request_id envelope. The Builder contract now types inference endpoints, task polling, training runs, metrics, artifacts and lifecycle responses, and maps validation failures to that same envelope. Some secondary catalog/action responses remain permissive while their response models are migrated; generate strict clients for the primary flows above and inspect the schema of a secondary operation before relying on closed-world fields.


Python SDK​

pip install colabhive
from colabhive import ColabHive

client = ColabHive(
api_key="hive_...", # or set COLABHIVE_API_KEY
account_id="your_account_id" # optional; auto-detected from the key
)

The base URL defaults to https://api.colabhive.com (override with COLABHIVE_BASE_URL or the base_url= argument). See the SDK Reference for the full surface.