File size: 2,382 Bytes
886d8e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
title: OpenRouter
---

To use Open Interpreter with a model from OpenRouter, set the `model` flag to begin with `openrouter/`:

<CodeGroup>

```bash Terminal
interpreter --model openrouter/openai/gpt-3.5-turbo
```

```python Python
from interpreter import interpreter

interpreter.llm.model = "openrouter/openai/gpt-3.5-turbo"
interpreter.chat()
```

</CodeGroup>

# Supported Models

We support any model on [OpenRouter's models page:](https://openrouter.ai/models)

<CodeGroup>

```bash Terminal
interpreter --model openrouter/openai/gpt-3.5-turbo
interpreter --model openrouter/openai/gpt-3.5-turbo-16k
interpreter --model openrouter/openai/gpt-4
interpreter --model openrouter/openai/gpt-4-32k
interpreter --model openrouter/anthropic/claude-2
interpreter --model openrouter/anthropic/claude-instant-v1
interpreter --model openrouter/google/palm-2-chat-bison
interpreter --model openrouter/google/palm-2-codechat-bison
interpreter --model openrouter/meta-llama/llama-2-13b-chat
interpreter --model openrouter/meta-llama/llama-2-70b-chat
```

```python Python
interpreter.llm.model = "openrouter/openai/gpt-3.5-turbo"
interpreter.llm.model = "openrouter/openai/gpt-3.5-turbo-16k"
interpreter.llm.model = "openrouter/openai/gpt-4"
interpreter.llm.model = "openrouter/openai/gpt-4-32k"
interpreter.llm.model = "openrouter/anthropic/claude-2"
interpreter.llm.model = "openrouter/anthropic/claude-instant-v1"
interpreter.llm.model = "openrouter/google/palm-2-chat-bison"
interpreter.llm.model = "openrouter/google/palm-2-codechat-bison"
interpreter.llm.model = "openrouter/meta-llama/llama-2-13b-chat"
interpreter.llm.model = "openrouter/meta-llama/llama-2-70b-chat"
```

</CodeGroup>

# Required Environment Variables

Set the following environment variables [(click here to learn how)](https://chat.openai.com/share/1062cdd8-62a1-4aa8-8ec9-eca45645971a) to use these models.

| Environment Variable  | Description  | Where to Find  |
| --------------------- | ------------ | -------------- |
| `OPENROUTER_API_KEY`       | The API key for authenticating to OpenRouter's services. | [OpenRouter Account Page](https://openrouter.ai/keys) |
| `OR_SITE_URL`      | The site URL for OpenRouter's services. | [OpenRouter Account Page](https://openrouter.ai/keys) |
| `OR_APP_NAME`   | The app name for OpenRouter's services. | [OpenRouter Account Page](https://openrouter.ai/keys) |