Skip to main content

Installation

Quick Start

What Gets Traced

  • Chat completions — input messages (user text only), output text, model, token usage (prompt/completion)
  • Finish reasonazure_openai.finish_reason (stop, length, content_filter, tool_calls)
  • Extended tokensai.usage.cached_tokens (prompt cache hits) and ai.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 as projectId (project_id in Python):
This sets the 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 in raindrop-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:
Each wrapper owns its configuration and delivery pipeline, so clients handled by different wrappers route independently. To share a single client across wrappers (or with the module-level API), construct a 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.