mirror of
https://github.com/hanzoai/kms.git
synced 2026-11-02 09:27:14 +00:00
- Fix 381 files where branding script corrupted variable names (e.g. isHanzo KMSTemplate -> isKmsTemplate) - Rebrand from "Hanzo KMS" to just "KMS" for white-label support (allows Lux KMS, Hanzo KMS, etc. via configuration) - 856 files, purely string replacements, no logic changes
103 lines
4.5 KiB
Plaintext
103 lines
4.5 KiB
Plaintext
---
|
|
title: "OpenRouter Connection"
|
|
description: "Learn how to configure an OpenRouter (LLM router) connection for KMS."
|
|
---
|
|
|
|
[OpenRouter](https://openrouter.ai/) is a unified LLM router that gives you access to hundreds of large language models through a single API. KMS supports connecting to OpenRouter using an **API Key** (Provisioning API key). This connection is used to manage and rotate OpenRouter API keys via [Secret Rotation](/documentation/platform/secret-rotation/openrouter-api-key).
|
|
|
|
## Prerequisites
|
|
|
|
You need a **Provisioning API key** from OpenRouter. Provisioning keys are used only for key management (create, list, delete keys)—they cannot be used for model completion requests.
|
|
|
|
## Create an OpenRouter Provisioning API Key
|
|
|
|
<Steps>
|
|
<Step title="Navigate to Provisioning Keys">
|
|
In [OpenRouter Settings](https://openrouter.ai/settings/provisioning-keys), go to **Provisioning API Keys** and click **Create New Key**.
|
|
|
|

|
|
</Step>
|
|
<Step title="Create and Copy Key">
|
|
Complete the key creation flow and copy the generated Provisioning API key. Store it securely—you will use it when creating the KMS connection.
|
|
|
|

|
|
</Step>
|
|
</Steps>
|
|
|
|
<Tip>
|
|
For more details on Provisioning API keys and key management, see [OpenRouter's documentation](https://openrouter.ai/docs/guides/overview/auth/provisioning-api-keys).
|
|
</Tip>
|
|
|
|
## Create OpenRouter Connection in KMS
|
|
|
|
<Tabs>
|
|
<Tab title="KMS UI">
|
|
<Steps>
|
|
<Step title="Navigate to App Connections">
|
|
In your KMS dashboard, go to **Organization Settings** → **App Connections** (or the **Integrations** → **App Connections** tab in your project).
|
|
|
|

|
|
</Step>
|
|
<Step title="Select OpenRouter Connection">
|
|
Click **Add Connection** and choose **OpenRouter** from the list of available connections.
|
|
|
|

|
|
</Step>
|
|
<Step title="Fill out Connection Form">
|
|
Complete the form with:
|
|
- A **name** for the connection (e.g. `openrouter-prod`)
|
|
- An optional **description**
|
|
- Your **OpenRouter Provisioning API Key** (from the steps above)
|
|
|
|

|
|
</Step>
|
|
<Step title="Connection Created">
|
|
After clicking **Create**, KMS validates the key against OpenRouter's API. Your **OpenRouter Connection** is then ready to use for [OpenRouter API Key Secret Rotation](/documentation/platform/secret-rotation/openrouter-api-key).
|
|
|
|

|
|
</Step>
|
|
</Steps>
|
|
</Tab>
|
|
<Tab title="API">
|
|
Create an OpenRouter connection via the [Create OpenRouter Connection](/api-reference/endpoints/app-connections/openrouter/create) API endpoint.
|
|
|
|
### Sample request
|
|
|
|
```bash Request
|
|
curl --request POST \
|
|
--url https://kms.hanzo.ai/api/v1/app-connections/open-router \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"name": "my-openrouter-connection",
|
|
"method": "api-key",
|
|
"projectId": "7ffbb072-2575-495a-b5b0-127f88caef78",
|
|
"credentials": {
|
|
"apiKey": "<YOUR-PROVISIONING-API-KEY>"
|
|
}
|
|
}'
|
|
```
|
|
|
|
### Sample response
|
|
|
|
```bash Response
|
|
{
|
|
"appConnection": {
|
|
"id": "e5d18aca-86f7-4026-a95e-efb8aeb0d8e6",
|
|
"name": "my-openrouter-connection",
|
|
"projectId": "7ffbb072-2575-495a-b5b0-127f88caef78",
|
|
"description": null,
|
|
"version": 1,
|
|
"orgId": "6f03caa1-a5de-43ce-b127-95a145d3464c",
|
|
"createdAt": "2025-04-23T19:46:34.831Z",
|
|
"updatedAt": "2025-04-23T19:46:34.831Z",
|
|
"isPlatformManagedCredentials": false,
|
|
"credentialsHash": "...",
|
|
"app": "open-router",
|
|
"method": "api-key",
|
|
"credentials": {}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
</Tabs>
|