SDKsOverview

ThinkHive SDKs

ThinkHive provides official SDKs for the most popular AI development environments. Each SDK offers the same core functionality with language-idiomatic interfaces.

Available SDKs

Feature Comparison

FeatureJavaScriptPythonMCP Server
LLM Tracing
Retrieval Tracing
Tool Tracing
Auto-instrumentation✅ OpenAI, LangChain, Anthropic✅ OpenAI, LangChain, LlamaIndex, AnthropicN/A
V3 APIs (Runs, Claims)JS only
GuardrailsN/A
Business MetricsJS onlyN/A
ROI Analytics
Issues & FixesJS only
Human ReviewJS onlyN/A
NondeterminismJS onlyN/A
Eval HealthJS onlyN/A
Deterministic GradersJS onlyN/A
Conversation EvalJS onlyN/A
Transcript PatternsJS onlyN/A
Quality Metrics
API Keys ManagementJS onlyN/A
Linking & Customer ContextJS onlyN/A
OpenTelemetry ExportN/A
Explainability Analysis
RAG Evaluation
Hallucination Detection

Quick Start

JavaScript/TypeScript

import { init, traceLLM } from '@thinkhive/sdk';
 
init({ serviceName: 'my-agent' });
 
const response = await traceLLM({
  name: 'chat-completion',
  modelName: 'gpt-4',
  provider: 'openai',
}, async () => {
  return await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{ role: 'user', content: 'Hello!' }],
  });
});

Python

import thinkhive
 
thinkhive.init(service_name="my-agent")
 
@thinkhive.trace_llm(model_name="gpt-4", provider="openai")
def chat(message: str) -> str:
    response = openai.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": message}],
    )
    return response.choices[0].message.content

MCP Server (Claude Code)

Add to your Claude Code settings:

{
  "mcpServers": {
    "thinkhive": {
      "command": "npx",
      "args": ["@thinkhive/mcp-explainer"],
      "env": {
        "THINKHIVE_API_KEY": "thk_your_key"
      }
    }
  }
}

Environment Variables

All SDKs support these environment variables:

VariableDescriptionRequired
THINKHIVE_API_KEYYour API keyYes
THINKHIVE_ENDPOINTCustom API endpointNo
THINKHIVE_SERVICE_NAMEService identifierNo
THINKHIVE_AGENT_IDAgent identifierNo

Direct API Access

If you need to integrate with a language we don’t have an SDK for, you can use our REST API directly:

curl -X POST https://app.thinkhive.ai/api/traces \
  -H "Authorization: Bearer thk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "spans": [{
      "name": "my-llm-call",
      "type": "llm",
      "input": "Hello!",
      "output": "Hi there!",
      "model": "gpt-4"
    }]
  }'

See the API Reference for complete documentation.

Getting Help

Need help with integration? Check the specific SDK documentation or reach out to support@thinkhive.ai.