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
}
'{
"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
}
'{
"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
The unique identifier of the model to update. This field cannot be changed - it must match an existing model.
Updated human-readable display name for the model
Updated base model ID that should be used when proxying requests
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
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”
Updated active status of the model
Response
The model’s unique identifier
ID of the user who created the model (unchanged)
Updated base model ID
Updated model name
Updated model parameters
Updated model metadata
Updated access grants for the model
Updated active status
Unix timestamp of original creation (unchanged)
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
401
Unauthorized - Model not found
{
"detail": "Model not found"
}
400
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
⌘I