Docs / Start
Connected accounts: Codex and Claude Code
If you already pay for ChatGPT or Claude, you can use that subscription in Shard instead of an API key. Shard has two connected-account providers:
- Codex (ChatGPT) uses your ChatGPT account through OpenAI’s Codex.
- Claude Code uses your Claude account through Anthropic’s Claude Code.
You need a Shard account for both. Guests see “Sign in to Shard before connecting Codex.”
How it works#
Shard runs a relay: a service that runs the official Codex or Claude Code agent for you, in a private worker that belongs to your Shard account.
- You connect your ChatGPT or Claude account once, in Settings → AI.
- When you chat, Shard’s server sends your conversation and Shard’s tool list to your worker.
- The agent answers. When it wants to use a tool (for example, read a script), the request comes back to Studio, and Shard runs it there, in your place.
- The result goes back to the agent, and the loop continues until it answers.
Your place’s scripts and objects are only read or changed by Shard inside Studio. The agent sees what the tools return, the same as with any other provider.
What you are paying for#
- The AI usage comes from your subscription. Requests use your ChatGPT or Claude plan’s own usage limits. Shard doesn’t charge credits for them.
- Each request still counts toward your Shard message limit, like any other provider. See Limits and quotas.
- In Chat details, the cost card says “API equivalent” and “Base API rates; not your bill”. That number shows what the same tokens would cost on the public API. It’s for comparison only.
TODO (owner) confirm that using a subscription through Shard’s relay is allowed by OpenAI’s and Anthropic’s current terms, and link to them here.
Connect Codex (ChatGPT)#
- Open Settings → AI and pick Codex (ChatGPT).
- Wait for “Checking connection” to finish. If you are not connected, you see “Connect your ChatGPT account to use Codex.”
- Press Connect ChatGPT.
- Shard shows a web address (
https://auth.openai.com/codex/device) and a code, each in its own box so you can copy them. - Open the address in your browser, sign in to ChatGPT and enter the code.
- Shard shows “Waiting for browser sign-in” and checks by itself. When you’re done, it shows “In use:” and your account’s email.
- Pick a model. The model list comes from your connected account.
Shard never sees your ChatGPT password. You sign in on OpenAI’s own page.
- Changed your mind? Press Cancel login.
- “Login expired. Connect again to get a new code.” means the code timed out. Press Connect ChatGPT again.
- “Sign-in failed. Connect again to retry.” means OpenAI rejected the sign-in. Try again.
- To disconnect, press Disconnect ChatGPT. If it says “Disconnect has not completed”, press Retry disconnect.
Connect Claude Code#
You need Claude Code installed on your own computer and a Claude plan that includes it.
On your computer, open a terminal and run:
claude setup-token- Follow the steps in your browser. Claude Code prints a long token.
- In Shard, open Settings → AI and pick Claude Code.
- Paste the whole token into the box (“Paste the token from
claude setup-token”). No spaces or line breaks. - Press Connect.
When it works, the panel says Connected (unverified). “Unverified” means Shard saved your token but hasn’t tried it yet. Your first message tests it.
- Press Refresh to check the connection again. It shows “Up to date” when done.
- Press Disconnect to remove the connection.
- The models are Claude Sonnet 5.5, Claude Opus 5.5 and Claude Fable 5.1. Which ones work depends on your Claude plan. Each offers Reasoning from low to max.
Your token is stored on Shard’s relay, in the private folder for your account, so Shard can use it when you chat. Treat it like a password: don’t paste it anywhere else, and disconnect if you stop using Shard. See Privacy and data.
Limits of connected accounts#
- Text only. Claude Code in Shard supports text conversations only.
- Two at a time. Shard sends at most two requests at the same time to each connected provider. Extra requests (for example, from agents) wait, showing “Waiting for provider”.
- The relay can be offline. “Codex is offline right now” or “Claude Code is offline right now” means Shard’s relay is down. Try again later, or switch provider.
- Your plan’s limits apply. “Your Claude account has reached a usage limit” comes from Claude, not Shard.
For other error messages, see Troubleshooting.