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

# IBM watsonx.ai

> Connect your IBM watsonx.ai-powered application to Latitude for observability.

## Overview

This guide shows you how to integrate **Latitude Telemetry** into an application that uses **IBM watsonx.ai** (`ibm-watsonx-ai`).

<Check>
  You'll keep calling watsonx.ai exactly as you do today. Telemetry simply
  observes and enriches those calls.
</Check>

<Note>
  Auto-instrumentation for watsonx.ai is available in the **Python** SDK. For other
  languages, send traces via the [OpenTelemetry exporter](/telemetry/otel-exporter).
</Note>

***

## Requirements

* A **Latitude account** and **API key**
* A **Latitude project slug**
* A project that uses the **watsonx.ai SDK** (`ibm-watsonx-ai`)
* watsonx credentials: `WATSONX_API_KEY`, `WATSONX_PROJECT_ID`, and `WATSONX_URL`

***

## Steps

<Steps>
  <Step title="Install">
    <CodeGroup>
      ```bash pip theme={"theme":{"light":"github-light","dark":"github-dark"}}
      pip install latitude-telemetry ibm-watsonx-ai
      ```

      ```bash uv theme={"theme":{"light":"github-light","dark":"github-dark"}}
      uv add latitude-telemetry ibm-watsonx-ai
      ```

      ```bash poetry theme={"theme":{"light":"github-light","dark":"github-dark"}}
      poetry add latitude-telemetry ibm-watsonx-ai
      ```
    </CodeGroup>
  </Step>

  <Step title="Initialize and use">
    ```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import os

    import ibm_watsonx_ai
    from ibm_watsonx_ai.foundation_models import Model
    from ibm_watsonx_ai.metanames import GenTextParamsMetaNames as GenParams

    from latitude_telemetry import Latitude, capture

    latitude = Latitude(
        api_key="your-api-key",
        project="your-project-slug",
        instrumentations={"watsonx": ibm_watsonx_ai},
    )

    def generate_reply():
        model = Model(
            model_id="ibm/granite-13b-chat-v2",
            credentials={
                "url": os.environ.get("WATSONX_URL", "https://us-south.ml.cloud.ibm.com"),
                "apikey": os.environ["WATSONX_API_KEY"],
            },
            project_id=os.environ["WATSONX_PROJECT_ID"],
        )
        return model.generate_text(prompt="Hello", params={GenParams.MAX_NEW_TOKENS: 50})

    capture("generate-reply", generate_reply)

    latitude.shutdown()
    ```
  </Step>
</Steps>

***

## Seeing Your Traces

Once connected, traces appear automatically in Latitude:

1. Open your **project** in the Latitude dashboard
2. Each execution shows input/output messages, model, token usage, latency, and errors
