Skip to Content
SdkSDK Overview

SDK Overview

The Curate-Me platform provides SDKs and tools for integrating with the AI Gateway — the governance layer that sits between your application and LLM providers. Point your existing LLM SDK at the gateway URL, add your API key, and get cost tracking, rate limiting, PII scanning, model allowlists, and human-in-the-loop approvals with zero code changes.

Available SDKs

PackageLanguageInstallPurpose
curate-mePythonpip install curate-mePython SDK for gateway integration and agent development
@curate-me/sdkTypeScriptnpm install @curate-me/sdkTypeScript SDK for gateway integration
curateCLInpm install -g @curate-me/cliCommand-line tool for managing agents, runners, and gateway config
@curate-me/embedJavaScriptnpm install @curate-me/embedEmbeddable gateway widget for web applications
@curate-me/observer-sdkTypeScriptnpm install @curate-me/observer-sdkObservability and tracing SDK for agent execution

Features

FeatureDescription
AI Gateway ProxyRoute LLM calls through the governance chain with a base URL swap — no code changes required
Cost TrackingPer-call cost recording with breakdowns by agent, model, organization, and API key
Rate LimitingPer-org, per-key request throttling with configurable RPM limits
PII ScanningLightweight regex scan for secrets and PII before requests reach providers
Model AllowlistsControl which models each organization or team can use
Human-in-the-LoopApproval queues for high-cost or sensitive operations
Multi-TenantBuilt-in tenant isolation with scoped state and cost tracking per organization
Real-Time StreamingFull SSE passthrough for streaming LLM responses
Time-Travel DebuggingReplay and inspect any agent execution step-by-step

Quick Start: Gateway Integration

The fastest way to use Curate-Me is to point your existing LLM SDK at the gateway. No new libraries needed — just change the base URL and add your API key header.

Python (OpenAI SDK)

from openai import OpenAI client = OpenAI( base_url="https://api.curate-me.ai/v1/openai", api_key="sk-your-openai-key", default_headers={"X-CM-API-Key": "cm_sk_xxx"} ) response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)

TypeScript (OpenAI SDK)

import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.curate-me.ai/v1/openai", apiKey: "sk-your-openai-key", defaultHeaders: { "X-CM-API-Key": "cm_sk_xxx" }, }); const response = await client.chat.completions.create({ model: "gpt-4o", messages: [{ role: "user", content: "Hello!" }], }); console.log(response.choices[0].message.content);

Anthropic SDK

from anthropic import Anthropic client = Anthropic( base_url="https://api.curate-me.ai/v1/anthropic", api_key="sk-ant-your-key", default_headers={"X-CM-API-Key": "cm_sk_xxx"} ) message = client.messages.create( model="claude-sonnet-4-5-20250929", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}] )

The gateway intercepts every call, applies your governance policies (rate limits, cost budgets, PII scanning, model allowlists, HITL gates), records costs, and proxies to the upstream provider. Your application receives the standard provider response — no changes to your response handling code.

Building Agents (Backend)

For teams building custom agents on the Curate-Me backend, use the BaseAgent pattern:

from src.agents.base import BaseAgent from src.models.schemas import AgentEvent from typing import AsyncIterator, Dict class SummaryAgent(BaseAgent): """Summarizes input text using an LLM.""" async def execute(self, input_data: Dict) -> AsyncIterator[AgentEvent]: yield AgentEvent(type="agent_start", agent=self.name) text = input_data["text"] summary = await self.llm.generate( prompt=f"Summarize the following text:\n\n{text}", model="gpt-4o-mini" ) yield AgentEvent( type="agent_complete", agent=self.name, result={"summary": summary} )

Register agents in the orchestrator and they automatically get cost tracking, streaming, and observability through the platform.

Enterprise Features

Multi-Tenant Support

The platform includes middleware for tenant isolation in B2B deployments. Organization context is extracted from API keys (gateway) or JWT claims (dashboard API) and propagated through every request, ensuring that state, costs, rate limits, and audit logs are scoped to the correct organization.

HTTP API Integration

Mount pipelines as FastAPI endpoints with built-in SSE streaming. The B2B API (main_b2b.py) and Gateway API (main_gateway.py) use this pattern internally to expose agent management and governance routes.

JSON Workflow Definitions

Define pipelines declaratively for integration with visual builders and version control:

{ "nodes": [ {"id": "summarize", "agent": "SummaryAgent", "model": "gpt-4o-mini"}, {"id": "sentiment", "agent": "SentimentAgent", "depends_on": ["summarize"]} ] }

Supported Models

The gateway supports multiple provider families and evolves with the router. For the current routable catalog in your environment, call GET /v1/models or use the provider reference pages. Common examples include gpt-4o, gpt-4o-mini, claude-sonnet-4-5-20250929, gemini-2.5-pro, deepseek-chat, and OpenRouter vendor-scoped model IDs.

Next Steps