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
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
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.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Path Parameters
The agent's id (ag_…), as List Agents returns it. Another workspace's agent is the same 404 as one that never existed.
Body
A model your LLM key reaches (List Models, byok.models), or null for the key's own model.
160Response
The model saved on the agent.
The model saved on the agent, or null for the key's own.