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

# Integrate via Langtail SDK

If you want to give Langtail a try but you're not 100% sure that you want to use [the full Langtail workflow](/getting-started/quickstart), using the using the OpenAI Proxy via the SDK is a great way to get started. Follow these steps to get up and running:

<Steps>
  <Step title="Generate a project API key">
    <video controls className="w-full aspect-video" src="https://mintcdn.com/langtail-64/21vrq2LQuE9wZl3n/images/proxy/create-api-key.mp4?fit=max&auto=format&n=21vrq2LQuE9wZl3n&q=85&s=6497dbec595cba6e286a75f916a1c7d2" data-path="images/proxy/create-api-key.mp4" />

    1. In Langtail, open an existing project or create a new one.
    2. In the left sidebar, click *Secrets*.
    3. Click *New API Key*, optionally set a name and a budget limit, then click *Create*.
    4. Copy the key.
  </Step>

  <Step title="Install the SDK">
    Install the Langtail SDK in your project (using NPM or your package manager of choice):

    ```bash theme={null}
    npm add langtail
    ```
  </Step>

  <Step title="Modify your code to use the SDK">
    1. Add your Langtail project API key to an environment variable. In the following snippets, we use `LANGTAIL_API_KEY`.
    2. In your codebase, paste this snippet:

    ```javascript theme={null}
    import { Langtail } from "langtail"

    const lt = new Langtail({
      apiKey: process.env.LANGTAIL_API_KEY,
    })

    const rawCompletion = await lt.chat.completions.create({
      // Required
      messages: [{ role: "system", content: "You are a helpful assistant." }],
      model: "gpt-3.5-turbo",
      // Optional:
      // All OpenAI fields (temperature, top_p, tools,...)
      doNotRecord: false, // false will ensure logs do not contain any info about payloads
      metadata: {
        "custom-field": 1,
      },
    })
    ```
  </Step>

  <Step title="Test it out">
    Run your app and make a request to verify that everything works properly.
  </Step>

  <Step title="Observe metrics and logs">
    <video controls className="w-full aspect-video" src="https://mintcdn.com/langtail-64/ca3hBu6aHdxqHnlL/images/proxy/view-logs.mp4?fit=max&auto=format&n=ca3hBu6aHdxqHnlL&q=85&s=a6488c1520adfb0943e04094d340623d" data-path="images/proxy/view-logs.mp4" />

    1. Back in Langtail, navigate to the project and then click *Logs* in the left sidebar.
    2. You should see log entries coming from your app (they have an environment value of "proxy").
    3. Click on a log to see detailed information about the request and response from OpenAI.
    4. If you want to experiment with this prompt, click *Open in Playground*. Here you can change parameters and modify different parts of the prompt and then see the result.
  </Step>
</Steps>
