v1.5.0 - CometAPI Provider Support
What's New
CometAPI Provider Support
TraceVerde now auto-instruments CometAPI, an all-in-one aggregator exposing 500+ models (GPT, Claude, Gemini, DeepSeek, Qwen, and more) behind a single API key.
- Automatic detection of CometAPI clients via
base_urlchecking forcometapi.com- no code changes needed - Dual-SDK support: works with BOTH the Anthropic SDK (
/v1/messages) and the OpenAI SDK (/v1/chat/completions) - Token usage extraction handles both response shapes, including Anthropic prompt-cache read/write tokens
- Cost tracking resolves through the requested model name against the existing 1,050+ model pricing database
- Spans named
cometapi.messages.create(Anthropic SDK) andcometapi.chat.completion(OpenAI SDK) withgen_ai.system = "cometapi" - Enabled by default; install with
pip install genai-otel-instrument[cometapi]
Usage
import genai_otel
genai_otel.instrument()
import anthropic
client = anthropic.Anthropic(
base_url="https://api.cometapi.com",
api_key="your-cometapi-key",
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Can you describe LLMs to me?"}],
)See examples/comet_api.py for a complete example covering both SDKs.
Testing
- 27 new unit tests in
tests/instrumentors/test_cometapi_instrumentor.py
Full Changelog: v1.4.2...v1.5.0