> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnetra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Netra SDK

> Explore Netra's official Python and TypeScript SDKs. Install netra-sdk to trace AI apps, run evaluations, and query usage data with minimal setup.

Netra provides official SDKs for **Python** and **TypeScript/JavaScript**, enabling you to instrument your AI applications with minimal code changes. Both SDKs share the same core capabilities built on OpenTelemetry.

## Choose Your SDK

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python" href="/sdk-reference/sdk/python">
    Full-featured SDK for Python applications with support for decorators, auto-instrumentation, and context managers.
  </Card>

  <Card title="TypeScript SDK" icon="js" href="/sdk-reference/sdk/typescript">
    Native TypeScript/JavaScript SDK for Node.js applications with full type support and async patterns.
  </Card>
</CardGroup>

## Installation

<CodeGroup>
  ```bash pip theme={null}
  pip install netra-sdk
  ```

  ```bash poetry theme={null}
  poetry add netra-sdk
  ```

  ```bash npm theme={null}
  npm install netra-sdk
  ```

  ```bash yarn theme={null}
  yarn add netra-sdk
  ```
</CodeGroup>

## Quick Start

<CodeGroup>
  ```python Python theme={null}
  from netra import Netra
  from netra.instrumentation.instruments import InstrumentSet

  Netra.init(
      app_name="my-ai-app",
      headers=f"x-api-key={os.getenv('NETRA_API_KEY')}",
      environment="production",
      instruments={InstrumentSet.OPENAI, InstrumentSet.LANGCHAIN},
  )
  ```

  ```typescript TypeScript theme={null}
  import { Netra, NetraInstruments } from "netra-sdk";

  await Netra.init({
    appName: "my-ai-app",
    headers: `x-api-key=${process.env.NETRA_API_KEY}`,
    environment: "production",
    instruments: new Set([NetraInstruments.OPENAI, NetraInstruments.LANGCHAIN]),
  });
  ```
</CodeGroup>

## What You Can Do

<CardGroup cols={2}>
  <Card title="Observability" icon="eye" href="/sdk-reference/sdk/python">
    Auto-instrument LLM providers, frameworks, and databases. Create manual spans with decorators or context managers.
  </Card>

  <Card title="Usage & Traces" icon="chart-line" href="/sdk-reference/usage/python">
    Query token usage, costs, and trace data programmatically. Drill into spans for detailed analysis.
  </Card>

  <Card title="Dashboard Query" icon="table" href="/sdk-reference/dashboard-query/python">
    Build custom analytics queries with flexible metrics, dimensions, and filters. Fetch session summaries and stats.
  </Card>

  <Card title="Evaluation" icon="clipboard-check" href="/sdk-reference/evaluation/python">
    Manage datasets, run test suites, and score AI outputs using built-in or custom evaluators.
  </Card>

  <Card title="Simulation" icon="flask" href="/sdk-reference/simulation/python">
    Run multi-turn conversation simulations to test your AI agents at scale.
  </Card>

  <Card title="Integrations" icon="plug" href="/Integrations/overview">
    Connect with LangChain, LlamaIndex, CrewAI, OpenAI, Anthropic, and many more.
  </Card>
</CardGroup>

## Core Capabilities

| Capability               | Description                                                        |
| ------------------------ | ------------------------------------------------------------------ |
| **Auto-Instrumentation** | Automatic tracing for LLM providers, frameworks, and databases     |
| **Manual Tracing**       | Create custom spans with full control over attributes and events   |
| **Decorators**           | Simple function decoration with `@agent`, `@task`, and `@workflow` |
| **Context Tracking**     | Set user, session, and tenant IDs for filtering and analysis       |
| **Usage Tracking**       | Record token usage, costs, and custom metrics                      |
| **Dashboard Queries**    | Programmatic access to analytics and session data                  |
| **Evaluation**           | Run test suites with datasets and evaluators                       |
| **Simulation**           | Multi-turn conversation testing against your agents                |

## Environment Variables

Configure the SDK via environment variables:

| Variable              | Description                             |
| --------------------- | --------------------------------------- |
| `NETRA_API_KEY`       | API key for authentication              |
| `NETRA_APP_NAME`      | Application name                        |
| `NETRA_ENV`           | Environment (production, staging, etc.) |
| `NETRA_OTLP_ENDPOINT` | Custom OTLP endpoint URL                |
| `NETRA_TRACE_CONTENT` | Enable/disable content tracing          |
| `NETRA_DEBUG`         | Enable debug logging                    |

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="rocket" href="/quick-start/QuickStart_Tracing">
    Follow the step-by-step guide to instrument your first application with Netra.
  </Card>

  <Card title="Auto-Instrumentation" icon="wand-magic-sparkles" href="/Observability/Traces/auto-instrumentation">
    See all supported libraries and frameworks for automatic tracing.
  </Card>

  <Card title="Manual Tracing" icon="pen" href="/Observability/Traces/manual-tracing">
    Learn how to create custom spans for fine-grained control over your traces.
  </Card>

  <Card title="Decorators" icon="at" href="/Observability/Traces/decorators">
    Use @agent, @task, and @workflow decorators to instrument functions with zero boilerplate.
  </Card>
</CardGroup>
