Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix: addressing PR feedback adding improvements to open router doc
IgorHorta74aaa2bbacd6
diff --git a/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-schemas.ts b/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-schemas.tsindex 7da0d2bc63..e88edb55bd 100644--- a/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-schemas.ts+++ b/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-schemas.ts@@ -25,8 +25,8 @@ export enum OpenRouterLimitReset {Monthly = "monthly"}-/** Max length for OpenRouter API key name. OpenRouter docs only require >=1 char; we cap at 255 for sanity checks. */-export const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 255;+/** Max length for OpenRouter API key name. OpenRouter docs only require >=1 char; we cap at 100 for sanity checks. */+export const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 100;const OpenRouterApiKeyRotationParametersSchema = z.object({name: zdiff --git a/docs/api-reference/endpoints/app-connections/open-router/available.mdx b/docs/api-reference/endpoints/app-connections/open-router/available.mdxnew file mode 100644index 0000000000..1b15388cda--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/available.mdx@@ -0,0 +1,4 @@+---+title: "Available"+openapi: "GET /api/v1/app-connections/open-router/available"+---diff --git a/docs/api-reference/endpoints/app-connections/open-router/create.mdx b/docs/api-reference/endpoints/app-connections/open-router/create.mdxnew file mode 100644index 0000000000..1ca2c64177--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/create.mdx@@ -0,0 +1,58 @@+---+title: "Create"+openapi: "POST /api/v1/app-connections/open-router"+---++<Note>+ Check out the configuration docs for [OpenRouter Connections](/integrations/app-connections/open-router) to learn how to obtain the required credentials.+</Note>++Creates an OpenRouter app connection using a Provisioning API key. The connection can then be used for [OpenRouter API Key secret rotations](/documentation/platform/secret-rotation/open-router-api-key).++## Request body++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| `name` | string | Yes | A unique name for the connection. |+| `method` | string | Yes | Must be `"api-key"`. |+| `projectId` | string (UUID) | Yes | The project ID to attach the connection to. |+| `credentials.apiKey` | string | Yes | Your OpenRouter [Provisioning API key](https://openrouter.ai/settings/provisioning-keys). |++## Sample request++```bash+curl --request POST \+ --url https://app.infisical.com/api/v1/app-connections/open-router \+ --header 'Content-Type: application/json' \+ --header 'Authorization: Bearer <ACCESS_TOKEN>' \+ --data '{+ "name": "my-open-router-connection",+ "method": "api-key",+ "projectId": "<project-id>",+ "credentials": {+ "apiKey": "<YOUR-PROVISIONING-API-KEY>"+ }+ }'+```++## Sample response++```json+{+ "appConnection": {+ "id": "<connection-id>",+ "name": "my-open-router-connection",+ "projectId": "<project-id>",+ "description": null,+ "version": 1,+ "orgId": "<org-id>",+ "createdAt": "<ISO8601>",+ "updatedAt": "<ISO8601>",+ "isPlatformManagedCredentials": false,+ "credentialsHash": "...",+ "app": "open-router",+ "method": "api-key",+ "credentials": {}+ }+}+```diff --git a/docs/api-reference/endpoints/app-connections/open-router/delete.mdx b/docs/api-reference/endpoints/app-connections/open-router/delete.mdxnew file mode 100644index 0000000000..18698ebf8f--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v1/app-connections/open-router/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/open-router/get-by-id.mdx b/docs/api-reference/endpoints/app-connections/open-router/get-by-id.mdxnew file mode 100644index 0000000000..be9990822f--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v1/app-connections/open-router/{connectionId}"+---diff --git a/docs/api-reference/endpoints/app-connections/open-router/get-by-name.mdx b/docs/api-reference/endpoints/app-connections/open-router/get-by-name.mdxnew file mode 100644index 0000000000..6027434472--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by Name"+openapi: "GET /api/v1/app-connections/open-router/connection-name/{connectionName}"+---diff --git a/docs/api-reference/endpoints/app-connections/open-router/list.mdx b/docs/api-reference/endpoints/app-connections/open-router/list.mdxnew file mode 100644index 0000000000..a5455a0afa--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v1/app-connections/open-router"+---diff --git a/docs/api-reference/endpoints/app-connections/open-router/update.mdx b/docs/api-reference/endpoints/app-connections/open-router/update.mdxnew file mode 100644index 0000000000..d780bff2fd--- /dev/null+++ b/docs/api-reference/endpoints/app-connections/open-router/update.mdx@@ -0,0 +1,8 @@+---+title: "Update"+openapi: "PATCH /api/v1/app-connections/open-router/{connectionId}"+---++<Note>+ Check out the configuration docs for [OpenRouter Connections](/integrations/app-connections/open-router) to learn how to obtain the required credentials.+</Note>diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/create.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/create.mdxnew file mode 100644index 0000000000..70e7eab061--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/create.mdx@@ -0,0 +1,83 @@+---+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/open-router-api-key) to learn how to obtain the required parameters.+</Note>++Creates an OpenRouter API Key secret rotation. Infisical will create and rotate API keys via your [OpenRouter connection](/integrations/app-connections/open-router) 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.infisical.com/api/v2/secret-rotations/open-router-api-key \+ --header 'Content-Type: application/json' \+ --header 'Authorization: Bearer <ACCESS_TOKEN>' \+ --data '{+ "name": "my-open-router-rotation",+ "projectId": "<project-id>",+ "description": "OpenRouter API key rotation",+ "connectionId": "<open-router-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+ }+ }+}+```diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/delete.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/delete.mdxnew file mode 100644index 0000000000..8b9481570e--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v2/secret-rotations/open-router-api-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-id.mdxnew file mode 100644index 0000000000..1e69806054--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v2/secret-rotations/open-router-api-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-name.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-name.mdxnew file mode 100644index 0000000000..244e7641a2--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by Name"+openapi: "GET /api/v2/secret-rotations/open-router-api-key/rotation-name/{rotationName}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-generated-credentials-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-generated-credentials-by-id.mdxnew file mode 100644index 0000000000..234fbf04a9--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/get-generated-credentials-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get Credentials by ID"+openapi: "GET /api/v2/secret-rotations/open-router-api-key/{rotationId}/generated-credentials"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/list.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/list.mdxnew file mode 100644index 0000000000..b274fe58fe--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v2/secret-rotations/open-router-api-key"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/rotate-secrets.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/rotate-secrets.mdxnew file mode 100644index 0000000000..df139cbc1d--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/rotate-secrets.mdx@@ -0,0 +1,4 @@+---+title: "Rotate Secrets"+openapi: "POST /api/v2/secret-rotations/open-router-api-key/{rotationId}/rotate-secrets"+---diff --git a/docs/api-reference/endpoints/secret-rotations/open-router-api-key/update.mdx b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/update.mdxnew file mode 100644index 0000000000..de18b737bd--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/open-router-api-key/update.mdx@@ -0,0 +1,8 @@+---+title: "Update"+openapi: "PATCH /api/v2/secret-rotations/open-router-api-key/{rotationId}"+---++<Note>+ Check out the configuration docs for [OpenRouter API Key Rotations](/documentation/platform/secret-rotation/open-router-api-key) to learn how to obtain the required parameters.+</Note>diff --git a/docs/documentation/platform/secret-rotation/open-router-api-key.mdx b/docs/documentation/platform/secret-rotation/open-router-api-key.mdxindex ef955eab03..a0ecd780f9 100644--- a/docs/documentation/platform/secret-rotation/open-router-api-key.mdx+++ b/docs/documentation/platform/secret-rotation/open-router-api-key.mdx@@ -129,17 +129,3 @@ description: "Learn how to automatically rotate OpenRouter API keys."- **Disabled (No)** – Only OpenRouter credit usage counts toward the limit. BYOK usage is tracked separately and does not consume the limit.This is optional; if you don’t use BYOK or don’t set a limit, you can leave it off. For more details, see [OpenRouter BYOK](https://openrouter.ai/docs/guides/overview/auth/byok) and [OpenRouter limits](https://openrouter.ai/docs/api/reference/limits).--## How It Works--Infisical uses OpenRouter’s [Provisioning API](https://openrouter.ai/docs/guides/overview/auth/provisioning-api-keys) to:--1. **Create** new API keys with the name, optional spending limit, and limit reset schedule you configure.-2. **Store** the new key in Infisical as the active secret at your mapped path.-3. **Revoke** the previous key after the new one is active, so existing clients can finish using the old key during the overlap period.--This follows the same [credential lifecycle](/documentation/platform/secret-rotation/overview#how-rotation-works) as other Infisical rotations: active → inactive → revoked, with zero-downtime rotation.--<Tip>- For more on OpenRouter key management and limits, see [OpenRouter’s API key documentation](https://openrouter.ai/docs/api-reference/api-keys/create-keys).-</Tip>diff --git a/docs/documentation/platform/secret-rotation/overview.mdx b/docs/documentation/platform/secret-rotation/overview.mdxindex 3ed7274568..d2e5755c41 100644--- a/docs/documentation/platform/secret-rotation/overview.mdx+++ b/docs/documentation/platform/secret-rotation/overview.mdx@@ -100,7 +100,6 @@ Using a __30-Day__ rotation interval as an example, here's how the process unfol- [PostgreSQL Credentials](./postgres-credentials)- [Microsoft SQL Server Credentials](./mssql-credentials)-- [OpenRouter API Key](./open-router-api-key)## FAQdiff --git a/docs/integrations/app-connections/open-router.mdx b/docs/integrations/app-connections/open-router.mdxindex 7af652c105..6c4f8cedeb 100644--- a/docs/integrations/app-connections/open-router.mdx+++ b/docs/integrations/app-connections/open-router.mdx@@ -100,7 +100,3 @@ You need a **Provisioning API key** from OpenRouter. Provisioning keys are used```</Tab></Tabs>--## Use Cases--- **OpenRouter API Key Secret Rotation**: Use this connection as the credential source for [automatically rotating OpenRouter API keys](/documentation/platform/secret-rotation/open-router-api-key), so your LLM-backed applications always use up-to-date keys with optional spending limits and reset schedules.diff --git a/docs/snippets/RotationsBrowser.jsx b/docs/snippets/RotationsBrowser.jsxindex db8ad0bfc5..27d55d2bee 100644--- a/docs/snippets/RotationsBrowser.jsx+++ b/docs/snippets/RotationsBrowser.jsx@@ -111,7 +111,7 @@ export const RotationsBrowser = () => {path: "/documentation/platform/secret-rotation/open-router-api-key",description:"Learn how to automatically rotate OpenRouter API keys.",- category: "Identity & Auth",+ category: "AI & LLM",},].sort(function (a, b) {return a.name.toLowerCase().localeCompare(b.name.toLowerCase());diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsxindex 783510336d..3d65ba06cf 100644--- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay.tsx@@ -21,32 +21,38 @@ export const CredentialDisplay = ({ children, label, isSensitive }: Props) => {return (<GenericFieldLabel label={label}>{children ? (- <div className="flex w-full items-center gap-1 text-mineshaft-100">- {showCredential ? children : "****************************"}- <Tooltip content={`Copy ${label}`}>- <IconButton- onClick={() => {- setCopyCredential(children);- navigator.clipboard.writeText(children);- }}- ariaLabel="Copy credential"- variant="plain"- size="xs"- >- <FontAwesomeIcon icon={isCopyingCredential ? faCheck : faCopy} />- </IconButton>- </Tooltip>- {isSensitive && (- <Tooltip content={`Show ${label}`}>+ <div className="flex w-full min-w-0 items-center gap-1 text-mineshaft-100">+ <span className="min-w-0 flex-1 truncate" title={showCredential ? children : undefined}>+ {showCredential ? children : "****************************"}+ </span>+ <span className="flex-shrink-0">+ <Tooltip content={`Copy ${label}`}><IconButton+ onClick={() => {+ setCopyCredential(children);+ navigator.clipboard.writeText(children);+ }}+ ariaLabel="Copy credential"variant="plain"size="xs"- onClick={toggleShowCredential}- ariaLabel={`${showCredential ? "Hide" : "Show"} credential`}>- <FontAwesomeIcon icon={faEyeSlash} />+ <FontAwesomeIcon icon={isCopyingCredential ? faCheck : faCopy} /></IconButton></Tooltip>+ </span>+ {isSensitive && (+ <span className="flex-shrink-0">+ <Tooltip content={`Show ${label}`}>+ <IconButton+ variant="plain"+ size="xs"+ onClick={toggleShowCredential}+ ariaLabel={`${showCredential ? "Hide" : "Show"} credential`}+ >+ <FontAwesomeIcon icon={faEyeSlash} />+ </IconButton>+ </Tooltip>+ </span>)}</div>) : null}diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsxindex f6dd401d0d..a9298edb26 100644--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/OpenRouterApiKeyRotationParametersFields.tsx@@ -8,7 +8,7 @@ import { OpenRouterLimitReset } from "@app/hooks/api/secretRotationsV2/types/opeconst NO_RESET_VALUE = "none";/** Max length for OpenRouter API key name (matches backend schema). */-const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 255;+const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 100;const LIMIT_RESET_OPTIONS = [{ label: "No Reset", value: NO_RESET_VALUE },diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/open-router-api-key-rotation-schema.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/open-router-api-key-rotation-schema.tsindex 38a37dfc81..bd33a09065 100644--- a/frontend/src/components/secret-rotations-v2/forms/schemas/open-router-api-key-rotation-schema.ts+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/open-router-api-key-rotation-schema.ts@@ -5,7 +5,7 @@ import { SecretRotation } from "@app/hooks/api/secretRotationsV2";import { OpenRouterLimitReset } from "@app/hooks/api/secretRotationsV2/types/open-router-api-key-rotation";/** Max length for OpenRouter API key name (sanity check; OpenRouter docs only require >=1 char). */-const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 255;+const OPEN_ROUTER_API_KEY_NAME_MAX_LENGTH = 100;export const OpenRouterApiKeyRotationSchema = z.object({