Project API keys vs LLM API keys
Project API keys
Authenticate requests to TrayLinx APIs on behalf of your project. Used in the
Authorization: Bearer header. Scoped to a single project.LLM API keys
Credentials for external model providers (for example, OpenAI). TrayLinx stores and uses these to route LLM requests through the proxy on your behalf.
Project API keys
Creating a project API key
Open your project settings
Navigate to your project and go to Settings → API Keys (path:
/admin/projects/{projectId}/settings/api-keys).Create a new key
Click Create API Key and provide:
- Note — a descriptive label for the key (for example,
Onboarding API Key,Production Backend,CI/CD Pipeline). Required. - Expires at — an optional expiration date (ISO 8601 format). Leave blank for a key that never expires.
Using a project API key
Include the key as aBearer token in the Authorization header of your API requests:
Rotating a project API key
TrayLinx does not support in-place rotation of a project API key. To rotate:- Create a new key with the same note.
- Update all services using the old key to use the new secret.
- Delete the old key once all services have been updated.
Deleting a project API key
Navigate to Settings → API Keys, find the key by its note or ID, and click Delete. The key is revoked immediately — any requests using it will fail with a401 Unauthorized response.
You can also update a key’s note without rotating it using the Edit action. This changes only the display label, not the secret value.
LLM provider API keys
LLM API keys let TrayLinx route AI model requests to external providers on your behalf. Your key is stored server-side; you do not embed it in client code.Creating an LLM API key
Open LLM API keys settings
Navigate to Settings → LLM API Keys inside your project (path:
/admin/projects/{projectId}/settings/llm-api-keys).Add a provider key
Click Add LLM API Key and fill in:
| Field | Description |
|---|---|
| Provider | The model provider (for example, openai, anthropic). |
| Secret key | Your API key from the provider’s dashboard. |
| Custom models | Optional list of custom model identifiers to register alongside the provider’s defaults. |
| With default models | Whether to include the provider’s standard model catalog. Defaults to true. |
Deleting an LLM API key
Navigate to Settings → LLM API Keys, find the provider entry, and click Delete. Removing an LLM key disables all model requests that rely on that provider for your project.API key security best practices
Store keys in environment variables, not source code
Store keys in environment variables, not source code
Never commit API keys to version control. Use environment variables or a secrets manager:Reference the variable in your application code rather than hardcoding the value.
Apply the principle of least privilege
Apply the principle of least privilege
Create separate API keys for each service, environment, or integration. If one key is compromised, you can revoke it without affecting other services.Use descriptive notes to track which key belongs to which service:
Production API – backend serviceStaging API – integration testsCI/CD pipeline – GitHub Actions
Set expiration dates for time-limited access
Set expiration dates for time-limited access
For temporary integrations or contractor access, set an
expires_at date when creating the key. Expired keys are automatically rejected — you do not need to remember to delete them manually.Rotate keys periodically
Rotate keys periodically
Rotate project API keys on a regular schedule (for example, every 90 days) or immediately after a suspected exposure:
- Create a new key.
- Deploy updated credentials to all services.
- Verify services are functioning with the new key.
- Delete the old key.
Monitor for unexpected usage
Monitor for unexpected usage
Review your project’s usage metrics regularly. Unexplained spikes in request volume or errors from unfamiliar IP addresses may indicate a compromised key. Revoke and rotate immediately if you suspect unauthorized use.
Revoking API keys
Revoke a key immediately if you suspect it has been exposed:- Navigate to Settings → API Keys in your project.
- Locate the key by its note or ID.
- Click Delete.
401 Unauthorized response. Create a replacement key and deploy it before deleting the compromised one if continuous service is required.
Related pages
Authentication & Security
JWT authentication, token refresh, and session management.
Sentinel Pass
OAuth credentials for agents with usage analytics and permission management.
Projects & Assets
Project setup, members, and settings.
Studio Tools
Build and deploy AI tools and agents.