curl --request POST \
--url https://api.openworklabs.com/v1/inference-providers/truefoundry \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"controlPlaneUrl": "<string>",
"apiKey": "<string>",
"name": "TrueFoundry",
"gatewayUrl": "<string>",
"createMissingUsers": false,
"allMembers": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/truefoundry"
payload = {
"controlPlaneUrl": "<string>",
"apiKey": "<string>",
"name": "TrueFoundry",
"gatewayUrl": "<string>",
"createMissingUsers": False,
"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({
controlPlaneUrl: '<string>',
apiKey: '<string>',
name: 'TrueFoundry',
gatewayUrl: '<string>',
createMissingUsers: false,
allMembers: true,
memberIds: ['<string>'],
teamIds: ['<string>']
})
};
fetch('https://api.openworklabs.com/v1/inference-providers/truefoundry', 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/truefoundry",
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([
'controlPlaneUrl' => '<string>',
'apiKey' => '<string>',
'name' => 'TrueFoundry',
'gatewayUrl' => '<string>',
'createMissingUsers' => false,
'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/truefoundry"
payload := strings.NewReader("{\n \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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/truefoundry")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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/truefoundry")
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 \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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
},
"truefoundry": {
"controlPlaneUrl": "<string>",
"gatewayBaseUrl": "<string>",
"createMissingUsers": true,
"hasAdminKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"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,
"people": 0,
"tokensCreated": 0,
"usersCreated": 0,
"notInTrueFoundry": 0,
"noModels": 0,
"tokenLimit": 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 TrueFoundry gateway provider
Connects the organization’s TrueFoundry AI Gateway with one TrueFoundry admin key (a virtual account token with the tenant admin role) and syncs its chat models. The given audiences are granted the empty “Gets a TrueFoundry key” group. For each allowed person, OpenWork finds their TrueFoundry user by OpenWork email (or, with createMissingUsers, adds them), creates one personal access token owned by that user, stores it as the person’s own credential and grants the shared group matching the models that token can reach. TrueFoundry budgets and logs those tokens, so OpenWork spend tracking is off. 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/truefoundry \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"controlPlaneUrl": "<string>",
"apiKey": "<string>",
"name": "TrueFoundry",
"gatewayUrl": "<string>",
"createMissingUsers": false,
"allMembers": true,
"memberIds": [
"<string>"
],
"teamIds": [
"<string>"
]
}
'import requests
url = "https://api.openworklabs.com/v1/inference-providers/truefoundry"
payload = {
"controlPlaneUrl": "<string>",
"apiKey": "<string>",
"name": "TrueFoundry",
"gatewayUrl": "<string>",
"createMissingUsers": False,
"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({
controlPlaneUrl: '<string>',
apiKey: '<string>',
name: 'TrueFoundry',
gatewayUrl: '<string>',
createMissingUsers: false,
allMembers: true,
memberIds: ['<string>'],
teamIds: ['<string>']
})
};
fetch('https://api.openworklabs.com/v1/inference-providers/truefoundry', 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/truefoundry",
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([
'controlPlaneUrl' => '<string>',
'apiKey' => '<string>',
'name' => 'TrueFoundry',
'gatewayUrl' => '<string>',
'createMissingUsers' => false,
'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/truefoundry"
payload := strings.NewReader("{\n \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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/truefoundry")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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/truefoundry")
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 \"controlPlaneUrl\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"name\": \"TrueFoundry\",\n \"gatewayUrl\": \"<string>\",\n \"createMissingUsers\": false,\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
},
"truefoundry": {
"controlPlaneUrl": "<string>",
"gatewayBaseUrl": "<string>",
"createMissingUsers": true,
"hasAdminKey": true,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncError": "<string>",
"modelCount": 0,
"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,
"people": 0,
"tokensCreated": 0,
"usersCreated": 0,
"notInTrueFoundry": 0,
"noModels": 0,
"tokenLimit": 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
Organization API key passed as the x-api-key header. The raw key is the header value; do not prefix it with Bearer.
Body
The address people open TrueFoundry at, e.g. https://acme.truefoundry.cloud.
1 - 2048A TrueFoundry virtual account token with the tenant admin role. Write-only; never a personal access token.
1 - 81921 - 255The TrueFoundry AI Gateway base URL when it is not /api/llm.
1 - 2048Create missing users in TrueFoundry: when an allowed person's OpenWork email is not a TrueFoundry user, add them to TrueFoundry (default member role, no invite email) and create their token. They get only TrueFoundry's default models until a TrueFoundry admin configures their teams and access.
500Den TypeID with 'om_' prefix and a 26-character base32 suffix.
29500Den TypeID with 'tem_' prefix and a 26-character base32 suffix.
30Was this page helpful?