Authorization header. There are no session tokens, OAuth flows, or per-provider credentials to manage — one Portrix key grants access to every model in the catalog.
Getting your API key
1
Open the Portrix dashboard
Go to app.portrix.ai and sign in to your account. If you don’t have an account yet, sign up for free — it only takes a minute.
2
Navigate to API Keys
In the left sidebar, click Settings, then select API Keys.
3
Create a new key
Click Create new key. Enter a descriptive label so you can identify the key later — for example,
production, staging, or local-dev. Then click Create.4
Copy and store your key
Copy the key shown on screen and store it immediately in a password manager or secrets vault.
Using your API key
Include your API key in theAuthorization header of every request using the Bearer scheme.
Portrix request headers
In addition to theAuthorization header, Portrix accepts several optional headers that give you per-request control over routing and model selection.
These headers are optional. When omitted, Portrix uses the
model field from the request body and applies your account’s default routing policy.
Environment variables
Hard-coding API keys in source code is a security risk. Instead, store your key in an environment variable and read it at runtime. Set the variable in your shell or in a.env file:
Key management
You can create, rename, and revoke API keys at any time from Settings → API Keys in the Portrix dashboard. Rotating a key — Create a new key, update your application to use it, verify the new key works, then revoke the old one. There is no downtime if you update the key in your environment before revoking the previous one. Naming conventions — Use clear, environment-scoped names so you can identify which key belongs to which deployment:Security best practices
- Never commit API keys to source control. Add
.envto your.gitignoreand use a secrets manager (AWS Secrets Manager, HashiCorp Vault, Doppler, etc.) in production. - Use environment variables. Read the key from
process.envoros.environrather than inlining it in code. - Rotate keys periodically. Establish a regular rotation schedule — quarterly at minimum — and rotate immediately if you suspect a key has been exposed.
- Use separate keys per environment. Isolating keys by environment (production, staging, development) limits the blast radius of an accidental leak and makes auditing easier.