You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,8 @@ Developed with the help of [SGPT](https://github.com/tbckr/sgpt).
20
20
This is a Go implementation. For the original Python implementation,
21
21
visit [shell-gpt](https://github.com/TheR1D/shell_gpt). Please keep this in mind when reporting issues.
22
22
23
-
Note: Currently under heavy refactoring for v3, but v2 is still maintained.
23
+
> [!NOTE]
24
+
> Currently under heavy refactoring for v3, but v2 is still maintained.
24
25
25
26
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
26
27
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -68,6 +69,8 @@ Note: Currently under heavy refactoring for v3, but v2 is still maintained.
68
69
results, benefiting from the powerful language model.
69
70
-**Bash Functions and Aliases:** Seamlessly integrate SGPT responses into custom bash functions and aliases, optimizing
70
71
your workflows and making your daily tasks more efficient.
72
+
-**OpenRouter Support:** Use [OpenRouter](https://openrouter.ai) to access various large language models (LLMs) via a
73
+
single API, providing flexibility and convenience in your interactions with different models.
71
74
72
75
By offering these versatile features, SGPT serves as a powerful tool to enhance your overall productivity, streamline
73
76
your workflow, and simplify complex tasks.
@@ -183,7 +186,8 @@ To use the OpenAI API, you must first obtain an API key.
183
186
After completing these steps, you'll have an OpenAI API key that can be used to interact with the OpenAI models through
184
187
the SGPT tool.
185
188
186
-
**Note:** Your API key is sensitive information. Do not share it with anyone.
189
+
> [!IMPORTANT]
190
+
> Your API key is sensitive information. Do not share it with anyone.
187
191
188
192
### Querying OpenAI Models
189
193
@@ -263,6 +267,39 @@ There are three "r"s in the word "strawberry".
263
267
264
268
**Important:** The o1 API does not support personas.
265
269
270
+
### OpenRouter API Support
271
+
272
+
SGPT seamlessly integrates with the [OpenRouter API](https://openrouter.ai), giving you access to a wide range of AI
2. Create an API key at [OpenRouter](https://openrouter.ai/settings/keys) and set it as your environment variable:
281
+
```shell
282
+
export OPENAI_API_KEY="your_openrouter_api_key"
283
+
```
284
+
285
+
Once configured, you can specify any OpenRouter-supported model with the `-m` flag:
286
+
287
+
```shell
288
+
$ sgpt -m "anthropic/claude-3.7-sonnet""mass of sun"
289
+
The mass of the Sun is approximately:
290
+
291
+
1.989 × 10^30 kilograms (kg)
292
+
293
+
This is roughly 333,000 times the mass of Earth. The Sun contains about 99.86% of all the mass in our solar system.
294
+
```
295
+
296
+
Browse the complete list of available models on the [OpenRouter models page](https://openrouter.ai/models).
297
+
298
+
> [!TIP]
299
+
> Under [Integrations](https://openrouter.ai/settings/integrations) in your OpenRouter account, you can link your
300
+
> existing OpenAI API key. This allows you to use any remaining OpenAI credits when accessing OpenAI models through
301
+
> OpenRouter.
302
+
266
303
### Chat Capabilities
267
304
268
305
SGPT provides chat functionality that enables interactive conversations with OpenAI models. You can use the `--chat`
SGPT seamlessly integrates with the [OpenRouter API](https://openrouter.ai), giving you access to a wide range of AI
2. Create an API key at [OpenRouter](https://openrouter.ai/settings/keys) and set it as your environment variable:
14
+
```shell
15
+
export OPENAI_API_KEY="your_openrouter_api_key"
16
+
```
17
+
18
+
## Usage
19
+
20
+
Once configured, you can specify any OpenRouter-supported model with the `-m` flag:
21
+
22
+
```shell
23
+
$ sgpt -m "anthropic/claude-3.7-sonnet""mass of sun"
24
+
The mass of the Sun is approximately:
25
+
26
+
1.989 × 10^30 kilograms (kg)
27
+
28
+
This is roughly 333,000 times the mass of Earth. The Sun contains about 99.86% of all the mass in our solar system.
29
+
```
30
+
31
+
Browse the complete list of available models on the [OpenRouter models page](https://openrouter.ai/models).
32
+
33
+
> [!TIP]
34
+
> Under [Integrations](https://openrouter.ai/settings/integrations) in your OpenRouter account, you can link your
35
+
> existing OpenAI API key. This allows you to use any remaining OpenAI credits when accessing OpenAI models through
0 commit comments