---
title: "Update LiteLLM key or key creation"
method: PATCH
path: "/v1/inference-providers/{inferenceProviderId}/litellm"
tags: ["Inference Providers"]
---

# Update LiteLLM key or key creation

`PATCH /v1/inference-providers/{inferenceProviderId}/litellm`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Verifies and stores a new organization LiteLLM key (org mode) or LiteLLM admin key (member and issued modes), and in issued mode changes how keys are created, then syncs. Changing issueStrategy replaces existing created keys at that sync. For a provider whose members sign in with Microsoft: changes oauthTenantId, oauthClientId, oauthClientSecret, oauthScope and/or modelIds without contacting the proxy; with company SSO: oidcIssuer, oauthClientId, oauthClientSecret, oidcScope and/or modelIds, likewise; changing any sign-in setting revokes every member's token and cancels pending sign-ins, so people sign in again. The proxy URL and mode are fixed; create a new provider to change them. Keys are write-only. Requires the Manage Gateway providers permission and Gateway management; session callers must recently reauthenticate.

## Path parameters

- `inferenceProviderId` string, typeid, required

## Request body

- object
  - `apiKey` string
  - `issueStrategy` 'per_team' | 'mirror': issued mode. per_team: one key per LiteLLM team the person belongs to, or one key without a team when they are in none. mirror: a copy of their oldest active key (team, models, aliases, tags, expiry; never key-level budgets or rate limits).
  - `mirrorFallback` 'per_team' | 'error': issued + mirror: for someone with no key to copy, create per-team keys, or report them and create nothing.
  - `oauthTenantId` string: Directory (tenant) ID of the Entra ID tenant, a GUID.
  - `oauthClientId` string: Application (client) ID of the Entra app registration people sign in to.
  - `oauthClientSecret` string: A client secret of that app registration. Write-only.
  - `oauthScope` string: One API scope that app registration exposes, for example api://<application-id>/access. LiteLLM must accept access tokens for it; Microsoft Graph and Azure Cognitive Services scopes are refused.
  - `oidcIssuer` string: Issuer URL of the authorization server people sign in with, exactly as its discovery document names it, for example https://example.okta.com/oauth2/default. OpenWork reads <oidcIssuer>/.well-known/openid-configuration. It must issue signed access tokens (JWTs) LiteLLM can check; Okta's org authorization server does not, so use a custom one.
  - `oidcScope` string: The API scopes that authorization server issues LiteLLM access tokens for, separated by spaces, for example litellm. OpenWork adds openid, profile and offline_access itself.
  - `modelIds` string[]: The LiteLLM model names people may use. OpenWork holds no LiteLLM key in this mode, so it cannot read them from the proxy.

## Response `200`

Update LiteLLM key or key creation

- object
  - `inferenceProvider` GatewayProviderDetails, required
    - `modelIds` string[], required: Provider universe policy: [] follows all supported catalog models; nonempty restricts to these IDs. Does not grant group membership.
    - `pinnedModelIds` string[], required: Ordered catalog model IDs in management responses; only caller-usable gwm aliases in public list/connect responses. Pins never grant access.
    - `catalogWarning` string
    - `id` string, typeid, required: Den TypeID with 'ipr_' prefix and a 26-character base32 suffix.
    - `providerId` string, required
    - `name` string, required
    - `source` 'openwork_gateway', required
    - `credentialMode` 'org' | 'member', required
    - `credentialStatus` 'ready' | 'member_auth_required' | 'org_credential_missing', required
    - `authUrl` string, nullable, required
    - `status` 'active' | 'disabled', required
    - `createdAt` string, date-time
    - `updatedAt` string, date-time, required
    - `providerConfig` object, required
    - `models` object[], required
      - `id` string, required
      - `name` string, required
      - `config` object, required
        - `id` string, required
      - `upstreamModelId` string, required
      - `modelGroupId` string, typeid, required: Den TypeID with 'gmg_' prefix and a 26-character base32 suffix.
      - `modelGroupName` string, required
      - `credentialSetId` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
      - `credentialSetName` string, required
    - `modelAssignmentsComplete` boolean, required: True only when models and authorizationRequests.models represent every effective active grant's model alias within the provider universe. False for credential, catalog, or model configuration omissions, even when aggregate credentialStatus is ready. Only true permits absence to establish model removal.
    - `authorizationRequests` object[], required
      - `credentialSetId` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
      - `name` string, required
      - `authUrl` string, required
      - `models` object[]
        - `id` string, required
        - `name` string, required
        - `config` object, required
          - `id` string, required
        - `upstreamModelId` string, required
        - `modelGroupId` string, typeid, required: Den TypeID with 'gmg_' prefix and a 26-character base32 suffix.
        - `modelGroupName` string, required
        - `credentialSetId` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
        - `credentialSetName` string, required
    - `migration` object
      - `llmProviderId` string, typeid, required: Den TypeID with 'lpr_' prefix and a 26-character base32 suffix.
      - `runtimeEnvNames` string[], required
    - `litellm` GatewayLiteLlmStatus
      - `mode` 'org' | 'member', required
      - `keySource` 'personal' | 'issued' | 'entra' | 'oidc', nullable, required
      - `issueStrategy` 'per_team' | 'mirror', nullable, required
      - `mirrorFallback` 'per_team' | 'error', nullable, required
      - `issuedMemberCount` integer, required
      - `attentionCount` integer, required
      - `attention` object[], required
        - `memberId` string, typeid, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
        - `name` string, nullable, required
        - `email` string, nullable, required
        - `reason` 'not_in_litellm' | 'no_key_to_mirror' | 'no_models' | 'error', required
      - `baseUrl` string, nullable, required
      - `spendTracking` boolean, required
      - `hasSyncKey` boolean, required
      - `lastSyncedAt` string, date-time, nullable, required
      - `lastSyncError` string, nullable, required
      - `modelCount` integer, required
      - `teamCount` integer, required
      - `connectedMemberCount` integer, required
      - `entraScope` string: keySource entra: the API scope members' Microsoft access tokens are issued for. Only for callers who hold Manage Gateway providers.
      - `oidcIssuer` string: keySource oidc: the issuer of the company identity provider members sign in with. Only for callers who hold Manage Gateway providers.
      - `oidcScope` string: keySource oidc: the API scope members' access tokens are issued for. Only for callers who hold Manage Gateway providers.
      - `signInCheck` GatewayLiteLlmSignInCheck, nullable
        - `at` string, date-time, required
        - `memberId` string, typeid, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
        - `memberName` string, nullable, required
        - `outcome` 'verified' | 'connected' | 'litellm_rejected' | 'missing_models' | 'failed', required: verified: LiteLLM accepted the person's token and listed the models. connected: signed in, but LiteLLM could not be reached to check. litellm_rejected: LiteLLM refused the token. missing_models: LiteLLM accepted it but did not list some configured models. failed: sign-in did not finish.
        - `step` 'identity_provider' | 'token_exchange' | 'identity' | 'litellm', nullable, required: Where a failed or rejected sign-in stopped: identity_provider (the identity provider refused), token_exchange, identity (the ID token did not verify) or litellm.
        - `code` string, nullable, required: A stable code: an OpenWork error code such as oauth_invalid_client, idp_<error> returned by the identity provider such as idp_access_denied, or a LiteLLM reason such as jwt_mismatch.
        - `httpStatus` integer, nullable, required
    - `truefoundry` GatewayTrueFoundryStatus: TrueFoundry providers: addresses, sync state and people OpenWork has no working token for. Never a key or token.
      - `controlPlaneUrl` string, nullable, required
      - `gatewayBaseUrl` string, nullable, required
      - `createMissingUsers` boolean, required
      - `trackUsageCosts` boolean, required: Track usage costs in OpenWork: models with public pricing are served priced, and requests to them count towards usage limits and usage tracking.
      - `hasAdminKey` boolean, required
      - `lastSyncedAt` string, date-time, nullable, required
      - `lastSyncError` string, nullable, required
      - `modelCount` integer, required: Models people are served.
      - `availableModels` object[], required: Every chat model TrueFoundry listed at the last sync, picked or not.
        - `id` string, required
        - `name` string, required
      - `selectedModelIds` string[], nullable, required: Models an admin picked, or null when people get every TrueFoundry model.
      - `activeMemberCount` integer, required
      - `createdUserCount` integer, required
      - `attentionCount` integer, required
      - `attention` object[], required
        - `memberId` string, typeid, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
        - `name` string, nullable, required
        - `email` string, nullable, required
        - `reason` 'not_in_truefoundry' | 'user_inactive' | 'token_limit' | 'no_models' | 'error', required
        - `message` string, nullable, required
    - `custom` GatewayCustomProviderStatus: Custom OpenAI-compatible providers: address, models and whether a key is stored (never the key). Only for callers who hold Manage Gateway providers.
      - `baseUrl` string, required
      - `models` object[], required
        - `id` string, required
        - `name` string
        - `attachment` boolean, required
        - `reasoning` boolean, required
        - `reasoning_options` union[]
          - union
            - object
              - …
            - object
              - …
        - `tool_call` boolean, required
        - `structured_output` boolean, required
        - `temperature` boolean, required
        - `modalities` object, required
          - `input` string[], required
          - `output` string[], required
        - `limit` object, required
          - `context` integer, required
          - `output` integer, required
        - `cost` object
          - `input` number
          - `output` number
          - `cache_read` number
          - `cache_write` number
      - `discovery` object, required
        - `status` 'detailed' | 'basic' | 'unavailable', required
        - `lastFetchedAt` string, date-time, nullable, required
        - `listedModelIds` string[]
      - `hasKey` boolean, required
    - `settings` object, required
    - `modelGroups` object[], required
      - `name` string, required
      - `description` string, nullable, required
      - `modelIds` string[], required
      - `status` 'active' | 'disabled', required
      - `id` string, typeid, required: Den TypeID with 'gmg_' prefix and a 26-character base32 suffix.
    - `credentialSets` object[], required
      - `id` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
      - `name` string, required
      - `createdAt` string, date-time
      - `createdBy` object, nullable: Who created the set. Omitted unless the caller holds Manage Gateway providers.
        - `id` string, typeid, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
        - `name` string, nullable, required
        - `email` string, nullable, required
      - `credentialMode` 'org' | 'member', required
      - `status` 'active' | 'disabled', required
      - `configured` boolean, required
      - `credentialStatus` 'ready' | 'member_auth_required' | 'org_credential_missing', required
      - `oauthClientId` string, nullable
      - `hasOauthClientSecret` boolean
      - `oauthTenantId` string, nullable
      - `awsSso` object, nullable
        - `startUrl` string, required
        - `region` string, required
        - `accountId` string, required
        - `roleName` string, required
    - `accessGrants` object[], required
      - `modelGroupId` string, typeid, required: Den TypeID with 'gmg_' prefix and a 26-character base32 suffix.
      - `credentialSetId` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
      - `audience` union, required
        - object
          - `type` 'organization', required
        - object
          - `type` 'team', required
          - `teamId` string, typeid, required: Den TypeID with 'tem_' prefix and a 26-character base32 suffix.
        - object
          - `type` 'member', required
          - `memberId` string, typeid, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `id` string, typeid, required: Den TypeID with 'ipa_' prefix and a 26-character base32 suffix.
    - `oauthCallbackUrl` string
    - `credentials` object[]: Per-person credential rows. Only for callers who hold Manage Gateway providers.
      - `id` string, typeid, required: Den TypeID with 'ipc_' prefix and a 26-character base32 suffix.
      - `credentialSetId` string, typeid, required: Den TypeID with 'gcs_' prefix and a 26-character base32 suffix.
      - `subject` string, required
      - `orgMembershipId` string, typeid, nullable, required: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `memberName` string, nullable, required
      - `memberEmail` string, nullable, required
      - `kind` 'api_key' | 'api_key_map' | 'aws_keys' | 'gcp_service_account' | 'oauth_google' | 'oauth_azure' | 'aws_sso' | 'oauth_oidc', required
      - `status` 'active' | 'revoked' | 'refresh_failed', required
      - `expiresAt` string, date-time, nullable, required
    - `credentialCounts` object: Credential counts by status, returned instead of credentials to callers who may only view providers.
      - `total` integer, required
      - `active` integer, required
      - `revoked` integer, required
      - `refreshFailed` integer, required
  - `sync` object, required
    - `modelCount` integer, required
    - `groupCount` integer, required
    - `teamCount` integer, required
    - `members` object, required
      - `matched` integer, required
      - `rejected` integer, required
      - `unavailable` integer, required
      - `removed` integer, required
    - `warnings` string[], required
    - `issued` object
      - `people` integer, required
      - `keys` integer, required
      - `notInLiteLlm` integer, required
      - `noKeyToMirror` integer, required
      - `noModels` integer, required
      - `errors` integer, required
      - `removed` integer, required

## Other responses

- `400`: Invalid request or provider configuration.
- `401`: Sign-in required.
- `403`: Access denied or Gateway management disabled.
- `404`: Resource not found.
- `409`: Selection or resource conflict.

## Changes

- **2026-11-30** `75c644595afb`: 1 info
  - added the optional property `inferenceProvider/litellm/signInCheck` to the response with the `200` status
- **2026-11-29** `eb74df3e353d`: 2 warning, 4 info
  - added the new `oauth_oidc` enum value to the `inferenceProvider/credentials/items/kind` response property for the response status `200`
  - added the new `oidc` enum value to the `inferenceProvider/litellm/keySource/anyOf[subschema #1]/` response property for the response status `200`
  - added the new optional request property `oidcIssuer`
  - added the new optional request property `oidcScope`
  - …2 more
- **2026-11-18** `fbba8745503c`: 1 info
  - added the required property `inferenceProvider/truefoundry/trackUsageCosts` to the response with the `200` status
- **2026-11-18** `863deef8adb4`: 1 warning, 6 info
  - added the new `entra` enum value to the `inferenceProvider/litellm/keySource/anyOf[subschema #1]/` response property for the response status `200`
  - added the new optional request property `modelIds`
  - added the new optional request property `oauthClientId`
  - added the new optional request property `oauthClientSecret`
  - …3 more
- **2026-11-17** `a98c89d60588`: 2 info
  - added the required property `inferenceProvider/truefoundry/availableModels` to the response with the `200` status
  - added the required property `inferenceProvider/truefoundry/selectedModelIds` to the response with the `200` status

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/inference-providers/:inferenceProviderId/litellm/patch.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
