Replace a service slot model configuration¶
Completely replace a feature slot’s model list and extra configuration. An empty list clears the slot; do not use this as a read-only probe.
PUT https://api.moi.matrixorigin.cn/v5/admin/aistudio/service-slots/{slot_id}
Before you call this API¶
Prepare a Genesis administrator Bearer token valid for the current environment. An ordinary personal access token, X-API-Key, or Workspace Owner status is insufficient. Session authentication also requires the corresponding CSRF protection. See AI Studio. These are account-level administration operations and do not require a Workspace ID.
First have the deployment configuration operator confirm the slot’s complete configuration and back up the configuration source. The list response omits deployment-side endpoint and cannot serve as a complete recovery backup. Updating a target slot currently rebuilds that configuration entry and may remove its existing endpoint. Verify writes only in an authorized, isolated test deployment.
Choose a real model ID of an allowed type from the candidates to replace model-example. The example {} represents extra JSON text only; it does not guarantee effects for specific extension keys. See Writes and environments for clearing, ordering, and read-back after failures.
Request parameters¶
curl -X PUT "https://api.moi.matrixorigin.cn/v5/admin/aistudio/service-slots/agent_chat" \
-H "Authorization: Bearer $GENESIS_ADMIN_TOKEN" \
-H "Content-Type: application/json" \
--data '{"default_model_id":"model-example","model_ids":["model-example"],"extra_json":"{}"}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes for the Bearer example |
Bearer followed by the current environment’s administrator token. Do not also send X-API-Key. |
|
string |
Yes |
Path field obtained from the slot list. |
Request body |
string |
No |
When supplied, must match the slot selected in the path. |
|
string |
No |
For a nonempty model list, omission/whitespace selects the first item. A nonempty value must appear in model_ids. |
|
string (array of strings) |
According to the target configuration |
Complete list. Omission, null, [], or whitespace-only items may clear it. |
|
string |
No |
Valid JSON text or an empty string. Omission/an empty string does not preserve the previous value. |
|
object (array of objects) |
Not used for writes |
Compatibility parsing field; currently excluded from the write command. Cannot replace model_ids. |
Successful response¶
{
"slot_id": "agent_chat",
"name": "Agent chat",
"frontend_behavior": "selectable",
"allowed_model_types": [
"chat_text",
"chat_multimodal"
],
"configured": true,
"default_model_id": "model-example",
"models": [
{
"id": "model-example",
"name": "model-example",
"type": "",
"position": 0
}
],
"default_model_name": "model-example",
"extra_json": "{}"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Feature slot identifier. |
|
string |
Name in the currently registered definition. |
|
string |
hidden or selectable; describes whether the frontend allows users to choose a model. |
|
string (array of strings) |
Catalog model types allowed for assignment. |
|
boolean |
Whether a nonempty model list is configured; does not indicate model health or whether current credentials can call it. |
|
string |
Default model ID; an empty string when unconfigured. |
|
string |
Optional; currently displayed as the model ID. |
|
object (array of objects) |
Ordered model list; empty when unconfigured. |
|
string |
Candidate catalog model ID. |
|
string |
Currently projected name. |
|
string |
The list may supplement this from the catalog; write responses may currently use an empty string. |
|
integer |
Zero-based position in the list. |
|
string |
Optional extra JSON text, not a JSON object field. |
Error responses¶
{
"code": "ErrForbidden",
"msg": "Forbidden"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Current error code. |
|
string |
Description of the current failure stage; this example uses HTTP Forbidden text. |
HTTP / code |
Conditions and handling |
|---|---|
400 / ErrParamInvalid |
Invalid slot, model, default, JSON text, or log-count parameter. |
401 / Unauthorized |
Invalid identity or an inapplicable authentication method such as X-API-Key. |
403 / ErrForbidden |
No Genesis administrator eligibility. |
503 / ErrServiceUnavailable |
Classified required identity/configuration dependencies are unavailable. |
500 / ErrServer or InternalServerError |
Internal or identity-stage failure. Read back after a write error rather than assuming rollback. |
Errors use code/msg, whereas success returns a raw object. Different failure stages may use different string codes; do not assume a distinct machine reason for every validation error.