curl --request PUT \
--url https://app.thinnest.ai/api/v1/agents/{id}/byok-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4-mini"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-5.4-mini'})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/byok-model', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/byok-model"
payload = { "model": "gpt-5.4-mini" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"model": "gpt-5.4-mini"
}Set Agent BYOK Model
Chooses which model of your own LLM key this agent runs. It must be one the key reaches — listed under byok.models by List Models — or null to run the key’s own model (the one set under Settings → Your keys). The next reply uses it. A build key may do this.
curl --request PUT \
--url https://app.thinnest.ai/api/v1/agents/{id}/byok-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4-mini"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-5.4-mini'})
};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/byok-model', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/byok-model"
payload = { "model": "gpt-5.4-mini" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"model": "gpt-5.4-mini"
}Authorizations
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"