Skip to main content

Get Your API Key

Before making your first request, you need an API key. Here's the fastest way to get one.

  1. Click Login in the top navigation bar.
  2. Choose Discord or Google to authenticate.
  3. After authenticating, you'll be redirected back to the site.
  4. Click Profile in the top navigation bar, then New key in the API keys section.
  5. Give the key a name, pick an expiration (Never by default), and copy the key that appears.

Option 2 — Discord Bot​

  1. Join the Discord server.
  2. Navigate to the #keys channel.
  3. Run the /account register command.
  4. The bot replies privately with your first key, named Default.
warning

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:

danger

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:

ActionEffect
New keyCreates a named key, with an optional expiry date. The full key is shown once
RenameChanges the name only — the key keeps working
RotateIssues a new secret for the key, keeping its name and expiry. The old secret stops working immediately
DeleteThe key stops working immediately
Delete accountPermanently 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.

tip

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.

Make Your First Request →