import json
import os
from parable_types_web_api import SetModelPreferencesInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = SetModelPreferencesInput.model_validate(
json.loads("{\"disabledProcessors\":[],\"capabilityDefaults\":[]}"),
)
result = sdk.model_policy.preview_model_preferences(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.SetModelPreferencesInput
if err := json.Unmarshal([]byte(`{"disabledProcessors":[],"capabilityDefaults":[]}`), &input); err != nil {
return err
}
result, err := sdk.ModelPolicyNamespace.PreviewModelPreferences(ctx, input){
"data": {
"changes": [
{
"after": {
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
},
"before": {
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
},
"capability": "PONDER_CHAT",
"effect": "UNAVAILABLE",
"recompute": {
"plots": 0,
"possiblePlots": 0
}
}
],
"proposed": {
"capabilityDefaults": [
{
"capability": "PONDER_CHAT",
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
}
}
],
"disabledProcessors": [
"VERTEX"
],
"effective": {
"capabilities": [
{
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
}
],
"digest": "<string>",
"policyVersion": 4503599627370495,
"tenantId": "<string>",
"vertexProject": "<string>"
},
"features": [
{
"capability": "PONDER_CHAT",
"name": "<string>",
"whenUnavailable": "<string>",
"whenDefaultChanges": "<string>"
}
],
"processors": [
{
"capabilities": [
"PONDER_CHAT"
],
"eligibleCapabilities": [
"PONDER_CHAT"
],
"processor": "VERTEX",
"switchedOff": true,
"withinCeiling": true,
"ponderServer": "<string>",
"terms": {
"description": "<string>",
"name": "<string>",
"processor": "VERTEX",
"retention": "<string>",
"retentionBasis": "ZERO_DATA_RETENTION_REQUIRED"
}
}
],
"settableDefaults": [
{
"capability": "PONDER_CHAT",
"choiceKind": "MODEL_RELEASE"
}
],
"eligibleProcessors": [
"VERTEX"
],
"vertexProject": "<string>"
}
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Preview a change to the Workspace's AI processors
Works out what saving the given AI processor and default model choices would do to the selected Workspace: which features stop, which come back and which default models change. It applies the same checks as saving and stores nothing. Requires permission to manage the Workspace’s AI processors.
import json
import os
from parable_types_web_api import SetModelPreferencesInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = SetModelPreferencesInput.model_validate(
json.loads("{\"disabledProcessors\":[],\"capabilityDefaults\":[]}"),
)
result = sdk.model_policy.preview_model_preferences(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.SetModelPreferencesInput
if err := json.Unmarshal([]byte(`{"disabledProcessors":[],"capabilityDefaults":[]}`), &input); err != nil {
return err
}
result, err := sdk.ModelPolicyNamespace.PreviewModelPreferences(ctx, input){
"data": {
"changes": [
{
"after": {
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
},
"before": {
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
},
"capability": "PONDER_CHAT",
"effect": "UNAVAILABLE",
"recompute": {
"plots": 0,
"possiblePlots": 0
}
}
],
"proposed": {
"capabilityDefaults": [
{
"capability": "PONDER_CHAT",
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
}
}
],
"disabledProcessors": [
"VERTEX"
],
"effective": {
"capabilities": [
{
"capability": "PONDER_CHAT",
"eligibleProcessors": [
"VERTEX"
],
"refusal": "ENVIRONMENT_POLICY_MISSING",
"resolved": {
"choice": {
"kind": "MODEL_RELEASE",
"modelReleaseId": "<string>"
},
"processor": "VERTEX",
"source": "EXPLICIT",
"inputTokenLimit": 0,
"modelReleaseId": "<string>",
"routeModelId": "<string>"
}
}
],
"digest": "<string>",
"policyVersion": 4503599627370495,
"tenantId": "<string>",
"vertexProject": "<string>"
},
"features": [
{
"capability": "PONDER_CHAT",
"name": "<string>",
"whenUnavailable": "<string>",
"whenDefaultChanges": "<string>"
}
],
"processors": [
{
"capabilities": [
"PONDER_CHAT"
],
"eligibleCapabilities": [
"PONDER_CHAT"
],
"processor": "VERTEX",
"switchedOff": true,
"withinCeiling": true,
"ponderServer": "<string>",
"terms": {
"description": "<string>",
"name": "<string>",
"processor": "VERTEX",
"retention": "<string>",
"retentionBasis": "ZERO_DATA_RETENTION_REQUIRED"
}
}
],
"settableDefaults": [
{
"capability": "PONDER_CHAT",
"choiceKind": "MODEL_RELEASE"
}
],
"eligibleProcessors": [
"VERTEX"
],
"vertexProject": "<string>"
}
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.ai.manage.Authorizations
A personal access token, which starts with pat_. A Parable token can call each operation that the roles of its owner allow. An MCP token can call only the read operations that are open to agents. A SQL token does not work on this API.
Headers
Workspace slug. Overrides subdomain-based workspace resolution when provided.
"acme"
Optional request correlation ID echoed back in the response.
"550e8400-e29b-41d4-a716-446655440000"
Body
Replaces a Workspace's part of its model policy: the processors it switches off and its default model per capability. An empty list clears either one.
At most one default per capability, only for the capabilities a Workspace may set: chat, SQL_MODEL, SQL_JEV, SCHEMA_INFERENCE, PONDER_CLEANUP, PONDER_NAMING, PONDER_JUDGMENT and PONDER_LANGUAGE.
16Show child attributes
Show child attributes
Processors to switch off. Each must be one that Parable allows for the Workspace, when Parable has set that list.
16An AI processor that may receive a Workspace's data when Parable runs a model over it. The Workspace model policy is a set of these: Parable sets the processors a Workspace may use, the Workspace may switch some of them off, and the environment policy caps both.
VERTEX, OPENROUTER_ZDR, ANTHROPIC, TYPESAFE Response
Successful response