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

# SDK examples

> Call Pareto from Python or TypeScript.

# SDK examples

Set `PARETO_API_KEY` and `PARETO_MODEL` in the server environment. Use a model ID returned by `GET /models`. Do not send the API key to a browser.

<CodeGroup>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["PARETO_API_KEY"],
      base_url="https://api.paretoinference.com/v1",
  )

  response = client.chat.completions.create(
      model=os.environ["PARETO_MODEL"],
      messages=[{"role": "user", "content": "Hello"}],
  )

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

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

  const client = new OpenAI({
    apiKey: process.env.PARETO_API_KEY,
    baseURL: "https://api.paretoinference.com/v1",
  });

  const response = await client.chat.completions.create({
    model: process.env.PARETO_MODEL,
    messages: [{ role: "user", content: "Hello" }],
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

Store the key outside source control. See [Troubleshooting](/errors) if the request returns HTTP 401.
