Scan your whole stack
Are you using superpenguin?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.22.1
superpenguin was last scanned on 24 Nov 2026 at version 0.22.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.22.1 LATEST | 24 Nov 2026 | No rules fired |
| 0.22.0 | 5 Nov 2026 | No rules fired |
| 0.21.2 | 30 Oct 2026 | No rules fired |
| 0.20.0 | 28 Oct 2026 | Not shown |
| 0.19.0 | 27 Oct 2026 | Not shown |
Findings for v0.22.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.22.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Track AI costs automatically across LLMs and voice. Wrap your OpenAI, Anthropic, Google Gemini, or AWS Bedrock client (or patch litellm) and every LLM call is captured with token counts, estimated cost, latency, and attribution metadata. For voice, the same sp.wrap() works on Deepgram (STT) and ElevenLabs (TTS) clients standalone, and a one-line shim captures LiveKit Agents per-turn metrics + per-session billing rows so a single voice call's STT + LLM + TTS + agent-session all stitch back together on one session_id. No proxy required.
How is this different from native provider attribution? See
docs/vs-native-attribution.mdfor the full breakdown of what OpenAI / Anthropic / Deepgram / ElevenLabs offer natively vs. what SuperPenguin adds on top.
pip install superpenguin
For OpenTelemetry trace correlation:
pip install "superpenguin[otel]"
Or install from source (in the sdk/python/ directory):
pip install -e .
Read the latest spend observed for your organization before starting another AI request. The same SDK key authorizes ingestion and spend reads.
import os
import superpenguin as sp
sp.init(api_key=os.environ["SP_API_KEY"])
try:
current = sp.spend.get(
window="1d",
)
print(current["spendUsd"], current["asOf"], current["stalenessMs"])
except sp.SuperPenguinSpendError as error:
if error.retryable:
# Decide whether your application should retry, queue, or continue.
pass
Supported windows are 1d through 7d, 14d, and month. These are UTC
calendar-day windows: 1d is today, numbered windows include today plus the
preceding N - 1 days, and month is the current calendar month through today.
They are not rolling-hour windows. Filter by feature, model, or both:
filtered = sp.spend.get(
window="7d",
feature="document-processing",
model="gpt-5",
)
spendMicros is the exact USD-micro total as an integer string; spendUsd is a
convenience float. window contains the resolved UTC start, exclusive end,
type, and timeZone. asOf is when the reader loaded the newest snapshot
used by the response, and stalenessMs conservatively estimates how far it may
trail usage already accepted by SuperPenguin. There is no public freshThrough
field. The result is advisory, not a budget reservation.
The SDK flushes its local queue before reading by default, but ingestion and
materialization remain asynchronous. Pass flush=False to skip that flush.
Identical concurrent reads in the same process share one flush and HTTP request.
Production spend reads use https://spend.superpenguin.ai automatically.
spend_base_url or SP_SPEND_BASE_URL is an optional advanced override that
affects only spend reads; usage flushes continue to use base_url or
SP_BASE_URL. An explicit custom base_url is the fallback for both paths
unless a spend-only override is set.
SuperPenguinSpendError exposes code, retryable, and optional HTTP status.
The SDK makes one bounded spend request and does not retry automatically. Codes
are invalid_request, invalid_api_key, rate_limited, spend_unavailable,
and request_failed.
import superpenguin as sp
from openai import OpenAI
sp.init(api_key="sp-...") # your SuperPenguin API key
client = sp.wrap(OpenAI())
# Use the client exactly as normal; cost events are captured automatically
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
That's it. Every create() call through the wrapped client is captured with provider, model, token counts, estimated cost (USD), and latency.
import superpenguin as sp
from anthropic import Anthropic
sp.init(api_key="sp-...")
client = sp.wrap(Anthropic())
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
The same sp.wrap() works on the unified google-genai client, which targets either the Gemini API (AI Studio) or Vertex AI:
import superpenguin as sp
from google import genai
sp.init(api_key="sp-...")
# AI Studio
client = sp.wrap(genai.Client(api_key="..."))
# Or Vertex AI
client = sp.wrap(genai.Client(vertexai=True, project="my-gcp", location="us-central1"))
response = client.models.generate_content(
model="gemini-2.5-pro",
contents="Hello!",
)
Both generate_content and generate_content_stream are tracked, on client.models and client.aio.models (async). Tiered pricing for gemini-2.5-pro and gemini-3.1-pro-preview is applied automatically based on the input token count.
The same sp.wrap() instruments a Bedrock runtime client. Wrap the client and every converse / converse_stream call auto-submits a row with the raw modelId, token counts, latency, and metadata:
import superpenguin as sp
import boto3
sp.init(api_key="sp-...")
client = sp.wrap(boto3.client("bedrock-runtime"), metadata={"customer_id": "acme_corp"})
response = client.converse(
modelId="anthropic.claude-3-5-sonnet-20241022-v2:0",
messages=[{"role": "user", "content": [{"text": "Hello!"}]}],
)
async works too via aioboto3 (session.client("bedrock-runtime")); both converse and converse_stream are tracked, with streaming usage accumulated across the event stream into a single row.
Bedrock is a reseller: a model's price on Bedrock differs from its origin vendor (Claude on Bedrock vs. Anthropic direct). To keep this accurate and current, the Bedrock wrapper sends no client-side cost. It emits token facts plus the raw modelId, and the server prices the row with its provider-scoped Bedrock rate card.
invoke_model and invoke_model_with_response_stream are wrapped too (the JSON body is read for content capture). Bedrock calls take no per-call extra_body, so attribute with wrap-level metadata, sp.metadata() or @sp.trace.
client = sp.wrap(OpenAI())
stream = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
# Cost event is submitted automatically when the stream finishes
If you use litellm to call 100+ LLM providers through a single interface, one call patches everything:
import superpenguin as sp
import litellm
sp.init(api_key="sp-...")
sp.patch_litellm()
# Every litellm.completion() / litellm.acompletion() is now tracked
response = litellm.completion(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
Calling a LiteLLM proxy instead? Wrap an OpenAI client pointed at it. Pass
provider="litellm" unless the proxy's host name contains "litellm" (then it is
detected automatically). The call is recorded under the litellm route with
LiteLLM's own per-request cost (the x-litellm-response-cost header, or
usage.cost on the last chunk of a stream):
from openai import OpenAI
client = sp.wrap(
OpenAI(api_key="sk-litellm-...", base_url="http://localhost:4000/v1"),
provider="litellm",
)
Attach metadata to attribute costs to customers, features, teams, or environments:
# Set defaults for all calls from this client
client = sp.wrap(OpenAI(), metadata={
"customer_id": "cust_acme_123",
"feature": "doc_summary",
"team": "product",
"environment": "production",
})
# Or override per-call via extra_body
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Summarize this document"}],
extra_body={
"sp_metadata": {
"customer_id": "cust_other_456",
"prompt_key": "summarize_v2",
"prompt_version": "3",
}
},
)
sp.wrap(deepgram_client)If you call Deepgram directly from a backend service (no LiveKit Agents in the loop), wrap the client and every transcribe_url / transcribe_file call auto-submits a row with audio_seconds, the canonical model SKU, and the cost in USD micros.
import superpenguin as sp
from deepgram import DeepgramClient, PrerecordedOptions
sp.init(api_key="sp-...")
dg = sp.wrap(
DeepgramClient(api_key="..."),
metadata={"customer_id": "cust_acme_123", "feature": "podcasts"},
tier="growth", # optional; drop or set "growth" if you're on the Growth plan
)
result = dg.listen.rest.v("1").transcribe_url(
{"url": "https://example.com/episode.mp3"},
PrerecordedOptions(model="nova-3", multilingual=True),
)
# A single request_logs row is submitted automatically with
# provider="deepgram"
# model="deepgram/nova-3-multilingual-prerecorded[-growth]"
# audio_seconds = result.metadata.duration
| Method | Sync | Async |
|---|---|---|
client.listen.rest.v("1").transcribe_url |
✓ | ✓ (via client.listen.asyncrest) |
client.listen.rest.v("1").transcribe_file |
✓ | ✓ (via client.listen.asyncrest) |
Live WebSocket STT (listen.live.v(...)) |
⏳ planned (v2) | ⏳ planned (v2) |
Callback-mode async transcribe (callback= URL) |
✗, response is empty | ✗ |
Deepgram TTS (speak.rest.v(...)) |
⏳ pricing seed pending | ⏳ |
Voice Agent API (agent.v(...)) |
⏳ pricing seed pending | ⏳ |
Both methods we wrap hit Deepgram's HTTP REST endpoint, which bills against the pre-recorded SKU, about 44% cheaper than the streaming WebSocket SKU on every Nova model. The wrapper composes the right slug from four signals:
response.metadata.model_info)-prerecorded for the methods we wrap today)-growth when you pass tier="growth"; defaults to PAYG)Example slugs the dashboard will see: deepgram/nova-3-monolingual-prerecorded, deepgram/nova-3-multilingual-prerecorded-growth, deepgram/nova-2-monolingual-prerecorded.
Deepgram's request models don't expose an extra_body hook, so per-call metadata overrides aren't supported in this iteration. Pass defaults via sp.wrap(..., metadata={...}). A sp.context() context manager that works across all wrappers is planned.
If you're already using LiveKitObservability (Section 9), do NOT additionally wrap the Deepgram client used inside the LiveKit Agents plugin. Both paths would emit a row for the same audio. In practice LiveKit Agents constructs its own internal Deepgram client that you don't hold a reference to, so natural separation is the norm.
sp.wrap(elevenlabs_client)Same sp.wrap() pattern for ElevenLabs. Every text_to_speech.convert / convert_as_stream / text_to_sound_effects.convert call auto-submits a row with characters = len(text), the canonical model SKU, and the cost.
import superpenguin as sp
from elevenlabs.client import ElevenLabs
sp.init(api_key="sp-...")
el = sp.wrap(
ElevenLabs(api_key="..."),
metadata={"customer_id": "cust_acme_123", "feature": "ivr-greeting"},
)
audio = el.text_to_speech.convert(
voice_id="21m00Tcm4TlvDq8ikWAM",
text="Welcome to SuperPenguin", # 23 characters
model_id="eleven_flash_v2_5",
)
# A single request_logs row is submitted automatically with
# provider="elevenlabs"
# model="elevenlabs/eleven_flash_v2_5"
# characters=23
| Method | Sync | Async |
|---|---|---|
client.text_to_speech.convert |
✓ | ✓ (AsyncElevenLabs) |
client.text_to_speech.convert_as_stream |
✓ (stream proxy) | ✓ (async stream proxy) |
client.text_to_sound_effects.convert |
✓ | ✓ |
client.text_to_sound_effects.convert_as_stream |
✓ (stream proxy) | ✓ |
Real-time WebSocket TTS (text_to_speech.stream) |
⏳ planned | ⏳ |
Speech-to-Speech (speech_to_speech.convert) |
⏳ pricing seed pending | ⏳ |
| Voice changer | ⏳ pricing seed pending | ⏳ |
convert_as_stream returns an iterator of audio bytes. The wrapper proxies the iterator and submits the row when you finish consuming it (or call .close()/exit a with block). The cost is fixed at len(text) regardless of how you consume the stream; wrapping the iterator just means latency_ms reflects time-to-completion instead of time-to-iterator-construction.
ElevenLabs doesn't bill failed synthesis. If a call raises, the wrapper still emits a row (so error-rate dashboards stay accurate) with status_code != 200 and cost_usd_micros = 0.
If you run a voice agent on top of LiveKit Agents, typically Deepgram for STT, an OpenAI/Anthropic LLM for reasoning, and ElevenLabs for TTS, wire the LiveKitObservability shim into your AgentSession and three of those four billing surfaces are captured per-turn straight from LiveKit's own MetricsCollectedEvent stream:
import asyncio
import superpenguin as sp
from superpenguin.voice import LiveKitObservability
from openai import AsyncOpenAI
sp.init(api_key="sp-...")
llm_client = sp.wrap(AsyncOpenAI()) # ← LLM still goes through sp.wrap()
obs = LiveKitObservability(
session_id=ctx.room.name, # any stable per-call id; LiveKit room name works
metadata={"customer_id": "cust_acme_123", "feature": "drive-thru"},
)
@session.on("metrics_collected")
def _on_metrics(ev):
asyncio.create_task(obs.on_metrics(ev))
# When the call ends, emit the LiveKit session-minute + observability-event rows:
await obs.on_session_end(duration_seconds=elapsed_seconds)
| LiveKit event | Provider row | Billing unit |
|---|---|---|
STTMetrics (per turn) |
deepgram / nova-3-monolingual |
audio_seconds |
TTSMetrics (per turn) |
elevenlabs / eleven_flash_v2_5 |
characters (+ audio_seconds for analytics) |
LLMMetrics (per turn) |
skipped, already captured by sp.wrap() |
n/a |
on_session_end() |
livekit / agent-session-minute |
audio_seconds (= session duration) |
on_session_end() |
livekit / observability-event |
events (count of MetricsCollectedEvent fan-out) |
Defaults match the catalogued Deepgram / ElevenLabs SKUs. Override per session via the constructor if you're on a different SKU:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.