Skip to main content
Check out the configuration docs for LiteLLM Connections to learn how to obtain the required credentials.
Creates a LiteLLM app connection using a management-capable API key. The connection can then be used for LiteLLM API Key secret rotations.

Request body

FieldTypeRequiredDescription
namestringYesA unique name for the connection.
methodstringYesMust be "api-key".
projectIdstring (UUID)YesThe project ID to attach the connection to.
credentials.apiKeystringYesA management-capable LiteLLM API key (the proxy master key or an admin/management key).
credentials.instanceUrlstringYesThe base URL of your LiteLLM instance (e.g. https://litellm.example.com).

Sample request

curl --request POST \
  --url https://app.infisical.com/api/v1/app-connections/litellm \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --data '{
    "name": "my-litellm-connection",
    "method": "api-key",
    "projectId": "<project-id>",
    "credentials": {
      "apiKey": "<YOUR-LITELLM-MANAGEMENT-API-KEY>",
      "instanceUrl": "https://litellm.example.com"
    }
  }'

Sample response

{
  "appConnection": {
    "id": "<connection-id>",
    "name": "my-litellm-connection",
    "projectId": "<project-id>",
    "description": null,
    "version": 1,
    "orgId": "<org-id>",
    "createdAt": "<ISO8601>",
    "updatedAt": "<ISO8601>",
    "isPlatformManagedCredentials": false,
    "credentialsHash": "...",
    "app": "litellm",
    "method": "api-key",
    "credentials": {
      "instanceUrl": "https://litellm.example.com"
    }
  }
}