API ReferenceOverview

API Reference

v2.0StableLast updated: January 2026

The ThinkHive REST API provides programmatic access to all platform features.

Base URL

https://app.thinkhive.ai

For demo/development:

https://demo.thinkhive.ai

Note: All API endpoints are served from the main application domain. There is no separate api.thinkhive.ai subdomain.

Authentication

All API requests require authentication using either:

  1. API Key (recommended for server-to-server)
  2. Session Token (for browser-based apps)
# API Key authentication
curl -H "Authorization: Bearer thk_your_api_key" \
  https://app.thinkhive.ai/api/agents

See Authentication for details.

Endpoints Overview

Quick Reference

CategoryEndpointsDescription
Health4Health checks and readiness
Agents6Agent CRUD and config
Departments4Department management
Traces & Spans10Trace ingestion (OTLP + simple), querying, spans
Sessions3Trace session management
Issues (v2)5Failure issue management
Fixes5Fix proposals and testing
Shadow Tests4Shadow test execution
Guardrails8Scanning, scanners, policies, analytics
Evaluation8Eval sets, criteria, and runs
Eval Runs4Evaluation run management
Deterministic Graders3Rule-based evaluation
Human Review6Review queue, assignment, calibration
Eval Health4Health monitoring, regressions, saturation
Nondeterminism4Pass@k analysis, consistency
Conversation Eval3Multi-turn conversation analysis
Explainability (v1)10Analysis, clusters, counterfactuals
Analyzer (v2)4Analysis with cost estimation
Deep Dive (v2)3Structured investigation
Error Analysis (v2)3Error categorization
Transcript Patterns3Pattern detection in conversations
ROI Analytics6Revenue impact and correlation
Quality Metrics5RAG scores, hallucination detection
Business Metrics4Business metric tracking
API Keys (v2)8Key management, rotation, testing
Webhooks6Webhook endpoint management and delivery
Notifications6Rules and channel configuration
Compliance5Compliance reporting and scanning
Flagged Traces4Trace flagging and review
Drift3Drift detection
Intelligence4Business intelligence

Total: 150+ endpoints

Request Format

Headers

HeaderRequiredDescription
AuthorizationYesBearer <api_key> or session token
Content-TypeFor POST/PUTapplication/json
X-Request-IDNoOptional request tracing ID

Request Body

{
  "field": "value",
  "nested": {
    "key": "value"
  }
}

Response Format

Success Response

{
  "success": true,
  "data": {
    // Response data
  }
}

Paginated Response

{
  "success": true,
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 100,
    "hasMore": true
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input",
    "details": {
      "field": "agentId",
      "reason": "Required field missing"
    }
  }
}

Error Codes

HTTP StatusError CodeDescription
400VALIDATION_ERRORInvalid request parameters
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
409CONFLICTResource already exists
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error

Rate Limits

TierRate LimitBurst
Free10 req/min20
Starter60 req/min100
Professional300 req/min500
Enterprise1,000 req/min2,000

Rate limit headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704067200

Pagination

Use page and limit query parameters:

GET /api/traces?page=2&limit=50

Filtering

Use query parameters for filtering:

GET /api/traces?agentId=agent_123&outcome=failure&startDate=2024-01-01

Sorting

Use sortBy and sortOrder parameters:

GET /api/traces?sortBy=createdAt&sortOrder=desc

SDK Integration

For easier integration, use our official SDKs:

// JavaScript/TypeScript
import { ThinkHiveClient } from '@thinkhive/sdk';
 
const client = new ThinkHiveClient({
  apiKey: 'thk_your_api_key',
});
 
const traces = await client.traces.list({
  agentId: 'agent_123',
  limit: 50,
});
# Python
import thinkhive
 
client = thinkhive.Client(api_key='thk_your_api_key')
 
traces = client.traces.list(
    agent_id='agent_123',
    limit=50,
)

OpenAPI Spec: Download the full OpenAPI specification at /api/openapi.json for code generation and API exploration tools.

Next Steps