Skip to content
Primox
Back to Learn

Getting Your API Key

Pro

Create and manage API keys to connect external tools, scripts, and AI agents to your Primox account

1

What Are API Keys?

An API key is a unique token that lets external tools access your Primox data on your behalf. Instead of logging in with a browser, your scripts, AI agents, and automation tools use this key to authenticate with the Primox REST API.

You need an API key any time you want to interact with Primox from outside the web interface: logging shots from a custom script, pulling session data into a spreadsheet, running the CLI tool, or connecting the MCP server for Claude integration.

2

Creating Your Key

1

Open Settings

Click the gear icon in the sidebar, then select the API Keys tab.

2

Click Create API Key

The Create button opens a form where you configure your new key.

3

Name your key

Give it a descriptive name like "Claude Desktop" or "Range Logger Script" so you can identify it later.

4

Select scopes

Choose which permissions this key should have. You can always create additional keys with different scopes.

5

Copy your key immediately

The full key is shown only once. Copy it and store it securely. You will not be able to see the full key again.

Your API key is displayed only once at creation time. If you lose it, you will need to revoke the old key and create a new one.

3

Understanding Key Scopes

Each API key has one or more scopes that control what it can access. Choose the minimum scopes needed for your use case.

read

List and retrieve your rifles, projects, sessions, loads, recipes, reports, and reference data. Required for any tool that reads your data.

write

Create and update rifles, projects, sessions, loads, recipes, and components. Required for tools that log data or create records on your behalf.

analyze

Run velocity analysis, group analysis, ladder analysis, seating depth analysis, session comparison, load safety validation, and IBE simulation.

aggregate

Access anonymized community data including powder performance statistics and load leaderboards. Requires data sharing consent to be enabled.

4

Key Format

All Primox API keys use a consistent prefix so you can identify them in configuration files and environment variables.

pmx_live_a1b2c3d4e5f6...

The prefix makes it easy to spot Primox keys in your configuration and prevents accidentally using keys from other services.

5

Security Best Practices

Use environment variables

Store your key in an environment variable or a .env file. Reference the variable in your code instead of pasting the key directly.

Never commit keys to git

Add .env.local and any files containing keys to your .gitignore. A key committed to a public repository is compromised.

Rotate keys periodically

Create a new key, update your tools, then revoke the old one. This limits the damage if a key is ever exposed.

Use least privilege

Give each key only the scopes it needs. A reporting script only needs "read". A shot logger needs "read" and "write". Do not use a full-scope key everywhere.

Environment variable example

# .env.local (never commit this file)
PRIMOX_API_KEY=pmx_live_your_key_here
6

Revoking Keys

If a key is compromised or no longer needed, revoke it immediately. Revocation is instant and permanent.

1

Go to Settings, then the API Keys tab. Find the key you want to revoke.

2

Click the revoke button next to the key. Confirm the action in the dialog.

Revocation is immediate and cannot be undone. Any tool using this key will stop working instantly. Make sure you have a replacement key configured before revoking.

7

Rate Limits

API requests are rate-limited per key to ensure fair usage. Read endpoints allow a higher request volume than write and analysis endpoints. If you exceed the limit, you will receive a 429 status code.

Rate limits are applied per API key, not per account. If you need higher throughput, consider using separate keys for different tools so their limits are independent.

Next Steps

Now that you have an API key, learn how to use it with the REST API, or connect it to the MCP server for AI-powered workflows.