curl --request PATCH \
--url https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm"
payload = { "apiKey": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'apiKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"inferenceProvider": {
"modelIds": [
"<string>"
],
"pinnedModelIds": [
"<string>"
],
"id": "<string>",
"providerId": "<string>",
"name": "<string>",
"source": "openwork_gateway",
"credentialMode": "org",
"credentialStatus": "ready",
"authUrl": "<string>",
"status": "active",
"updatedAt": "2023-11-07T05:31:56Z",
"providerConfig": {},
"models": [
{
"id": "<string>",
"name": "<string>",
"config": {
"id": "<string>"
},
"upstreamModelId": "<string>",
"modelGroupId": "<string>",
"modelGroupName": "<string>",
"credentialSetId": "<string>",
"credentialSetName": "<string>"
}
],
"authorizationRequests": [
{
"credentialSetId": "<string>",
"name": "<string>",
"authUrl": "<string>",
"models": [
{
"id": "<string>",
"name": "<string>",
"config": {
"id": "<string>"
},
"upstreamModelId": "<string>",
"modelGroupId": "<string>",
"modelGroupName": "<string>",
"credentialSetId": "<string>",
"credentialSetName": "<string>"
}
]
}
],
"settings": {},
"modelGroups": [
{
"name": "<string>",
"description": "<string>",
"modelIds": [
"<string>"
],
"status": "active",
"id": "<string>"
}
],
"credentialSets": [
{
"id": "<string>",
"name": "<string>",
"credentialMode": "org",
"status": "active",
"configured": true,
"credentialStatus": "ready",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"oauthClientId": "<string>",
"hasOauthClientSecret": true
}
],
"accessGrants": [
{
"modelGroupId": "<string>",
"credentialSetId": "<string>",
"audience": {
"type": "organization"
},
"id": "<string>"
}
],
"catalogWarning": "<string>",
"migration": {
"llmProviderId": "<string>",
"runtimeEnvNames": [
"<string>"
]
},
"litellm": {
"mode": "org",
"keySource": "personal",
"issueStrategy": "per_team",
"mirrorFallback": "per_team",
"issuedMemberCount": 0,
"attentionCount": 0,
"attention": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"reason": "not_in_litellm"
}
],
"baseUrl": "<string>",
"spendTracking": true,
"hasSyncKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"teamCount": 0,
"connectedMemberCount": 0
},
"oauthCallbackUrl": "<string>",
"credentials": [
{
"id": "<string>",
"credentialSetId": "<string>",
"subject": "<string>",
"orgMembershipId": "<string>",
"memberName": "<string>",
"memberEmail": "<string>",
"kind": "api_key",
"status": "active",
"expiresAt": "2023-11-07T05:31:56Z"
}
]
},
"sync": {
"modelCount": 0,
"groupCount": 0,
"teamCount": 0,
"members": {
"matched": 0,
"rejected": 0,
"unavailable": 0,
"removed": 0
},
"warnings": [
"<string>"
],
"issued": {
"people": 0,
"keys": 0,
"notInLiteLlm": 0,
"noKeyToMirror": 0,
"noModels": 0,
"errors": 0,
"removed": 0
}
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Update LiteLLM key or key creation
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. The proxy URL and mode are fixed; create a new provider to change them. Keys are write-only. Requires owner/admin and Gateway management; session callers must recently reauthenticate.
curl --request PATCH \
--url https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm"
payload = { "apiKey": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({apiKey: '<string>'})
};
fetch('https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'apiKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm"
payload := strings.NewReader("{\n \"apiKey\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/inference-providers/{inferenceProviderId}/litellm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"inferenceProvider": {
"modelIds": [
"<string>"
],
"pinnedModelIds": [
"<string>"
],
"id": "<string>",
"providerId": "<string>",
"name": "<string>",
"source": "openwork_gateway",
"credentialMode": "org",
"credentialStatus": "ready",
"authUrl": "<string>",
"status": "active",
"updatedAt": "2023-11-07T05:31:56Z",
"providerConfig": {},
"models": [
{
"id": "<string>",
"name": "<string>",
"config": {
"id": "<string>"
},
"upstreamModelId": "<string>",
"modelGroupId": "<string>",
"modelGroupName": "<string>",
"credentialSetId": "<string>",
"credentialSetName": "<string>"
}
],
"authorizationRequests": [
{
"credentialSetId": "<string>",
"name": "<string>",
"authUrl": "<string>",
"models": [
{
"id": "<string>",
"name": "<string>",
"config": {
"id": "<string>"
},
"upstreamModelId": "<string>",
"modelGroupId": "<string>",
"modelGroupName": "<string>",
"credentialSetId": "<string>",
"credentialSetName": "<string>"
}
]
}
],
"settings": {},
"modelGroups": [
{
"name": "<string>",
"description": "<string>",
"modelIds": [
"<string>"
],
"status": "active",
"id": "<string>"
}
],
"credentialSets": [
{
"id": "<string>",
"name": "<string>",
"credentialMode": "org",
"status": "active",
"configured": true,
"credentialStatus": "ready",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"oauthClientId": "<string>",
"hasOauthClientSecret": true
}
],
"accessGrants": [
{
"modelGroupId": "<string>",
"credentialSetId": "<string>",
"audience": {
"type": "organization"
},
"id": "<string>"
}
],
"catalogWarning": "<string>",
"migration": {
"llmProviderId": "<string>",
"runtimeEnvNames": [
"<string>"
]
},
"litellm": {
"mode": "org",
"keySource": "personal",
"issueStrategy": "per_team",
"mirrorFallback": "per_team",
"issuedMemberCount": 0,
"attentionCount": 0,
"attention": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"reason": "not_in_litellm"
}
],
"baseUrl": "<string>",
"spendTracking": true,
"hasSyncKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"teamCount": 0,
"connectedMemberCount": 0
},
"oauthCallbackUrl": "<string>",
"credentials": [
{
"id": "<string>",
"credentialSetId": "<string>",
"subject": "<string>",
"orgMembershipId": "<string>",
"memberName": "<string>",
"memberEmail": "<string>",
"kind": "api_key",
"status": "active",
"expiresAt": "2023-11-07T05:31:56Z"
}
]
},
"sync": {
"modelCount": 0,
"groupCount": 0,
"teamCount": 0,
"members": {
"matched": 0,
"rejected": 0,
"unavailable": 0,
"removed": 0
},
"warnings": [
"<string>"
],
"issued": {
"people": 0,
"keys": 0,
"notInLiteLlm": 0,
"noKeyToMirror": 0,
"noModels": 0,
"errors": 0,
"removed": 0
}
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Session token passed as Authorization: Bearer <session-token> for user-authenticated Den routes.
Path Parameters
Den TypeID with 'ipr_' prefix and a 26-character base32 suffix.
30Body
1 - 4096issued 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).
per_team, mirror issued + mirror: for someone with no key to copy, create per-team keys, or report them and create nothing.
per_team, error Was this page helpful?