SDK

Installation

Installation and Setup for the Nora Observability Python SDK

Installation and Setup

Installation

pip install nora-ai

Basic Initialization

import nora

nora_client = nora.init(api_key="your-nora-api-key")

All LLM API calls are automatically tracked after initialization.

Full Configuration

import nora

nora_client = nora.init(
    api_key="your-nora-api-key",
    environment="production",
    thread_id="session-123",
    user_id="user-456",
    batch_size=10,
    flush_interval=5.0
)

api_keyrequired

Type: str

Nora service authentication key

environmentoptional

Type: str

Deployment environment identifier

thread_idoptional

Type: str

Session identifier for grouping traces

user_idoptional

Type: str

User identifier for per-user tracking

batch_sizeoptional

Type: int

Number of traces before transmission

flush_intervaloptional

Type: float

Seconds between automatic transmissions

Automatic Tracking

After initialization, the following are tracked automatically:

  • LLM API calls from OpenAI, Anthropic, and Gemini

  • Function calling and tool use

  • Token usage and costs

  • Response times

Streaming responses require a trace group context due to SSE characteristics. The trace group ensures the full stream is captured before tracking completes.

Was this page helpful?