Infisical Integration

Managed secret lifecycle for TheRouter.ai credentials

Infisical can mint, rotate, and revoke TheRouter.ai keys on schedule, then publish the active key to your service environments with minimal downtime.

Overview

This page mirrors the OpenRouter workflow and adapts it for TheRouter.ai. Use TheRouter.ai as your OpenAI-compatible endpoint and keep model IDs in `provider/model` format.

Installation

Install the required SDKs and keep your TheRouter.ai key in environment variables.

install.sh
curl https://api.therouter.ai/v1/management/keys   -H "Authorization: Bearer $THEROUTER_MANAGEMENT_KEY"

Configuration

Set TheRouter.ai base URL overrides and pass your API key. Add attribution headers when your app should appear in rankings.

TypeScript
const connection = {
  provider: "therouter",
  managementKey: process.env.THEROUTER_MANAGEMENT_KEY,
  rotateEveryDays: 30,
};

Caveats

Integration note
Test rotation in staging first. Ensure apps reload secrets quickly so old keys can be revoked without breaking traffic.

For production rollouts, pin SDK versions and validate model compatibility in staging before broad rollout.