Get Your API Key
Before making your first request, you need an API key. Here's the fastest way to get one.
Option 1 — Web Login (Recommended)
- Click Login in the top navigation bar.
- Choose Discord or Google to authenticate.
- After authenticating, you'll be redirected back to the site.
- Click Profile in the top navigation bar, then New key in the API keys section.
- Give the key a name, pick an expiration (Never by default), and copy the key that appears.
Option 2 — Discord Bot
- Join the Discord server.
- Navigate to the
#keyschannel. - Run the
/account registercommand. - The bot replies privately with your first key, named
Default.
A key is shown only once.
Keys are stored hashed, so nobody (not even the maintainers) can display a key again after it is created. Copy it right away and store it somewhere safe, such as an environment variable on your server. If you lose it, rotate it or create a new one.
Using Your Key
Pass your key in the x-api-key header on every request:
GET /v2/users/dymerz HTTP/1.1
Host: api.starcitizen-api.com
x-api-key: YOUR_API_KEY
Never expose your API key.
Do not put your key in client-side JavaScript or public repositories. Route API calls through your own backend so the key never reaches the browser.
Managing Your Keys
One account can own up to 10 API keys. Use one key per application: when a key leaks, you replace that key only, and your other applications keep running.
From your profile page you can:
| Action | Effect |
|---|---|
| New key | Creates a named key, with an optional expiry date. The full key is shown once |
| Rename | Changes the name only — the key keeps working |
| Rotate | Issues a new secret for the key, keeping its name and expiry. The old secret stops working immediately |
| Delete | The key stops working immediately |
| Delete account | Permanently removes the account and all of its keys. The same login cannot register again |
All keys of an account share the same daily quota and per-minute limits: adding keys does not add quota. See Rate Limits & Quota.
Expiry
A key never expires by default. Pick an expiration when you create a key for a short-lived use (a demo, a contractor, a CI job). Once the date passes, the key is refused with 401 API key expired. Create a new key to replace it.
Leaked keys
If a key leaks, rotate or delete it from your profile right away. Admins can also block a key that was exposed publicly: a blocked key is refused with 403 API key revoked: <reason>, while your other keys keep working. Delete the blocked key and create a new one.
Legacy keys still work.
Keys created before the usc_ format are marked legacy on your profile. They keep working; rotate them when convenient to get a usc_ key.
Next Step
You have a key — now make your first request.