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

# How to Trace Your First AI Application

> In about 5 minutes, instrument an OpenAI call with HoneyHive, send your first trace, and inspect the full request and response in the dashboard.

You will instrument an OpenAI LLM call with HoneyHive and view the full request and response in the dashboard in about 5 minutes. This quickstart uses automatic tracing via OpenInference; for production web servers or Lambda, see [tracer initialization](/v2/tracing/tracer-initialization) after you finish.

**Expected time**: 5 minutes

<Steps>
  <Step title="Create a project">
    Go to [HoneyHive Projects](https://app.us.honeyhive.ai/projects) and click **New Project**. Name it `my-first-project`.
  </Step>

  <Step title="Get your API key">
    Go to [**Settings > Project > API Keys**](https://app.us.honeyhive.ai/settings/project/keys) and click **Create API Key**. Copy the key from the modal - it will only be shown once.
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    pip install honeyhive openai openinference-instrumentation-openai
    ```

    Using a different provider? See our [integration guides](/v2/integrations/openai) for Anthropic, Google, AWS Bedrock, and more.
  </Step>

  <Step title="Run this script">
    Create a new file called `quickstart.py` and paste the following code. Replace the placeholder with your HoneyHive API key (API keys are project-scoped).

    ```python theme={null}
    from honeyhive import HoneyHiveTracer
    from openinference.instrumentation.openai import OpenAIInstrumentor
    from openai import OpenAI

    # Initialize HoneyHive tracing
    tracer = HoneyHiveTracer.init(
        api_key="your-honeyhive-api-key",
        source="development",  # Optional: Label where traces come from
        session_name="quickstart-session",  # Optional: Group related traces
        # server_url="https://your-instance.honeyhive.ai"  # Required for self-hosted/dedicated
    )

    # Add the OpenAI instrumentor
    OpenAIInstrumentor().instrument(tracer_provider=tracer.provider)

    # Make a traced OpenAI call
    client = OpenAI()
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "Write a fun haiku about honeybees"}]
    )

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

    <Note>
      This quickstart keeps tracing setup simple: initialize the tracer first, then initialize the instrumentor with `tracer.provider`.
    </Note>

    <Tip>
      To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see [Tracer Initialization](/v2/tracing/tracer-initialization).
    </Tip>

    Run the script:

    ```bash theme={null}
    python quickstart.py
    ```
  </Step>

  <Step title="View your trace">
    Go to the [Traces](https://app.us.honeyhive.ai/traces/sessions) page in HoneyHive. Click on your trace to see the full request and response.

    <Frame>
      <img src="https://mintcdn.com/honeyhiveai/KYET_f7js_xlbTkv/images/quickstart-trace.png?fit=max&auto=format&n=KYET_f7js_xlbTkv&q=85&s=f0e91b431d2bc9748e161a5df6a34ddc" width="2648" height="1664" data-path="images/quickstart-trace.png" />
    </Frame>
  </Step>
</Steps>

## What should you do next?

Now that you're tracing, try the [Experiments Quickstart](/v2/introduction/experiments-quickstart) to run your first evaluation and compare prompt variations.

To understand how HoneyHive structures sessions and events, read [tracing concepts](/v2/tracing/concepts). To trace your own business logic beyond LLM calls, see [custom spans](/v2/tracing/custom-spans).

<CardGroup cols={2}>
  <Card title="Choose runtime setup" icon="route" href="/v2/tracing/tracer-initialization">
    See where to initialize the tracer for Lambda, web servers, and script-style apps.
  </Card>

  <Card title="Add more providers" icon="plug" href="/v2/integrations/openai">
    Trace Anthropic, Google, AWS Bedrock, and more.
  </Card>

  <Card title="Trace custom functions" icon="brackets-curly" href="/v2/tracing/custom-spans">
    Use decorators to trace your own business logic.
  </Card>

  <Card title="Enrich your traces" icon="tags" href="/v2/tracing/enrich-traces">
    Add feedback, metadata, and user information.
  </Card>

  <Card title="Run evaluations" icon="flask" href="/v2/introduction/experiments-quickstart">
    Set up automated evaluations on your traces.
  </Card>
</CardGroup>
