How to Get an X (Twitter) API Key in 2026: Pricing, Setup, and Safer Options
The way to get an X API key changed in 2026. New developers pay per use, start from console.x.com, and credentials display exactly once. This guide explains how to get X API key access step by step, the real pay-per-use...
The way to get an X API key changed in 2026. New developers pay per use, start from console.x.com, and credentials display exactly once. This guide explains how to get X API key access step by step, the real pay-per-use pricing, and when an alternative approach is smarter. It also covers console tips, common pitfalls, and a quick decision path if posting and scheduling is the only goal.
What changed before starting
In 2026, X retired free and preset tiers for new developer accounts. New signups use pay-per-use pricing by default, with all requests billed against a prepaid credit balance. Basic and Pro plans for new signups were removed around June 2026, and migrations for existing subscribers have been completed. There is no meaningful trial for new developers, so a payment method and credits are required before the first API call.
Onboarding moved to console.x.com. Sign in with the same X account used daily, since there is no separate developer login. Expect a short consent flow: verify email, accept the X Developer Agreement and Policy, and proceed. Most first-time approvals complete in several minutes, often in about 6 to 9 minutes, and there is no long manual review for standard access. Automation rules still apply. Automating likes, follows, or unsolicited outreach is not allowed, but posting to an owned account is permitted when configured correctly.
Credits must be purchased before any request is made. All API usage, including both reads and writes, deducts from the prepaid balance. Credentials are shown only once during app creation, which changes how teams should capture and store keys. Plan to copy and vault them immediately, since a regeneration permanently invalidates previous keys.
Step-by-step: keys and first call
The console.x.com onboarding is direct once payment is set. Use this flow to get X API key credentials and post a first tweet successfully:
Sign in at console.x.com with the X account that will own the app. Confirm a verified email. Add a phone number if the app will post on behalf of a user account.
Open the Developer Console and accept the Developer Agreement and Policy.
Click New App, then provide an app name and a short description of the use case.
When credentials appear, copy them immediately. The console shows the API key, API key secret, and initial access tokens exactly once. Store them as environment variables or in a secrets manager, not in source code. Regenerating any secret invalidates the old value everywhere.
In App settings, set Permissions to Read and Write if posting is required. Add a valid callback URL for OAuth 2.0.
Implement OAuth 2.0 user authorization. Posting requires a user-context access token. App-only bearer tokens post nothing and will trigger a 403.
Buy credits in Billing -> Credits so the first request can be billed.
First call example: POST https://api.x.com/2/tweets with Authorization: Bearer and JSON payload {"text":"Hello."}. A 201 response confirms success. A 403 typically means the app lacks Write permission or the token lacks user context.
Plan for OAuth 2.0 token refresh. User tokens expire after about two hours, so build a refresh flow and store the refreshed token securely.
Pay-per-use pricing explained
There is no flat monthly plan for new developers in 2026. X API key pricing is pay-per-use by action type, deducted from a prepaid credit balance. Pricing can change, so treat the following as current reference points for July 2026 and verify in the console's cost calculator.
API action
Approx unit price
Example monthly cost
Post plain text tweet
~$0.016 per post
150 posts (5/day) => ~
.40
Post with a link
~$0.19 per post
150 posts => ~8.50
Standard read request
~$0.0045 per request
5,000 reads => ~2.50
Two cost details are frequently missed. First, reads that fetch data from your own account footprint are cheaper. Owned reads often price near $0.0011 per post-level fetch. Second, deduplication within 24 hours reduces double-billing when the same payload is retried, but it does not turn errors into free usage. Budget for link posts separately, since URL attachments raise the per-post fee compared to plain text.
Real-world examples clarify totals. A lightweight bot publishing 5 plain tweets a day lands near .40 per month, while the same cadence with links runs roughly 8 to $32. Heavy read workloads, such as search or timelines at scale, dominate spend. Watch the console balance and set low-balance alerts so posting does not fail silently.
Console tips, pitfalls, and options
There are a few habits that save time and money when working in the Developer Console.
Store credentials the moment they are revealed. They display once. Use a secrets manager and environment variables.
Regenerating keys or tokens invalidates prior values immediately. Update every environment in lockstep to avoid downtime.
Tokens inherit the app's permissions at issuance. If permissions are changed later, issue new tokens. Old tokens can fail for writes without a clear error hint.
Budget specifically for link posts. A single URL materially increases per-post fees compared with plain text.
Owned reads are cheaper. If the workload is primarily analytics on your own posts, route to owned-read endpoints when possible.
Expect OAuth 2.0 token refresh. User tokens last about two hours. Implement refresh and secure storage, and never hardcode secrets.
App-only bearer tokens cannot post. Trying to write with them returns 403. Always use a user-context token for publishing.
Pay before calling the API. The first request fails if no credits are available.
Do you actually need one?
Not every project needs direct API access. If the only goal is to post and schedule tweets programmatically, an OpenTweet alternative removes developer onboarding and per-call pricing.
For founders, brands, and creators who care about posting, scheduling, and building an audience, a growth platform is more effective than custom code. BeeReach https://beereach.io provides safe, human-like engagement, quality targeting through Radar Filtering, and a full client portal with a Content Scheduler and Smart Automation Rules. It handles smart following, contextual commenting, likes, and DMs within platform rules, without developers writing OAuth flows. Plans start at $39 per month.
Related guides to explore next:
OAuth 2.0 token refresh patterns and secure storage
Cost modeling with pay-per-use pricing and rate planning
Posting safely on X with automation rules that allow owned actions
FAQ
Is the X API free in 2026?
No. For new developers there is no free tier. Only approved public-utility apps receive sponsored access, and all other usage is pay-per-use with prepaid credits.
Why are posts failing with 403 even though credentials exist?
Posting requires a user-context token with Write permission. Common causes include using an app-only bearer token, missing Write in the app's permission set, an invalid callback URL leading to a bad OAuth flow, or an expired token that needs refresh.
What happens if keys are lost or rotated?
Credentials are shown once during creation. Regenerating a key or token immediately disables the previous values, so every server, worker, and CI secret must be updated before requests resume. The billing balance is unaffected by rotation, but any environment using old values will fail until updated.