API ReferenceIntegrations
X (formerly Twitter)
Integrate your Agent with X, one of the world's most viral social apps.
Responding to Mentions
Twitter integration allows your agent to interact with Twitter by responding to mentions.
-
Create a Twitter Developer Account:
- Go to https://developer.twitter.com/
- Sign up for a developer account if you haven't already
- Create a new project and app
- Make sure your "User authentication settings" are set to "Native app" (Public client)
- Copy your OAuth 2.0 application credentials (Client ID and Client Secret)
-
Log in with oauth at https://twitter-auth.upstreet.ai/
- Use the Client ID and Client Secret from step 1
-
Configure your agent:
- Add the following component to your agent:
Additional Notes:
- The bot will automatically listen for and respond to mentions of your Twitter account
- The token should be kept secure and not committed to version control
- You can use
.env.txt
and the useEnv() hook to load it at runtime
- You can use
- The bot polls for new mentions every 10 seconds
- Twitter API rate limits apply - see Twitter's developer documentation for details
- The bot requires a stable internet connection to maintain communication with Twitter
- Note: if you haven't created the agent yet, please follow this Create an Agent first.
Twitter Spaces
The Twitter Spaces integration allows your agent to create and join Twitter Spaces audio rooms.
-
Get your Twitter auth token:
- Log into Twitter in your browser
- Open the browser developer tools (F12)
- Go to the Application/Storage tab
- Find the
auth_token
cookie under Cookies > twitter.com - Copy the value of the
auth_token
cookie
-
Configure your agent:
Additional Notes:
- If no
url
is provided, the bot will create a new Twitter Space - If a
url
is provided, the bot will attempt to join that existing Space - The bot will automatically:
- Create/join the Space
- Request speaking permissions if joining
- Unmute itself when ready
- The token should be kept secure and not committed to version control
- You can use
.env.txt
and the useEnv() hook to load it at runtime
- You can use
- The bot requires a stable internet connection to maintain the Space connection
- Twitter's standard rate limits and Space restrictions apply
- Note: if you haven't created the agent yet, please follow this Create an Agent first.
- If no