X accounts for AI apps
Save one or many X accounts in the dashboard so Claude, ChatGPT and other MCP apps can post, reply, like and send DMs with them. Add accounts one by one or in bulk, pick the default, choose an account per prompt and fix broken sessions.
Apps connected to the hosted MCP server read public X data. To let them act on X, save your X accounts in the dashboard under Connected apps. You can save up to 200 accounts and pick, in each prompt, which one acts.
This page covers apps that sign in with your TwittrAPI account: Claude.ai, Claude Desktop, ChatGPT and other OAuth apps. Claude Code, Cursor and VS Code can also send one session per connection in headers instead, see Headers.
What you need per account
| What | Where to get it | |
|---|---|---|
| Cookie | The session of a browser logged in to x.com with that account | Copy the cookie, or export it with the Cookie-Editor extension |
| Proxy | The proxy requests to X go out through | Your proxy provider. http://user:pass@host:port and host:port:user:pass both work |
| Chat passcode | Optional, only for DMs | The 4-digit X Chat passcode of that account |
Use one proxy per account where you can, ideally in the country the account usually logs in from. Several accounts on one proxy work, but X is more likely to ask them to log in again.
Add one account
- Open Connected apps in the dashboard and click Add X account.
- Stay on One account. Paste the cookie (a cookie header or the Cookie-Editor JSON export), enter the proxy and, for DMs, the chat passcode.
- Click Save and check.
The account then shows up with its @handle, profile picture and status. Saving the same X account again replaces its old session, so a fresh cookie after a logout goes in the same way.
Add many accounts at once
Click Add X accounts and choose Bulk import. Paste text or drop files; you can mix both.
One account per line. Cookie, proxy and passcode separated by |. Proxy and passcode are optional:
auth_token=…; ct0=…; twid=u%3D… | http://user:pass@1.2.3.4:8080 | 1234
auth_token=…; ct0=…; twid=u%3D… | 5.6.7.8:3128:user:pass
auth_token=…; ct0=…; twid=u%3D…A CSV file with a header row. Either a cookie column, or the cookie values in their own columns:
cookie,proxy,passcode
"auth_token=…; ct0=…; twid=u%3D…",http://user:pass@1.2.3.4:8080,1234auth_token,ct0,twid,proxy
a1b2…,c3d4…,u%3D123…,http://user:pass@1.2.3.4:8080Cookie-Editor JSON files. Export the cookies of x.com with Cookie-Editor (Export > JSON) once per account, save each export as a file and drop all files at once. One file is one account. A JSON file with a list of such exports, or a list of {"cookie", "proxy", "passcode"} objects, works too.
Then:
- For lines and files without a proxy, enter a Proxy for all without one. A Chat passcode for all works the same way.
- Check the preview. Every line shows the X user ID, the proxy host and whether DMs are on. Lines with a problem are marked red with the reason: the cookie lacks
auth_tokenorct0, there is no proxy, or the same X account appears twice (the later one is used). - Click Import. The dialog saves the accounts and checks each one; you see the result per account as it comes in.
One import takes up to 100 accounts. Lines with a problem are skipped, the rest are saved.
The default account
The first account you save is the default. Apps use it whenever you do not say which account should act. Make default next to another account changes it. When you delete the default, your oldest remaining account takes over.
Pick the account in your prompt
Name the account in plain words:
Post "We're live 🎉" from @acme.
Reply to this tweet from @acme_support: "Thanks, we're on it."
Send a DM from @acme_support to @jane: "Your refund is on its way."
With more than one saved account, the assistant sees your accounts by @handle and every account tool takes an account argument (an @handle or the numeric user ID, in any case). It can also call list_x_accounts, which lists your accounts, the default and which ones have DMs, at no cost. When it is unclear which account you mean, a good assistant asks.
If the assistant names an account that is not saved, the tool answers with the list of saved accounts instead of acting. DM tools need the chat passcode of the account that sends; without one they say so.
Status and what to do
Every account is checked when you save it, when you click Check (or Check all), and every time an app uses it. A check is one read call on your balance.
| Status | Meaning | What to do |
|---|---|---|
| Works | X accepted the session. | Nothing. |
| Logged out | X rejected the cookie: logged out, expired, or the account is locked. | Log in to x.com with that account, copy a fresh cookie and add it again. |
| Proxy fails | The proxy did not connect. | Check host, port, user and password with your proxy provider, then add the account again with the fixed proxy. |
| Not unlocked | Account actions are not unlocked for your TwittrAPI account yet. | They work after your first top-up. |
| No balance | Your balance is used up, so it could not be checked. | Top up, then click Check. |
| Not checked | The check got no answer. | Click Check again in a minute. |
A red edge marks broken accounts in the list, so after a bulk import you see at a glance which ones to fix.
Give apps access
An app only gets your saved accounts when you tick Also act on my X account on the TwittrAPI consent page while connecting it. It then gets all of them, and new accounts you add later are available to it within a minute. Apps connected without the box only read; remove the connector in the app and add it again to tick it.
Apps like Claude and ChatGPT ask you before each action that posts or changes something, so you see the account and the text before it goes out.
Delete and safety
- Delete next to an account removes its session at once; apps can no longer act with it.
- Sessions are stored encrypted and are never shown again, not even to you. The assistant never sees cookies or proxies, only @handles.
- Anyone with a cookie can use that X account. Only paste cookies into the dashboard and apps you control.
- Disconnect on the same page ends an app's access to all accounts.
Cost
Every action is one API call at the normal price, $0.10 per 1,000 calls on Standard, the same as a read. Saving and checking an account is one read call each. Saved accounts cost nothing.