Skip to main content
Integrations · X
Guild agents post tweets, send direct messages, search content, manage lists and follows, and stream live tweet data on X. Credentials are stored server-side and injected by Guild’s credential proxy, so agent code never sees the bearer token. Credential policies let you restrict which operations each agent can call before any request reaches X.

Book a demo

See how teams govern agents that use X.

Talk to sales

Get access to Guild, then connect X to your first agent.

What the X integration exposes

The integration gives agents tools that cover posts, direct messages, users, follows, likes, bookmarks, lists, Spaces, streaming, and compliance on the X v2 API. Tools are prefixed with x_openapi_ and imported from XOpenapiTools. Use pick() to give each agent only the tools it needs.

How it works

1

Open credentials in Guild

Go to Access & setup > Credentials in your Guild account or organization. Click Connect, search for x-openapi, and select it.
2

Paste your bearer token

Guild prompts for an API key. Paste your X bearer token; Guild stores it and sends it in the Authorization header on every agent request.
3

Import tools into your agent

Import XOpenapiTools from @guildai-services/guildai~x-openapi and spread it into your agent’s tools object. Use pick() to include only the tools your agent needs.

Why X access needs governing

An unscoped X bearer token can post tweets, send direct messages, block users, and stream live public data. Credential policies let you write ALLOW and DENY rules that Guild’s credential proxy enforces before any request reaches X. You can allow only read operations by restricting to GET methods, block destructive operations such as x_openapi_delete_tweet_by_id, or scope rules to specific agents or workspaces on the same credential. Guild stores the bearer token server-side and injects it after the policy check passes. Agents never see the credential. You can scope a credential to a single agent, a single workspace, or a single member, so a social-posting agent and a compliance-monitoring agent never share the same token or the same access rules. See Credentials and Credential policies for setup details.

About the X integration

Agents can read and write on X using the v2 API, including creating tweets, sending direct messages, searching tweets and Spaces, and managing lists and user relationships. They can also stream live tweet data and retrieve compliance information. Authentication requires a bearer token. The integration is guildai~x-openapi.

Authentication

  • Type: API key
  • Header: Guild sends the key as a bearer token in the Authorization header

Setup

1

Connect X

In Guild, go to Access & setup > Credentials, click Connect, select x-openapi, and paste the key into API Key.
See Credentials for workspace, member, and agent-scoped credentials.

Usage

Selecting specific tools

Tools are named with the x_openapi_ prefix. Use pick() to include only what your agent needs.

Tools

Tools in the latest published version of guildai~x-openapi:

Frequently asked questions

Yes. The x_openapi_get_tweets_firehose_stream tool streams 100% of public tweets, x_openapi_search_stream streams tweets matching the agent’s active rule set, and x_openapi_get_tweets_sample10_stream streams a deterministic 10% sample.
No. The catalog entry for guildai~x-openapi lists no webhook events, so the integration does not receive push notifications from X.
Write a DENY rule on x_openapi_delete_tweet_by_id scoped to the agent that should not delete, and an ALLOW rule scoped to the one that should. Guild’s credential proxy enforces these rules before any request leaves Guild. See Credential policies.
Yes. Connect one bearer token as the account default and connect a second token scoped to a specific workspace. Guild selects the most specific credential first, so the workspace credential takes precedence for agents in that workspace. See Credentials for the full resolution order.

Put a governed agent on X this week

Book a demo

See how teams govern agents that use X.

Talk to sales

Get access to Guild, then connect X to your first agent.
Also runs on Guild: Discord · Email · Gmail · SendGrid Read: Docs: Credential policies · Credentials · Tools in agents
Last modified on November 20, 2026