Create model configuration

Create a model configuration for the agent to reference. This interface does not upload or save provider keys.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/model-configs

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.

The referenced resources must be valid, including connections and credentials. The interface itself does not receive provider keys.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/model-configs" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "销售分析模型",
    "model_name": "<MODEL_NAME>",
    "model_category": "chat"
  }'

parameters, parameter_schema, limits, metadata, labels and annotations are all objects. Its root value cannot be set to null when created. The individual values ​​for labels and annotations can be strings or null. Each item in the model capability list must be a non-empty string with no leading or trailing whitespace. Duplicates are allowed.

Omit the state, source and model categories when creating, use draft, workspace, chat respectively. Generated by the service when ID is not filled in. Create does not initiate a model call.

Path parameters

Field

Type

Required

Description

workspace_id

string

Yes

The current workspace ID must be consistent with X-Workspace-ID.

Field

Type

Required

Description

id

string

No

Model configuration ID. If the string is omitted or empty, a UUID is generated. If it is not empty, the UUID is saved as the original value.

name

string

Yes

The name of the current object.

description

string

No

Description of the current object.

status

string or null

No

initial state. When omitted, null or empty string, it is draft. For accepted values, see the response status description.

source_kind

string or null

No

Source category. Omitted, null, or empty values mean workspace. system is only a source label and does not change the workspace in which the object is saved.

model_category

string or null

No

Model category. chat when omitted, null or empty string.

provider_ref

string

No

Resource references.

model_name

string

Yes

Model name.

display_name

string

No

Display name.

connection_ref

string

No

Connection configuration reference.

credential_ref

string

No

Credentials reference.

parameters

object

No

model parameters. Objects allow extended keys.

parameter_schema

object

No

Model parameter definition. Objects allow extended keys.

capabilities

array of string

No

Capability description.

limits

object

No

Usage Restrictions. Objects allow extended keys.

pricing_ref

string

No

Pricing Quote.

labels

object

No

String key-value label. A single value allows a string or null. The root value rules are explained after the table.

annotations

object

No

String key value annotation. A single value allows a string or null. The root value rules are explained after the table.

metadata

object

No

Extended metadata. Objects allow extended keys.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "mc_01",
    "workspace_id": "ws_01",
    "name": "销售分析模型",
    "status": "draft",
    "source_kind": "workspace",
    "model_category": "chat",
    "model_name": "<MODEL_NAME>",
    "version": 1,
    "created_at": "2026-08-18T01:00:00Z",
    "updated_at": "2026-08-18T01:00:00Z"
  }
}

Field

Type

Description

code

integer

success code.

data

object

The data returned by this operation.

data.id

string

Model configuration ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.name

string

Configuration name.

data.description

string

Description of the current object.

data.status

string

Configuration status. The values are draft, active, disabled, archived

data.source_kind

string

Model source type. The values are system, workspace, provider, imported

data.model_category

string

Model category. The values are chat, embedding, rerank, multimodal, parser

data.provider_ref

string

Resource references.

data.model_name

string

Model name.

data.display_name

string

Display name.

data.connection_ref

string

Connection configuration reference.

data.credential_ref

string

Credentials reference.

data.parameters

object

Model parameter objects allow extended keys.

data.parameter_schema

object

The model parameter definition object allows extended keys.

data.capabilities

array of string

Capability description.

data.limits

object

Using restricted objects allows extended keys.

data.pricing_ref

string

Pricing Quote.

data.version

integer

Configuration version.

data.labels

object

Tag key-value pairs objects allow extended keys.

data.annotations

object

Annotated key-value objects allow extended keys.

data.metadata

object

Extended metadata objects allow extended keys.

data.created_by

string

Creator ID.

data.updated_by

string

Identifier of the last updated person.

data.created_at

string

Creation and update time. In RFC 3339 format.

data.updated_at

string

Creation and update time. In RFC 3339 format.

Error response

JSON
{
  "code": 2,
  "message": "模型配置参数无效"
}

Field

Type

Description

code

integer

error code.

message

string

Error message for the caller.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

2

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

6

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

5

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

3

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

4

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

503

15

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on