Documentation Index¶
Fetch the complete documentation index at: https://makakoo-traylinx-35.mintlify.app/llms.txt Use this file to discover all available pages before exploring further.
API Keys¶
Create and manage project API keys and LLM provider credentials in TrayLinx.
TrayLinx uses two distinct types of API keys within a project: project API keys for authenticating calls to TrayLinx's own APIs, and LLM API keys for connecting to external AI model providers such as OpenAI.
Project API keys vs LLM API keys¶
Authorization: Bearer header. Scoped to a single project.
Project API keys¶
Creating a project API key¶
/admin/projects/{projectId}/settings/api-keys).
* **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.
meta.secretKey. Copy it immediately — it is shown only once.
The response also includes:
* `data.id` — the key's unique ID, used for management operations
* `data.attributes.note` — the label you provided
Creating a project API key via REST API¶
You can also create a key programmatically by calling the Create API Key endpoint:
```bash theme={null}
curl -X POST "https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/organizations/{organizationId}/projects/{projectId}/api_keys" \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer The response includes `meta.secretKey` — copy it immediately, it will not be shown again.
### Using a project API key
Once created, include the key as a `Bearer` token in the `Authorization` header. For example, to call the SwitchAI LLM Proxy:
```bash theme={null}
curl https://switchai.traylinx.com/v1/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-secret-key>' \
--data '{
"model": "llama-3.3-70b-versatile",
"messages": [{"role": "user", "content": "Hello"}],
"stream": false
}'
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 a 401 Unauthorized response.
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¶
/admin/projects/{projectId}/settings/llm-api-keys).
| 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¶
```bash theme={null}
export TRAYLINX_API_KEY="<your-secret-key>"
```
Reference the variable in your application code rather than hardcoding the value.
Use descriptive notes to track which key belongs to which service:
* `Production API – backend service`
* `Staging API – integration tests`
* `CI/CD pipeline – GitHub Actions`
expires_at date when creating the key. Expired keys are automatically rejected — you do not need to remember to delete them manually.
1. Create a new key.
2. Deploy updated credentials to all services.
3. Verify services are functioning with the new key.
4. Delete the old key.
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.
The key is invalid the moment you delete it. All subsequent requests using it receive a 401 Unauthorized response. Create a replacement key and deploy it before deleting the compromised one if continuous service is required.
Related pages¶
Built with Mintlify.