curl --request POST \
--url https://api.openworklabs.com/v1/inference-providers/litellm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"baseUrl": "<string>",
"apiKey": "<string>",
"name": "LiteLLM",
"allMembers": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/litellm"
payload = {
"baseUrl": "<string>",
"apiKey": "<string>",
"name": "LiteLLM",
"allMembers": True,
"memberIds": ["<string>"],
"teamIds": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
baseUrl: '<string>',
apiKey: '<string>',
name: 'LiteLLM',
allMembers: true,
memberIds: ['<string>'],
teamIds: ['<string>']
})
};
fetch('https://api.openworklabs.com/v1/inference-providers/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/litellm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'baseUrl' => '<string>',
'apiKey' => '<string>',
'name' => 'LiteLLM',
'allMembers' => true,
'memberIds' => [
'<string>'
],
'teamIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/litellm"
payload := strings.NewReader("{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.openworklabs.com/v1/inference-providers/litellm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/inference-providers/litellm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\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>"
}
],
"modelAssignmentsComplete": true,
"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,
"oauthTenantId": "<string>",
"awsSso": {
"startUrl": "<string>",
"region": "<string>",
"accountId": "<string>",
"roleName": "<string>"
}
}
],
"accessGrants": [
{
"modelGroupId": "<string>",
"credentialSetId": "<string>",
"audience": {
"type": "organization"
},
"id": "<string>"
}
],
"catalogWarning": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"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,
"entraScope": "<string>",
"oidcIssuer": "<string>",
"oidcScope": "<string>",
"signInCheck": {
"at": "2023-11-07T05:31:56Z",
"memberId": "<string>",
"memberName": "<string>",
"outcome": "verified",
"step": "identity_provider",
"code": "<string>",
"httpStatus": 0
}
},
"truefoundry": {
"controlPlaneUrl": "<string>",
"gatewayBaseUrl": "<string>",
"createMissingUsers": true,
"trackUsageCosts": true,
"hasAdminKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"availableModels": [
{
"id": "<string>",
"name": "<string>"
}
],
"selectedModelIds": [
"<string>"
],
"activeMemberCount": 0,
"createdUserCount": 0,
"attentionCount": 0,
"attention": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"reason": "not_in_truefoundry",
"message": "<string>"
}
]
},
"custom": {
"baseUrl": "<string>",
"models": [
{
"id": "<string>",
"attachment": true,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"temperature": true,
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"limit": {
"context": 123,
"output": 123
},
"name": "<string>",
"reasoning_options": [
{
"type": "toggle"
}
],
"cost": {
"input": 1,
"output": 1,
"cache_read": 1,
"cache_write": 1
}
}
],
"discovery": {
"status": "detailed",
"lastFetchedAt": "2023-11-07T05:31:56Z",
"listedModelIds": []
},
"hasKey": true
},
"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"
}
],
"credentialCounts": {
"total": 0,
"active": 0,
"revoked": 0,
"refreshFailed": 0
}
},
"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>"
}Create LiteLLM gateway provider
Connects the organization’s own LiteLLM proxy and syncs its models. mode=entra is for a proxy that accepts sign-in tokens instead of LiteLLM keys: it stores the Entra app registration (oauthTenantId, oauthClientId, write-only oauthClientSecret), one API scope (oauthScope) and the model list (modelIds), creates an “All LiteLLM models” group granted to the given audiences, reads nothing from the proxy, and each person then signs in with Microsoft through oauth/start. mode=oidc is the same for a proxy that validates the company’s own OpenID Connect access tokens (JWT auth), when the organization has SSO model sign-in: it checks and stores the authorization server’s issuer (oidcIssuer, whose discovery document must name exactly that issuer), the app people sign in through (oauthClientId, write-only oauthClientSecret), one or more API scopes (oidcScope) and modelIds, and each person signs in once with company SSO; 403 feature_disabled when the organization does not have it. mode=org stores one organization LiteLLM key used for everyone, creates an “All LiteLLM models” group granted to the given audiences, and keeps OpenWork spend tracking and limits on. mode=member stores a LiteLLM admin key used only to sync models and teams; each person then connects their own LiteLLM key, which picks the shared group matching that key’s models. The given audiences are granted the empty “Can connect a LiteLLM key” group, and OpenWork spend tracking is off because LiteLLM budgets those keys. Keys are write-only. Requires the Manage Gateway providers permission and Gateway management; session callers must recently reauthenticate.
curl --request POST \
--url https://api.openworklabs.com/v1/inference-providers/litellm \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"baseUrl": "<string>",
"apiKey": "<string>",
"name": "LiteLLM",
"allMembers": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/litellm"
payload = {
"baseUrl": "<string>",
"apiKey": "<string>",
"name": "LiteLLM",
"allMembers": True,
"memberIds": ["<string>"],
"teamIds": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
baseUrl: '<string>',
apiKey: '<string>',
name: 'LiteLLM',
allMembers: true,
memberIds: ['<string>'],
teamIds: ['<string>']
})
};
fetch('https://api.openworklabs.com/v1/inference-providers/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/litellm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'baseUrl' => '<string>',
'apiKey' => '<string>',
'name' => 'LiteLLM',
'allMembers' => true,
'memberIds' => [
'<string>'
],
'teamIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/litellm"
payload := strings.NewReader("{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.openworklabs.com/v1/inference-providers/litellm")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/inference-providers/litellm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"baseUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"LiteLLM\",\n \"allMembers\": true,\n \"memberIds\": [\n \"<string>\"\n ],\n \"teamIds\": [\n \"<string>\"\n ]\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>"
}
],
"modelAssignmentsComplete": true,
"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,
"oauthTenantId": "<string>",
"awsSso": {
"startUrl": "<string>",
"region": "<string>",
"accountId": "<string>",
"roleName": "<string>"
}
}
],
"accessGrants": [
{
"modelGroupId": "<string>",
"credentialSetId": "<string>",
"audience": {
"type": "organization"
},
"id": "<string>"
}
],
"catalogWarning": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"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,
"entraScope": "<string>",
"oidcIssuer": "<string>",
"oidcScope": "<string>",
"signInCheck": {
"at": "2023-11-07T05:31:56Z",
"memberId": "<string>",
"memberName": "<string>",
"outcome": "verified",
"step": "identity_provider",
"code": "<string>",
"httpStatus": 0
}
},
"truefoundry": {
"controlPlaneUrl": "<string>",
"gatewayBaseUrl": "<string>",
"createMissingUsers": true,
"trackUsageCosts": true,
"hasAdminKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"availableModels": [
{
"id": "<string>",
"name": "<string>"
}
],
"selectedModelIds": [
"<string>"
],
"activeMemberCount": 0,
"createdUserCount": 0,
"attentionCount": 0,
"attention": [
{
"memberId": "<string>",
"name": "<string>",
"email": "<string>",
"reason": "not_in_truefoundry",
"message": "<string>"
}
]
},
"custom": {
"baseUrl": "<string>",
"models": [
{
"id": "<string>",
"attachment": true,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"temperature": true,
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"limit": {
"context": 123,
"output": 123
},
"name": "<string>",
"reasoning_options": [
{
"type": "toggle"
}
],
"cost": {
"input": 1,
"output": 1,
"cache_read": 1,
"cache_write": 1
}
}
],
"discovery": {
"status": "detailed",
"lastFetchedAt": "2023-11-07T05:31:56Z",
"listedModelIds": []
},
"hasKey": true
},
"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"
}
],
"credentialCounts": {
"total": 0,
"active": 0,
"revoked": 0,
"refreshFailed": 0
}
},
"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
Body
- Option 1
- Option 2
- Option 3
org: one organization LiteLLM key for everyone, with OpenWork spend tracking. member: each person connects their own LiteLLM key. issued: OpenWork creates a LiteLLM key for each allowed person, found by their OpenWork email. In member and issued modes apiKey is a LiteLLM admin key and OpenWork spend tracking is off.
org, member, issued 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).
per_team, mirror Was this page helpful?