Installation
Quick Start
What Gets Traced
- Chat completions — input messages (user text only), output text, model, token usage (prompt/completion)
- Finish reason —
azure_openai.finish_reason(stop,length,content_filter,tool_calls) - Extended tokens —
ai.usage.cached_tokens(prompt cache hits) andai.usage.thoughts_tokens(reasoning tokens for o1/o3 models) - Errors — captured with error status, re-thrown to caller
Configuration
Projects
Route events to a specific project by passing its slug asprojectId (project_id in Python):
X-Raindrop-Project-Id header on every event. Omit it (or pass "default") to use your org’s default Production project, which is the existing behavior. Single-project orgs need nothing new.
Multiple projects in one process
Available inraindrop-ai>=0.0.56. When one service wraps several Azure OpenAI
clients that should report to different projects, create one
RaindropAzureOpenAI wrapper per project. Each wrapper owns its own
raindrop.Raindrop client, so the two route independently — there is no shared
module-level state:
raindrop.Raindrop yourself and
pass it via client=:
Flushing and Shutdown
User Identification
Tracking Signals
Factory Function (Backwards-Compatible)
Python
Already using the Vercel AI SDK with Azure? The Vercel AI SDK integration automatically traces Azure OpenAI calls when you use the AI SDK’s Azure provider. This integration is for users calling the Azure OpenAI SDK directly.