Update Model
curl --request POST \
--url https://api.example.com/api/models/model/update \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"base_model_id": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [
{}
],
"is_active": true
}
'import requests
url = "https://api.example.com/api/models/model/update"
payload = {
"id": "<string>",
"name": "<string>",
"base_model_id": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [{}],
"is_active": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
base_model_id: '<string>',
params: {},
meta: {profile_image_url: '<string>', description: '<string>', capabilities: {}},
access_grants: [{}],
is_active: true
})
};
fetch('https://api.example.com/api/models/model/update', 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.example.com/api/models/model/update",
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([
'id' => '<string>',
'name' => '<string>',
'base_model_id' => '<string>',
'params' => [
],
'meta' => [
'profile_image_url' => '<string>',
'description' => '<string>',
'capabilities' => [
]
],
'access_grants' => [
[
]
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/models/model/update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/models/model/update")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/models/model/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"base_model_id": "<string>",
"name": "<string>",
"params": {},
"meta": {},
"access_grants": [
{}
],
"is_active": true,
"created_at": 123,
"updated_at": 123
}Models
Update Model
Update an existing model’s configuration
POST
/
api
/
models
/
model
/
update
Update Model
curl --request POST \
--url https://api.example.com/api/models/model/update \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"base_model_id": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [
{}
],
"is_active": true
}
'import requests
url = "https://api.example.com/api/models/model/update"
payload = {
"id": "<string>",
"name": "<string>",
"base_model_id": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [{}],
"is_active": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
base_model_id: '<string>',
params: {},
meta: {profile_image_url: '<string>', description: '<string>', capabilities: {}},
access_grants: [{}],
is_active: true
})
};
fetch('https://api.example.com/api/models/model/update', 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.example.com/api/models/model/update",
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([
'id' => '<string>',
'name' => '<string>',
'base_model_id' => '<string>',
'params' => [
],
'meta' => [
'profile_image_url' => '<string>',
'description' => '<string>',
'capabilities' => [
]
],
'access_grants' => [
[
]
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/models/model/update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/models/model/update")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/models/model/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"base_model_id\": \"<string>\",\n \"params\": {},\n \"meta\": {\n \"profile_image_url\": \"<string>\",\n \"description\": \"<string>\",\n \"capabilities\": {}\n },\n \"access_grants\": [\n {}\n ],\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"base_model_id": "<string>",
"name": "<string>",
"params": {},
"meta": {},
"access_grants": [
{}
],
"is_active": true,
"created_at": 123,
"updated_at": 123
}Body Parameters
string
required
The unique identifier of the model to update. This field cannot be changed - it must match an existing model.
string
required
Updated human-readable display name for the model
string
Updated base model ID that should be used when proxying requests
object
required
Updated model parameters. This object can contain any parameters supported by the model.Common parameters:
temperature(number): Controls randomness in responsesmax_tokens(integer): Maximum number of tokens to generatetop_p(number): Nucleus sampling parameterfrequency_penalty(number): Penalty for token frequencypresence_penalty(number): Penalty for token presence
object
required
array
Updated array of access grant objects. If provided, this will replace all existing access grants.Each grant should specify:
access_type(string): “user” or “group”access_id(string): ID of the user or grouppermission(string): “read” or “write”
boolean
default:true
Updated active status of the model
Response
string
The model’s unique identifier
string
ID of the user who created the model (unchanged)
string
Updated base model ID
string
Updated model name
object
Updated model parameters
object
Updated model metadata
array
Updated access grants for the model
boolean
Updated active status
integer
Unix timestamp of original creation (unchanged)
integer
Unix timestamp of this update
Example Request
curl -X POST "https://api.example.com/api/models/model/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "my-custom-gpt4",
"name": "Updated Custom GPT-4",
"base_model_id": "gpt-4-turbo",
"params": {
"temperature": 0.8,
"max_tokens": 4000,
"top_p": 0.95
},
"meta": {
"description": "Enhanced GPT-4 model with higher creativity",
"capabilities": {
"vision": true,
"function_calling": true,
"json_mode": true
}
},
"access_grants": [
{
"access_type": "group",
"access_id": "developers",
"permission": "write"
},
{
"access_type": "user",
"access_id": "user456",
"permission": "read"
}
],
"is_active": true
}'
Example Response
{
"id": "my-custom-gpt4",
"user_id": "user123",
"base_model_id": "gpt-4-turbo",
"name": "Updated Custom GPT-4",
"params": {
"temperature": 0.8,
"max_tokens": 4000,
"top_p": 0.95
},
"meta": {
"profile_image_url": "/static/favicon.png",
"description": "Enhanced GPT-4 model with higher creativity",
"capabilities": {
"vision": true,
"function_calling": true,
"json_mode": true
}
},
"access_grants": [
{
"access_type": "group",
"access_id": "developers",
"permission": "write"
},
{
"access_type": "user",
"access_id": "user456",
"permission": "read"
}
],
"is_active": true,
"created_at": 1704067200,
"updated_at": 1704240000
}
Error Responses
Unauthorized - Model not found
{
"detail": "Model not found"
}
Bad Request - User does not have write access to this model
{
"detail": "Access prohibited"
}
Permissions
To update a model, the user must:- Be the owner of the model (user_id matches), OR
- Have write access granted through access_grants, OR
- Be an admin user