mirror of
https://github.com/hanzoai/kms.git
synced 2026-10-17 11:18:16 +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
84 lines
3.1 KiB
Plaintext
84 lines
3.1 KiB
Plaintext
---
|
|
title: "Create"
|
|
openapi: "POST /api/v2/secret-rotations/open-router-api-key"
|
|
---
|
|
|
|
<Note>
|
|
Check out the configuration docs for [OpenRouter API Key Rotations](/documentation/platform/secret-rotation/openrouter-api-key) to learn how to obtain the required parameters.
|
|
</Note>
|
|
|
|
Creates an OpenRouter API Key secret rotation. KMS will create and rotate API keys via your [OpenRouter connection](/integrations/app-connections/openrouter) and write them to the specified secret path.
|
|
|
|
## Request body
|
|
|
|
| Field | Type | Required | Description |
|
|
|-------|------|----------|-------------|
|
|
| `name` | string | Yes | A unique name for the rotation (max 100 characters). |
|
|
| `projectId` | string (UUID) | Yes | The project ID. |
|
|
| `connectionId` | string (UUID) | Yes | ID of the OpenRouter app connection (Provisioning API key). |
|
|
| `environment` | string | Yes | Environment slug (e.g. `dev`, `prod`). |
|
|
| `secretPath` | string | Yes | Path where the generated API key secret will be stored. |
|
|
| `isAutoRotationEnabled` | boolean | Yes | Whether to rotate automatically on the schedule. |
|
|
| `rotationInterval` | number | Yes | Days between rotations (e.g. `30`). |
|
|
| `rotateAtUtc` | object | Yes | Time of day (UTC) to run rotation: `{ "hours", "minutes" }`. |
|
|
| `parameters.name` | string | Yes | Name for the API key in OpenRouter (max 100 characters). |
|
|
| `parameters.limit` | number | Yes | Usage limit for the key. |
|
|
| `parameters.limitReset` | string | Yes | `"monthly"` or `"never"`. |
|
|
| `parameters.includeByokInLimit` | boolean | No | Whether BYOK usage counts toward the limit. Default `false`. |
|
|
| `secretsMapping.apiKey` | string | Yes | Secret key name to store the generated API key (e.g. `OPEN_ROUTER_API_KEY`). |
|
|
| `description` | string | No | Optional description. |
|
|
|
|
## Sample request
|
|
|
|
```bash
|
|
curl --request POST \
|
|
--url https://us.kms.hanzo.ai/api/v2/secret-rotations/open-router-api-key \
|
|
--header 'Content-Type: application/json' \
|
|
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
|
|
--data '{
|
|
"name": "my-openrouter-rotation",
|
|
"projectId": "<project-id>",
|
|
"description": "OpenRouter API key rotation",
|
|
"connectionId": "<openrouter-connection-id>",
|
|
"environment": "dev",
|
|
"secretPath": "/",
|
|
"isAutoRotationEnabled": true,
|
|
"rotationInterval": 30,
|
|
"rotateAtUtc": { "hours": 0, "minutes": 0 },
|
|
"parameters": {
|
|
"name": "my-app-key",
|
|
"limit": 100,
|
|
"limitReset": "monthly",
|
|
"includeByokInLimit": false
|
|
},
|
|
"secretsMapping": {
|
|
"apiKey": "OPEN_ROUTER_API_KEY"
|
|
}
|
|
}'
|
|
```
|
|
|
|
## Sample response
|
|
|
|
```json
|
|
{
|
|
"secretRotation": {
|
|
"id": "<rotation-id>",
|
|
"name": "my-open-router-rotation",
|
|
"description": "OpenRouter API key rotation",
|
|
"secretsMapping": { "apiKey": "OPEN_ROUTER_API_KEY" },
|
|
"isAutoRotationEnabled": true,
|
|
"activeIndex": 0,
|
|
"connectionId": "<open-router-connection-id>",
|
|
"rotationInterval": 30,
|
|
"rotateAtUtc": { "hours": 0, "minutes": 0 },
|
|
"type": "open-router-api-key",
|
|
"parameters": {
|
|
"name": "my-app-key",
|
|
"limit": 100,
|
|
"limitReset": "monthly",
|
|
"includeByokInLimit": false
|
|
}
|
|
}
|
|
}
|
|
```
|