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

# AI assistant

> Ask an AI model about shell commands and errors from a sidebar next to your terminal, using your own API key.

The AI assistant is a chat sidebar that opens beside your terminal. Use it to look up commands, explain error messages and get DevOps help. It talks to the AI provider you configure with your own API key.

## Set up a provider

The **AI** button stays hidden in the terminal header until at least one provider has a key.

**1. Open the settings**

Go to **Settings** and find the **AI providers** section.

**2. Paste your API key**

Paste the key into the field for **Anthropic**, **OpenAI** or **Google Gemini**. The key is hidden as you type. Click the eye icon to show it.

**3. Pick a model**

Choose a model from the **Model** list under the key. Each provider has its own list and default.

![Settings AI providers section with an obscured Anthropic key and a Model selector, plus empty OpenAI and Google Gemini fields](https://mintcdn.com/your-ssh/vNM8XA5Zlrh1XSOb/images/16-ai-chat/03-configured.png?fit=max\&auto=format\&n=vNM8XA5Zlrh1XSOb\&q=85\&s=0b4705f52273ffd11edf090f6750a6af)

AI providers in Settings. A saved key shows as configured, and each provider has its own model.

| Provider | Models in the list |
| - | - |
| **Anthropic** | `claude-haiku-4-5-20251001`, `claude-sonnet-4-6`, `claude-opus-4-7` |
| **OpenAI** | `gpt-4o-mini`, `gpt-4o`, `o1-mini` |
| **Google Gemini** | `gemini-2.0-flash`, `gemini-1.5-flash`, `gemini-1.5-pro` |

To remove a key, click the clear button in its field.

### Where keys are stored

API keys are stored in the system credential store (macOS Keychain, Windows Credential Manager), not in a plain settings file. If the store can't be reached, YourSSH shows an error instead of saving the key somewhere less safe. Keys stay on this device. They aren't part of [sync](https://yoursshlabs.com/user-guide/sync.md). See [Settings](https://yoursshlabs.com/user-guide/settings.md) for other preferences.

## Chat in a terminal

**1. Open the sidebar**

In a terminal session, click **AI** in the terminal header. The sidebar titled **AI Assistant** opens on the right.

**2. Choose a provider**

If you configured more than one provider, pick one from the list at the top of the sidebar.

**3. Ask a question**

Type in **Ask a command question…** and press `Enter`. Press `Shift+Enter` for a new line.

![Terminal session with the AI Assistant sidebar on the right, a provider list showing Anthropic and an empty conversation](https://mintcdn.com/your-ssh/vNM8XA5Zlrh1XSOb/images/16-ai-chat/05-provider-menu.png?fit=max\&auto=format\&n=vNM8XA5Zlrh1XSOb\&q=85\&s=45c938b271fa5eba22638ef098ec0a5b)

The AI Assistant sidebar beside a terminal, with the provider list open.

Answers stream in and are formatted as Markdown, with code blocks for commands. The sidebar header has buttons to clear the chat and to close it.

![AI Assistant sidebar with a multi-line prompt typed in the input box](https://mintcdn.com/your-ssh/vNM8XA5Zlrh1XSOb/images/16-ai-chat/06-multiline-prompt.png?fit=max\&auto=format\&n=vNM8XA5Zlrh1XSOb\&q=85\&s=188595eeaa7971cab661efdfa86ead4b)

Shift+Enter adds a new line. Enter sends the message.

## What is sent to the provider

* Your messages and the earlier messages of the current conversation.
* A short fixed instruction that tells the model to act as an SSH command assistant.

YourSSH does not send your terminal output, files or host details on its own. The assistant can't run commands on your host. If you want it to look at an error, paste the text into the chat. Don't paste secrets.

Your messages go to the provider you selected, under that provider's terms. Clearing the chat removes the conversation from the sidebar.

## Tips

* Paste an error and ask what it means.
* Ask for a command, then review it before you run it. Use [snippets](https://yoursshlabs.com/user-guide/snippets.md) to keep the ones you reuse.
* Switch provider from the sidebar to compare answers.

## Related pages

> [card] [Settings](https://yoursshlabs.com/user-guide/settings.md)
>
> Credential storage and other preferences.

> [card] [Terminal](https://yoursshlabs.com/user-guide/terminal.md)
>
> The terminal header and sessions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.