API Credentials for X (Twitter)
Guide to obtaining tokens, keys, and connections.
Connecting to the X API requires completing a series of steps to obtain the necessary keys. Below is a step-by-step guide on how to get them.
Create or open your project
-
1
Go to https://console.x.com and log in with your X account.
-
2
If it's your first time, X shows 'Build with the X API': click the button at the bottom to start. In the 'Create project' window keep the name 'Default Project', write a short description (for example 'Botize automation'), choose 'Making a bot' in 'Use case' and click 'Create'.
-
3
If you already have a developer account, click 'Projects' in the left menu and check that you have a project with the 'Pay Per Use' plan (usually 'Default Project'). Do not click 'Create project' next to 'Ads': it is 'MCP access only' and Botize can't use it. If you already created it, that's fine: your app must be in 'Default Project (Pay Per Use)'.
Create your app
-
1
Click 'Apps' in the left menu and then 'Create App'. Enter a unique name (for example 'botize123'), keep 'Default Project (Pay Per Use)' checked with 'Development', and click 'Create'.
-
2
X shows a 'Consumer Key', a 'Secret Key' and a 'Bearer Token' only once. Copy the 'Consumer Key' (in Botize it is the 'API Key') and the 'Secret Key' (the 'API Secret Key') and keep them in a safe place. You don't need the 'Bearer Token'. Click 'Close'.
-
3
In the 'Apps' list, click the name of the app you just created to open it. At the top, under 'Project access', you should see 'Default Project (Pay Per Use)'. If you only see an 'Ads' project, that app won't work: create another one with 'Create App', keeping 'Default Project (Pay Per Use)' checked.
Configure read and write access
We will configure your API access to allow both reading and writing posts and direct messages. Keep in mind that the X API is not free; it operates on a credit-based system, and you will be charged based on usage.
-
1
In your app, under 'OAuth 2.0 Keys', click 'Set up' next to 'User authentication settings'. If it was already set up, use the 'Settings' button at the top right instead.
-
2
In 'App permissions', select 'Read and write and Direct message'.
-
3
In 'Type of App', select 'Web App, Automated App or Bot'.
-
4
In 'Callback URI / Redirect URL', enter: https://botize.com/callback/twitter.
-
5
In 'Website URL', enter: https://botize.com.
-
6
Click 'Save Changes'. X shows a 'Client ID' and a 'Client Secret' (OAuth 2.0): Botize doesn't use them. Click 'Close'.
Get the 'API Key' and 'API Key Secret' (only if you didn't save them)
-
1
Do this block only if you didn't save the 'Consumer Key' and 'Secret Key' when you created the app. Open your app: it opens on the 'Keys & Tokens' tab. If you are on another tab, such as 'Chat bots', go back to 'Keys & Tokens': Botize doesn't use bots.
-
2
In the 'OAuth 1.0 Keys' section, click the 'Regenerate' button next to 'Consumer Key'.
-
3
X will show your 'API Key' and 'API Key Secret'. Save them in a safe place.
Get the 'Access Token' and 'Access Token Secret'
-
1
On your app's 'Keys & Tokens' tab, in the 'OAuth 1.0 Keys' section, click 'Generate' next to 'Access Token'. Don't use the 'Chat bots' tab or its 'Register chat keys' button: Botize doesn't use bots. It must say 'Read and write and Direct message'; if it says 'Read', go back to the permissions block and save. Careful: the 'OAuth 2.0 Keys' section has another row also called 'Access Token', with a black 'Generate' button. Don't use that one, nor the 'Client ID', 'Client Secret' or 'Bearer Token': Botize doesn't use them.
-
2
X asks 'Regenerate Access Token and Secret' even the first time: click 'Yes, regenerate'. Then it shows your 'Access Token' and 'Access Token Secret' only once. Save them in a safe place and click 'Close'.
-
3
Paste the four values in Botize: 'API Key', 'API Secret Key', 'Access token' and 'Access token secret', and click 'Authorize'.