Skip to main content

Provider Matrix

Documented for Python SDK token-sentinel 1.0.2.

Canonical “what’s supported” reference for the open-source SDK. For narrative install + examples, prefer Providers (user guide).

How dispatch works

Sentinel.wrap(client) inspects type(client).__module__ (and class name where needed) and routes to a wrapper. OpenAI-compatible hosts use the official openai SDK with a custom base_url, so they keep an openai… module prefix and pick up wrap_openai for free.

Native wrappers

ProviderSDKStreamingAsyncNotes
Anthropicanthropicyesyesmessages.create + messages.stream
OpenAIopenaiyesyesChat, embeddings, Whisper STT. Streams need stream_options.include_usage for tokens
Google Geminigoogle-genaiyesyesVertex via vertexai=True
AWS Bedrockboto3yessync onlyconverse / converse_stream
Voyage AIvoyageain/ayesembed, rerank
Cohere V2coherelimitedyesClientV2 / AsyncClientV2 only
Replicatereplicaten/an/aNon-token usage_extra
Deepgramdeepgram-sdklive WSyesSTT; multichannel rule
ElevenLabselevenlabsyesyesTTS; voice-switching rule

OpenAI-compatible (via wrap_openai)

DeepSeek · Together · Fireworks · Groq · OpenRouter · Anyscale · Mistral · Perplexity · vLLM · Ollama · TGI · LM Studio · LocalAI

import openai
from token_sentinel import Sentinel

sentinel = Sentinel(project="my-agent")
client = sentinel.wrap(
openai.OpenAI(api_key="...", base_url="https://api.deepseek.com"),
)

CallRecord.provider is "openai"; the real model string is in record.model.

Self-hosted

Same OpenAI-compatible path. Waste signals are real; estimated_burn is not a GPU invoice — treat it as a relative quality metric.

Not instrumented

  • Legacy Vertex vertexai SDK (use google.genai + vertexai=True)
  • Cohere V1 Client
  • Bedrock invoke_model*

Custom stacks: build CallRecord and call Sentinel.record_call.