Overview
The TAB SDK allows you to automatically benchmark, certify, and monitor your AI agents. Collect metrics, earn Trust Seal certification, and display badges on your website.
Installation
🚧 Beta Notice
SDK packages (@tab/sdk, @tab/react) will be published to npm and PyPI at general availability. During beta, integrate directly via TAB's REST API — see API Documentation.
# Coming at GA — not yet published
# npm install @tab/sdk
# npm install @tab/react
Will support Node.js 18+, React 17+, and Vercel AI SDK 3+
API Keys
Get your API key from the Developer Portal. Keys start with tab_
tab_••••••••••••
# Set as environment variable
export TAB_API_KEY=tab_your_key_here
Quick Start
Wrap your AI agent with TAB certification in 3 lines:
import { withTABCertification } from '@tab/sdk';
// Wrap your existing agent
const agent = withTABCertification(myAgent, {
apiKey: process.env.TAB_API_KEY,
agentId: 'my-weather-agent',
});
// Use normally - TAB tracks everything automatically
const result = await agent.run('What is the weather in NYC?');
// Get Trust Seal anytime
const seal = await agent.getTrustSeal();
console.log(seal);
// { tier: 'gold', scores: { reliability: 92, cost: 87, latency: 95, overall: 91 } }
TABClient
Direct client for manual API access:
import { TABClient } from '@tab/sdk';
const client = new TABClient({
apiKey: process.env.TAB_API_KEY,
});
// Register your agent
await client.registerAgent({
id: 'my-agent',
name: 'My Weather Agent',
model: 'claude-sonnet-4-5',
});
// Submit metrics
await client.submitMetrics('my-agent', [
{ type: 'latency', value: 850, timestamp: Date.now() },
{ type: 'tokens', input_tokens: 150, output_tokens: 89, timestamp: Date.now() },
{ type: 'tool_call', tool: 'weather', success: true, timestamp: Date.now() },
]);
// Get Trust Seal
const seal = await client.getTrustSeal('my-agent');
// Get available benchmarks
const benchmarks = await client.getAvailableBenchmarks();
MetricsCollector
Automatic batching and syncing of metrics:
import { TABClient, MetricsCollector } from '@tab/sdk';
const client = new TABClient({ apiKey: process.env.TAB_API_KEY });
const collector = new MetricsCollector(client, 'my-agent', {
autoSync: true, // Auto-sync to TAB (default: true)
syncInterval: 30000, // Every 30 seconds
batchSize: 10, // Batch 10 metrics before sync
});
// Record metrics
collector.recordLatency(850);
collector.recordTokens(150, 89);
collector.recordToolCall('weather', true);
collector.recordError('API timeout');
collector.recordCompletion(true);
// Force sync
await collector.flush();
// Stop auto-sync
await collector.stop();
AI SDK Middleware
Integrate with Vercel AI SDK's wrapLanguageModel:
import { wrapLanguageModel } from 'ai';
import { openai } from '@ai-sdk/openai';
import { tabMiddleware } from '@tab/sdk';
const model = wrapLanguageModel({
model: openai('gpt-4'),
middleware: tabMiddleware({
apiKey: process.env.TAB_API_KEY,
agentId: 'my-agent',
trackLatency: true, // Track response times
trackTokens: true, // Track token usage
trackToolCalls: true, // Track tool usage
trackErrors: true, // Track errors
}),
});
Agent Wrapper
Wrap any agent object for automatic tracking:
import { withTABCertification } from '@tab/sdk';
const certifiedAgent = withTABCertification(myAgent, {
apiKey: process.env.TAB_API_KEY,
agentId: 'my-agent',
autoSync: true,
syncInterval: 30000,
});
// Original methods work normally
const result = await certifiedAgent.run('Hello');
// New methods available
const seal = await certifiedAgent.getTrustSeal();
const metrics = certifiedAgent.getMetrics();
await certifiedAgent.syncNow();
await certifiedAgent.stop();
TrustSealBadge (React)
Display Trust Seal badges in your React app:
import { TrustSealBadge } from '@tab/react';
// Basic usage
<TrustSealBadge agentId="my-agent" apiKey="tab_xxx" />
// With dimension breakdown
<TrustSealBadge agentId="my-agent" apiKey="tab_xxx" showDimensions />
// Different sizes
<TrustSealBadge agentId="my-agent" apiKey="tab_xxx" size="large" />
// Auto-refresh every 30 seconds
<TrustSealBadge agentId="my-agent" apiKey="tab_xxx" refreshInterval={30000} />
BenchmarkResults (React)
Display detailed benchmark results:
import { BenchmarkResults } from '@tab/react';
<BenchmarkResults
agentId="my-agent"
apiKey="tab_xxx"
showDetails
/>
React Hooks
Build custom components with the useTrustSeal hook:
import { useTrustSeal } from '@tab/react';
function CustomBadge({ agentId }) {
const { data, loading, error, refetch } = useTrustSeal(agentId, 'tab_xxx');
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<div>
<h2>{data.name}</h2>
<p>Tier: {data.tier}</p>
<p>Score: {data.scores.overall}%</p>
<button onClick={refetch}>Refresh</button>
</div>
);
}
REST Endpoints
Direct API access (all require X-TAB-API-Key header):
/api/sdk/register
Register a new agent
/api/sdk/metrics
Submit collected metrics
/api/sdk/trust-seal/{agent_id}
Get Trust Seal scores
/api/sdk/badge/{agent_id}
Get embeddable SVG badge
/api/sdk/benchmarks/available
List available benchmarks
Trust Seal Tiers
Agents earn tiers based on their overall score:
Embedding Badges
Display your Trust Seal on your website:
HTML
<img src="https://tabverified.ai/api/sdk/badge/YOUR_AGENT_ID" alt="TAB Trust Seal" />
Markdown
[](https://tabverified.ai/agents/YOUR_AGENT_ID)
Size Options
<!-- Small (120x24) -->
<img src="https://tabverified.ai/api/sdk/badge/YOUR_AGENT_ID?size=small" />
<!-- Medium (160x32) - default -->
<img src="https://tabverified.ai/api/sdk/badge/YOUR_AGENT_ID?size=medium" />
<!-- Large (200x40) -->
<img src="https://tabverified.ai/api/sdk/badge/YOUR_AGENT_ID?size=large" />