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

# Provider SDK Integration

> Wrap your existing AI provider SDK clients to automatically trace all LLM calls and optionally cache similar prompts with semantic caching

<Info>
  Prefer a unified API? Check out the [Vercel AI SDK](/vercel-ai/overview)
  integration for multi-provider support.
</Info>

## How It Works

Observ wraps your provider SDK clients with a transparent proxy that:

1. **Traces** all LLM calls with detailed metrics
2. **Caches** similar prompts when `recall: true` is enabled
3. **Preserves** the exact same API - no code changes needed

## Supported Providers

<CardGroup cols={2}>
  <Card title="Anthropic" icon="message-square">
    **Claude Sonnet 4.5, Claude Opus**

    TypeScript and Python support
  </Card>

  <Card title="OpenAI" icon="openai">
    **GPT-4, GPT-3.5, and all models**

    TypeScript and Python support
  </Card>

  <Card title="Mistral" icon="sparkles">
    **Mistral Large, Medium, Small**

    TypeScript and Python support
  </Card>

  <Card title="Google" icon="brain">
    **Gemini 1.5 Pro, Flash**

    Python only
  </Card>

  <Card title="xAI" icon="x">
    **Grok models**

    TypeScript and Python support
  </Card>

  <Card title="OpenRouter" icon="route">
    **Access to 100+ models**

    TypeScript and Python support
  </Card>
</CardGroup>

## Quick Example

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import Anthropic from "@anthropic-ai/sdk";
    import Observ from "observ-sdk";

    const ob = new Observ({
      apiKey: "your-observ-api-key",
      recall: true, // Enable semantic caching
    });

    const client = new Anthropic({ apiKey: "your-anthropic-key" });
    const wrappedClient = ob.anthropic(client);

    // Use it exactly as you would normally
    const response = await wrappedClient.messages.create({
      model: "claude-sonnet-4-20250514",
      max_tokens: 1024,
      messages: [{ role: "user", content: "Hello!" }],
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import anthropic
    from observ import Observ

    ob = Observ(
        api_key="your-observ-api-key",
        recall=True,  # Enable semantic caching
    )

    client = anthropic.Anthropic(api_key="your-anthropic-key")
    wrapped_client = ob.anthropic(client)

    # Use it exactly as you would normally
    response = wrapped_client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1024,
        messages=[{"role": "user", "content": "Hello!"}],
    )
    ```
  </Tab>
</Tabs>

## Benefits

* **Drop-in replacement** - Wrap your existing client and use it normally
* **Zero code changes** - Same API, enhanced with observability
* **Automatic tracing** - All calls tracked in your Observ dashboard
* **Semantic caching** - Reduce costs with intelligent prompt caching
* **Session tracking** - Group related calls with session IDs
* **Custom metadata** - Attach debugging context to traces

## Next Steps

<Steps>
  <Step title="Get API Key">
    Create an account and get your API key from [Settings → API
    Keys](https://observ.dev/settings/api-keys)
  </Step>

  <Step title="Install SDK">
    Follow the [installation guide](/provider-sdks/installation) for your
    language and provider
  </Step>

  <Step title="Wrap your client">
    Learn how to use the SDK in the [usage guide](/provider-sdks/usage)
  </Step>
</Steps>

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/provider-sdks/installation">
    Install for TypeScript or Python
  </Card>

  <Card title="Usage Guide" icon="book" href="/provider-sdks/usage">
    Detailed usage with examples
  </Card>

  <Card title="Configuration" icon="gear" href="/provider-sdks/configuration">
    Configuration options reference
  </Card>

  <Card title="Vercel AI SDK" icon="zap" href="/vercel-ai/overview">
    Alternative: Unified multi-provider API
  </Card>
</CardGroup>
