2. Connect the AI you use
In this chapter: connect one AI you already use to Thegram. ChatGPT and Claude take a few clicks. Claude Code and Codex need an API key and a few terminal commands.
Which AI do you use?
Section titled “Which AI do you use?”| Your AI | How it connects | Where to look |
|---|---|---|
| ChatGPT | Install the plugin and sign in with your Thegram account | ChatGPT |
| Claude | Connect from the Claude Directory and sign in with your Thegram account | Claude |
| Claude Code | Create an API key and connect in the terminal | Claude Code and Codex |
| Codex | Create an API key and connect in the terminal | Claude Code and Codex |
Pick the same AI on the tabs in step 2 of the guide. If you use several, connect them one at a time. Step 2 is done as soon as one is connected.
ChatGPT
Section titled “ChatGPT”- In step 2 of the guide, choose the ChatGPT tab and select Connect in ChatGPT. The Thegram plugin page opens in ChatGPT.
- In ChatGPT, select Install plugin.
- When the Thegram sign-in screen appears, sign in with your Thegram account and approve the storage ChatGPT may use.
- Return to the guide in Thegram. It confirms the connection on its own.

Claude
Section titled “Claude”- In step 2 of the guide, choose the Claude tab and select Open in Claude. The Thegram page opens in the Claude Directory.
- In Claude, select Connect.
- Sign in with your Thegram account and approve the storage Claude may use.
- Return to the guide in Thegram. It confirms the connection on its own.

If the Directory is not available on your Claude plan or in your organization, add a custom connector with this address under Settings → Connectors in Claude and sign in.
https://vault.thegram.one/mcpClaude Code and Codex
Section titled “Claude Code and Codex”A coding agent connects with an API key instead of a sign-in. There are three parts: create the key, keep it on your computer and connect in the terminal.
A. Create an API key
Section titled “A. Create an API key”- In step 2 of the guide, choose the Claude Code or Codex tab and select Create API key. Thegram moves to Settings › AI permissions and opens the key sheet straight away.
- Enter a Name. A name that says where the key is used, such as "My laptop Claude Code", is easier to tell apart later.
- Choose a Lifetime. It starts at 90 days.
- Under Access, choose Set separately, select the storage that should receive records and change it to Edit. It starts at Read. With Read, your AI can look things up but cannot save.
- Select Create.

- On the "Key issued" sheet, select Copy. The key is shown only once, on this sheet.
- Select Back to the guide.

B. Keep the key on your computer
Section titled “B. Keep the key on your computer”Store the key you copied in an environment variable named THEGRAM_API_KEY. Do this yourself, in your own terminal. Do not paste the key into a conversation with an AI, type it after a command or commit it to a repository.
With the default macOS shell (zsh), add one line at the end of the .zshrc file in your home folder and open a new terminal.
export THEGRAM_API_KEY="paste the key here"If you use a secret manager, you can store it there under the same name.
C. Connect in the terminal
Section titled “C. Connect in the terminal”The easiest way is to let the agent follow the canonical installation guide. Send this to Claude Code or Codex.
Connect Thegram by following https://thegram.one/install/agents.mdTo do it yourself, run the commands for your tool in the terminal.
Claude Code:
claude mcp remove --scope user thegram >/dev/null 2>&1 || trueclaude mcp add --scope user --transport http thegram https://vault.thegram.one/mcp --header 'Authorization: Bearer ${THEGRAM_API_KEY}'claude plugin marketplace add thegram-one/thegram-plugin || claude plugin marketplace update thegram-cloudclaude plugin install thegram-cloud@thegram-cloudCodex:
codex mcp remove thegram >/dev/null 2>&1 || truecodex mcp add thegram --url https://vault.thegram.one/mcp --bearer-token-env-var THEGRAM_API_KEYThe commands pass the name THEGRAM_API_KEY, not the key itself, so the key never shows on screen or in a conversation. Codex needs the Thegram skill added separately. The canonical installation guide explains how.
These commands match the canonical installation guide as of 26 November 2026. Commands can change, so check the canonical installation guide before you run them. It also has the commands for OpenCode and OMP.
When you are done, start a new session. Installing does not change a session that is already running.
Check that your AI can write to the storage
Section titled “Check that your AI can write to the storage”Connecting does not let your AI use every storage. A new storage starts with AI access set to None.
- In Thegram, open Settings › AI permissions.
- Select the AI you just connected, or the API key you created.
- Check that the storage that should receive records is set to Edit, and change it if it is not.
With Read only, your AI can look things up but cannot save. The instructions in the next chapter have your AI write records into the storage, so it needs Edit.
How you know it worked
Section titled “How you know it worked”- Step 2 of the guide shows Done, and the line under its title names the connected AI, for example "ChatGPT connected". If you connected with an API key, it reads "1 API keys created".
- In a new conversation or session, ask the question below. The answer names your storage.
Show me the storages I can use in Thegram. Do not create or change anything.If you are stuck
Section titled “If you are stuck”- You came back and it still says "Waiting for the connection". Check that you finished both the sign-in and the approval on the AI's side. If you did, reload the guide.
- Your AI says it cannot see the storage, or access was denied. Go through Check that your AI can write to the storage again.
- The API key is rejected. In Settings › AI permissions, check the key's lifetime and the storages it may reach. If you lost or revoked the key, create a new one. A key value cannot be shown again.
- You use another AI, such as Grok or Muse. Select Connect another AI at the bottom of step 2, or see the canonical installation guide.
- For anything else, see When an AI won't connect.
Next chapter: 3. Give your AI instructions
Sources for this guide
Something different from this guide? Report a docs issue · Troubleshooting
Review and send the email yourself. Do not include API keys or private document content.