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

# Integrate

> Collect data from your AI application for evaluation and training

Production LLM traffic serves as the backbone for model optimization in Catalyst. Catalyst Gateway records LLM traffic between your application and your current LLM provider, and stores it for later evaluation and training.

There are two ways to capture production LLM traffic through Gateway: use the [Inference CLI](/cli/overview) to automatically instrument your codebase, or wire it up manually.

To get started with Catalyst, create a free account at [inference.net](https://inference.net/register).

## Choose a setup path

Installing with AI is quickest. Use the manual flow if you want to review each change yourself.

<Tabs>
  <Tab title="Install with AI">
    Use the [Inference CLI](/cli/overview) to automatically initialize  a coding agent like [Claude Code](https://code.claude.com/docs/en/overview) to scan your codebase, update your LLM clients, and add required request metadata.

    <Steps>
      <Step title="Install the CLI and authenticate">
        Install the Inference CLI globally and log in. Your browser will open to authenticate.

        <Metadata text="get-started/record-first-call-ai-auth" />

        ```bash theme={"system"}
        npm install -g @inference/cli && inf auth login
        ```
      </Step>

      <Step title="Run instrumentation in your project">
        Navigate to your project root and run instrumentation.

        <Metadata text="get-started/record-first-call-ai-instrument" />

        ```bash theme={"system"}
        cd /path/to/your/project && inf instrument
        ```

        The command guides you through the following workflow:

        * Select a coding agent to use: Claude Code, OpenCode, or Codex.
        * Scan your codebase for LLM clients such as OpenAI, Anthropic, LangChain,etc
        * Redirect base URLs to the gateway
        * Add routing headers so requests are authenticated, forwarded, and traced
        * Add task IDs so each call site is grouped automatically in the dashboard
        * Review the generated changes before applying them

        <Tip>
          Run `inf instrument --dry-run` to preview changes without modifying any files.
        </Tip>
      </Step>

      <Step title="Run your app">
        Run your application how you normally would to produce inference requests. Requests from your application are now routed through the gateway and will appear in the dashboard.
      </Step>

      <Step title="View your results">
        Open the [dashboard](https://inference.net/dashboard) to see request details, traces, and analytics.
      </Step>
    </Steps>

    <Note>
      Want the full canonical guide for this workflow? See [Install with AI](/integrations/install-with-ai).
    </Note>
  </Tab>

  <Tab title="Install manually">
    Use this path if you want to review each change yourself. The example below uses OpenAI. For Anthropic, Cerebras, Groq, and other providers, see the [Integrations guide](/integrations/overview).

    <Steps>
      <Step title="Get your API keys">
        You need two keys:

        * **Inference Catalyst project API key** — from your [dashboard](https://inference.net/dashboard) under **API Keys**
        * **OpenAI API key** — from your [OpenAI account](https://platform.openai.com/api-keys)

        Set them as environment variables:

        <Metadata text="get-started/record-first-call-manual-env" />

        ```bash theme={"system"}
        export INFERENCE_API_KEY=<your-project-api-key>
        export OPENAI_API_KEY=<your-openai-api-key>
        ```
      </Step>

      <Step title="Update your code">
        Point your SDK at `https://api.inference.net/v1` and use your Catalyst project API key as the SDK's `apiKey`. Your provider's API key goes in the `x-inference-provider-api-key` header so the gateway can forward it. The gateway adds roughly 10ms of latency and forwards your requests to the provider as-is.

        <CodeGroup>
          <Metadata text="get-started/record-first-call-manual-openai" />

          ```typescript TypeScript theme={"system"}
          import OpenAI from "openai";

          const client = new OpenAI({
            baseURL: "https://api.inference.net/v1",
            apiKey: process.env.INFERENCE_API_KEY,
            defaultHeaders: {
              "x-inference-provider-api-key": process.env.OPENAI_API_KEY,
              "x-inference-provider": "openai",
            },
          });

          const response = await client.chat.completions.create({
            model: "gpt-4.1",
            messages: [{ role: "user", content: "Hello, world!" }],
          });

          console.log(response.choices[0].message.content);
          ```

          <Metadata text="get-started/record-first-call-manual-openai" />

          ```python Python theme={"system"}
          import os
          from openai import OpenAI

          client = OpenAI(
              base_url="https://api.inference.net/v1",
              api_key=os.environ["INFERENCE_API_KEY"],
              default_headers={
                  "x-inference-provider-api-key": os.environ["OPENAI_API_KEY"],
                  "x-inference-provider": "openai",
              },
          )

          response = client.chat.completions.create(
              model="gpt-4.1",
              messages=[{"role": "user", "content": "Hello, world!"}],
          )

          print(response.choices[0].message.content)
          ```

          <Metadata text="get-started/record-first-call-manual-openai-curl" />

          ```bash cURL theme={"system"}
          curl https://api.inference.net/v1/chat/completions \
            -H "Authorization: Bearer $INFERENCE_API_KEY" \
            -H "x-inference-provider-api-key: $OPENAI_API_KEY" \
            -H "Content-Type: application/json" \
            -H "x-inference-provider: openai" \
            -d '{
              "model": "gpt-4.1",
              "messages": [{"role": "user", "content": "Hello, world!"}]
            }'
          ```
        </CodeGroup>
      </Step>

      <Step title="Send a request">
        Run the snippet above from your application or terminal. Once the request completes, Catalyst will capture it automatically.
      </Step>

      <Step title="View your results">
        Open the [Inference Catalyst dashboard](https://inference.net/dashboard) to inspect the request, traces, and metrics.
      </Step>
    </Steps>

    <Note>
      Need provider-specific manual instructions? See [Integrations Overview](/integrations/overview).
    </Note>
  </Tab>
</Tabs>

That's it. Every request now flows through Catalyst and gets captured automatically.

## What gets captured

Once traffic is flowing, Catalyst records:

* The full request and response payloads
* Cost per call and aggregate spend
* Latency (end-to-end and time to first token)
* Token counts (input and output)
* Error rates and status codes
* Model and provider

## Where to find your data

* **[Metrics Explorer](/platform/gateway/metrics-explorer)** - dashboards for cost, latency, errors, and usage across all your LLM calls
* **[Inference Viewer](/platform/gateway/inference-viewer)** - browse and filter individual requests and responses

## Next steps

<CardGroup cols={2}>
  <Card title="Connect more providers" icon="plug" href="/integrations/overview">
    Set up Anthropic, Cerebras, Groq, and other providers.
  </Card>

  <Card title="Organize with tasks" icon="bullseye" href="/platform/gateway/tasks">
    Group LLM calls by feature or objective to track metrics separately.
  </Card>

  <Card title="Build a dataset" icon="database" href="/platform/datasets/build-from-traffic">
    Turn captured traffic into datasets for evals and training.
  </Card>

  <Card title="Upload a dataset" icon="upload" href="/platform/datasets/upload-a-dataset">
    Already have data? Upload a JSONL file to start evaluating or training.
  </Card>
</CardGroup>
