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

# LiteLLM

> Using Nebius Token Factory models with LiteLLM

LiteLLM supports calling 100+ LLMs using the OpenAI Input/Output Format.

[LiteLLM documentation ](https://docs.litellm.ai/)  \
[LiteLLM + Nebius Token Factory documentation](https://docs.litellm.ai/docs/providers/nebius)

## Prerequisites

1. [Create an API key](https://tokenfactory.nebius.com/project/api-keys) to authorize requests to Nebius Token Factory.
2. Save the API key into a `NEBIUS_API_KEY` environment variable:

   ```
   export NEBIUS_API_KEY="<API_key>"
   ```
3. Install the `litellm` package:

   ```
   pip install litellm
   ```

## Create a chat completion

Paste the following code into your script:

```python theme={null}
from litellm import completion

response = completion(
    model="nebius/meta-llama/Llama-3.3-70B-Instruct",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of Netherlands?",
        }
    ],
    temperature=0.1,
)

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

<Info>
  Checkout an [example notebook](https://github.com/nebius/token-factory-cookbook/blob/main/api/api_litellm.ipynb) in our cookbook repository.
</Info>
