twitterapi.io :: key-vault v3.7
> load img/key-vault.png|1600x900
A glowing keycard hovering above a wet reflective floor, illuminated cyan, with a server rack receding into shadow on the left.
fig. 00 — credential authentication, conceptual
.ENTRY
$ get x-api-key --help

How to get an X API key _

Two routes resolve to a working key. The official X Developer Platform issues one to an X developer account, billed pay-per-use against a saved payment card. TwitterAPI.io, a third-party X (Twitter) API, issues one on Google sign-in with up to $1 in free credits for new accounts (bot check, one per person or network, expires after 31 days). The second is faster; the first is first-party. The rest of this page covers storage, rotation, and what to do when a key leaks.

author :: alex.chenregion :: globalsection :: developer-access
0x00

[ SYNOPSIS ]

NAME

x-api-key — credential for the X (Twitter) developer ecosystem

FORMAT
ttapi_<28-char-random>
HEADER
curl https://api.twitterapi.io/twitter/user/info \
  -H "X-API-Key: $TWITTERAPI_IO_KEY"
0x04

[ PATH A — TwitterAPI.io ]

EXEC TIME ≈ 5 MIN

> visit  /dashboard
> click  "sign in with google"
> oauth  complete
> read   X-API-Key from the issued key card
> export TWITTERAPI_IO_KEY="ttapi_..."
> curl   https://api.twitterapi.io/twitter/user/info?userName=elonmusk \
            -H "X-API-Key: $TWITTERAPI_IO_KEY"
The free credits (up to $1 for new accounts that pass the bot check, one per person or network, expiring after 31 days) cover an end-to-end test against any endpoint — user lookup, search, followers, real-time stream. No card. No application form. Rotate from the same surface at any time; the previous key dies the moment its replacement issues.
0x08

[ PATH B — X Developer Console ]

EXEC TIME ≈ NO PUBLISHED SLA

> step 1  sign in at console.x.com with the X account that will own the app
> step 2  accept the Developer Agreement and Policy
> step 3  describe how you will use the API
> step 4  New App (inside a project) -> generates the credentials
> step 5  copy API Key + Secret, Bearer Token, Access Token + Secret
> step 6  save a payment card and buy credits (pay-per-use, no subscription)
> rates   post read $0.005 | user read $0.010 | enterprise above 3M reads/mo
> step 7  curl https://api.x.com/2/users/by/username/elonmusk \
            -H "Authorization: Bearer $X_BEARER"
The X Developer Console at console.x.com is the current name and address of what used to be the developer portal at developer.x.com; our X Developer Portal guide walks through each step and the four credential types. Be specific about how you will use the data when you describe the app. Billing is per resource: 100,000 post reads cost $500 and 1 million cost $5,000. Pay-per-use stops at 3 million post reads per monthly billing cycle; above that, X offers Enterprise through an interest form with no public price. Saving a first eligible card and buying credits for the first time adds $20 in credits.
0x0C

[ STORAGE & ROTATION ]

NODE
// .env (gitignored)
TWITTERAPI_IO_KEY=ttapi_...

// usage
const key = process.env.TWITTERAPI_IO_KEY
if (!key) throw new Error("missing TWITTERAPI_IO_KEY")
PYTHON
import os
key = os.environ["TWITTERAPI_IO_KEY"]  # KeyError if absent
ROTATION CADENCE

Schedule a rotation any time the surface around the key changes — a contractor offboards, a build pipeline is replaced, a shared inbox cycles. The Rotate control on the dashboard is single-click and instant; the friction is preparing the dependents to read the new value, not the rotation itself.

0x10

[ ERRATA — HANDLE WITH CARE ]

WARN 01. A key committed to a private repository is still a leaked key. Repository visibility changes; forks proliferate; backups index the same blobs. Rewrite history or rotate — preferably both.

WARN 02. Embedding the key in client-side JavaScript ships it to every visitor. The browser's view-source reveals it; the network panel reveals it; the cached bundle preserves it. A server proxy is the only honest fix.

WARN 03. Screenshots taken for support tickets capture the dashboard verbatim. Crop or redact before sending. The same applies to recorded walkthroughs and live screen-share sessions.

WARN 04. One key reused across personal projects, prototypes, and production multiplies the blast radius. Issue one per service when the cost of doing so is small.

0x14

[ Q & A ]

Q01  Is there a way to get a key without applying?
Yes. Third-party APIs like TwitterAPI.io grant a key on Google sign-in with no application review. TwitterAPI.io gives up to $1 in free credits for new accounts that pass a bot check (one per person or network, expires after 31 days; see /pricing), enough for an end-to-end evaluation. The official X Developer Platform requires an X developer account and, for pay-per-use, a saved payment card.
Q02  How do I get an X API key from the X Developer Portal?
Sign in at console.x.com (the X Developer Console, formerly the developer portal), accept the Developer Agreement and Policy, describe how you will use the API, then click New App. Creating the app generates the API Key and Secret, a Bearer Token and Access Tokens; copy them once, because secrets are not shown again. Reads need credits, so save a payment card and buy credits before the first call.
Q03  What does the official X path require?
An X developer account with a project and app, plus a saved payment card for pay-per-use billing. There are no subscriptions: X bills $0.005 per post read and $0.010 per user read, and pay-per-use is capped at 3 million post reads per monthly billing cycle. X publishes no SLA for account setup, so do not pin a launch date to it.
Q04  Where does my key appear after sign-in on TwitterAPI.io?
Immediately on /dashboard after Google OAuth completes. Format is a prefixed string. The Rotate control on the same surface invalidates the old key the moment a new one issues.
Q05  What if the key leaks?
Rotate first, investigate second. On TwitterAPI.io the Rotate action is instant. Audit your repository history for accidental commits. Search build logs, screenshots, and shared docs for the leaked prefix. Consider key-per-service so the blast radius shrinks for next time.
Q06  How should the key be stored?
Read from an environment variable, never from a literal. In CI, use the secret manager — not a plain env var visible in build logs. For client-side code, proxy through a server you control rather than embedding the key in browser JavaScript where any user can read it.
0x18

[ SEE ALSO ]

0x30

$ ./issue-key.sh

Sign in once. Read the key off the dashboard. Make the first call before this tab loses focus.

proceed  →
END OF DOCUMENT · PAGE CHECKSUM OK