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

# Monitor your agents at runtime

> Install the SDK and see your first traces in less than 10 minutes

Install the Flint AI SDK to capture live traces of your agents in production. Within minutes, see what your agents actually do — prompts, responses, models called, and guardrail events.

<Note>
  **Requirements:** Python 3.10 or later

  **Supported with `flintai_sdk.wrap()`:** OpenAI, Anthropic, LangChain (`ChatOpenAI`, `ChatAnthropic`, `ChatGoogleGenerativeAI`), Google GenAI

  **Google ADK:** Use `ADKGuardrailsPlugin` instead of `wrap()` — see [SDK Usage guide](/flintai/platform/sdk/usage)
</Note>

<Steps>
  <Step title="Install the SDK in your agent's environment">
    On your local machine or wherever your agent code runs:

    ```bash theme={null}
    pip install flintai-sdk-py
    ```

    <Accordion title="Optional: Install with provider extras">
      If you need specific provider dependencies:

      ```bash theme={null}
      pip install "flintai-sdk-py[openai]"     # OpenAI
      pip install "flintai-sdk-py[anthropic]"  # Anthropic
      pip install "flintai-sdk-py[genai]"      # Google GenAI
      pip install "flintai-sdk-py[adk]"        # Google ADK
      pip install "flintai-sdk-py[all]"        # All providers
      ```
    </Accordion>
  </Step>

  <Step title="Register your agent and get credentials">
    Log into [Flint AI Platform](https://app.flintai.dev) and register your agent for monitoring:

    1. Navigate to **Agents** and select **Add agents**
    2. Choose **Monitor & protect agents** > **Install SDK**
    3. Enter a name for your agent (for example, "Customer Support Bot")
    4. Select your agent to open its **Sessions** tab

    The setup page shows the values you need:

    * **Gateway URL** - Shown in the code snippet on the Sessions tab

    * **API key** - Use an existing Flint AI API token, or create one now if you don't yet have one. Tokens are managed in **Settings → API Keys**.

    <Note>
      Copy your token immediately when created — it will only be shown once.
    </Note>
  </Step>

  <Step title="Wrap your LLM client in your agent code">
    Import `flintai_sdk` and wrap your existing LLM client.

    <Tip>
      **Using environment variables:** Instead of hardcoding credentials, set `FLINTAI_GATEWAY_URL` and `FLINTAI_API_KEY` as environment variables, then call `flintai_sdk.wrap(client)` without parameters.
    </Tip>

    <Tabs>
      <Tab title="OpenAI">
        ```python theme={null}
        import openai
        import flintai_sdk

        client = openai.OpenAI(api_key="your-openai-api-key")
        client = flintai_sdk.wrap(
            client,
            gateway_url="https://your-gateway-url",
            api_key="your-flintai-api-key",
        )

        response = client.chat.completions.create(
            model="gpt-4",
            messages=[{"role": "user", "content": "Hello"}],
        )
        ```
      </Tab>

      <Tab title="Anthropic">
        ```python theme={null}
        import anthropic
        import flintai_sdk

        client = anthropic.Anthropic(api_key="your-anthropic-api-key")
        client = flintai_sdk.wrap(
            client,
            gateway_url="https://your-gateway-url",
            api_key="your-flintai-api-key",
        )

        message = client.messages.create(
            model="claude-sonnet-4-20250514",
            max_tokens=1024,
            messages=[{"role": "user", "content": "Hello"}],
        )
        ```
      </Tab>

      <Tab title="LangChain">
        ```python theme={null}
        from langchain_openai import ChatOpenAI
        import flintai_sdk

        llm = ChatOpenAI(model="gpt-4", api_key="your-openai-api-key")
        llm = flintai_sdk.wrap(
            llm,
            gateway_url="https://your-gateway-url",
            api_key="your-flintai-api-key",
        )

        response = llm.invoke("Hello")
        ```
      </Tab>

      <Tab title="Google GenAI">
        ```python theme={null}
        import google.genai
        import flintai_sdk

        client = google.genai.Client(api_key="your-gemini-api-key")
        client = flintai_sdk.wrap(
            client,
            gateway_url="https://your-gateway-url",
            api_key="your-flintai-api-key",
            llm_api_key="your-gemini-api-key",  # Required for Google GenAI
        )

        response = client.models.generate_content(
            model="gemini-2.5-flash",
            contents="Hello",
        )
        ```
      </Tab>
    </Tabs>

    <Note>
      **Google ADK:** Use `ADKGuardrailsPlugin` instead of `wrap()` — see the [SDK Usage guide](/flintai/platform/sdk/usage) for details.
    </Note>
  </Step>

  <Step title="Run your agent">
    Run your agent as you normally would. The SDK captures each LLM interaction automatically.
  </Step>

  <Step title="View your traces">
    Back in [Flint AI Platform](https://app.flintai.dev), navigate to **Agents** and select your agent, then open the **Sessions** tab.

    Within moments, you'll see:

    * **Sessions** - Individual agent runs
    * **Traces** - Every LLM call with prompts, responses, model info, and latency
    * **Guardrail events** - Any policy actions (if configured)
  </Step>
</Steps>

<Tip>
  **Add runtime protection:** Pass `policy_id="your-policy-id"` to `flintai_sdk.wrap()` to enforce guardrails. Policies apply input/output detectors that can block, redact, or alert on unsafe content before it reaches users. [Learn more →](/flintai/platform/sdk/configuration)
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="SDK Configuration" icon="sliders" href="/flintai/platform/sdk/configuration">
    Environment variables, credentials, and configuration options
  </Card>

  <Card title="SDK Usage" icon="code" href="/flintai/platform/sdk/usage">
    Examples for all supported providers and frameworks
  </Card>
</CardGroup>
