Skip to content
Get started

Disable a model

POST/v1/workspaces/{workspaceId}/models/{id}:disable

Transitions a model to STATE_DISABLED. Fails while agent variations are still provisioned on the model; use :swapModelOnVariations to move them first.

Path ParametersExpand Collapse
workspaceId: string
id: string
ReturnsExpand Collapse
Model object { metadata, spec, state, info }
metadata: ResourceMetadata { id, accountId, createdAt, 7 more }

Standard metadata for persistent, named resources (e.g., agents, tools, prompts)

id: string

Unique identifier for the resource (prefixed ULID, e.g., “agent_01HXK…”)

accountId: string

Account this resource belongs to for multi-tenant isolation (prefixed ULID)

createdAt: string

Timestamp when this resource was created

formatdate-time
name: string

Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly

profileId: string

ID of the actor (user or service account) that created this resource

workspaceId: string

Workspace this resource belongs to for organizational grouping (prefixed ULID)

bundleKey: optional string

Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.

externalId: optional string

External ID for the resource (e.g., a workflow ID from an external system)

labels: optional map[string]

Arbitrary key-value pairs for categorization and filtering Examples: {“environment”: “production”, “team”: “platform”, “version”: “v2”}

updatedAt: optional string

Timestamp when this resource was last updated

formatdate-time
spec: ModelSpec { family, inputPricePerMillionTokens, maxInputTokens, 3 more }

Model specification

family: optional string

The model family (e.g., “claude-sonnet-4.6”, “gpt-5.4”, “gemini-2.5-flash”)

inputPricePerMillionTokens: optional string

Cost per million input tokens in cents (e.g., 300 = $3.00)

maxInputTokens: optional number

Maximum number of input tokens the model supports

formatint32
maxOutputTokens: optional number

Maximum number of output tokens the model can generate

formatint32
outputPricePerMillionTokens: optional string

Cost per million output tokens in cents (e.g., 1500 = $15.00)

provider: optional string

The model provider (e.g., “anthropic”, “openai”, “google”)

state: "STATE_UNSPECIFIED" or "STATE_ENABLED" or "STATE_DISABLED"

Whether the model is usable in this workspace. Output only. Use the :enable and :disable actions to transition.

formatenum
One of the following:
"STATE_UNSPECIFIED"
"STATE_ENABLED"
"STATE_DISABLED"
info: optional object { agentVariationCount, aiProviderKey, lastUsedAt }

ModelInfo carries server-derived, read-only details about a model.

agentVariationCount: optional number

Number of agent variations currently provisioned on this model. Useful for previewing how many variations a swap would affect.

formatint32
aiProviderKey: optional AIProviderKey { metadata, spec, info }

AIProviderKey is a credential for an AI provider, scoped to a workspace. Most keys are customer-provided (BYOK); Cadenya also provisions promotional keys (see AIProviderKeyInfo.is_promotional), which cannot be modified or deleted by account administrators. The secret value is never returned in responses.

metadata: ResourceMetadata { id, accountId, createdAt, 7 more }

Standard metadata for persistent, named resources (e.g., agents, tools, prompts)

id: string

Unique identifier for the resource (prefixed ULID, e.g., “agent_01HXK…”)

accountId: string

Account this resource belongs to for multi-tenant isolation (prefixed ULID)

createdAt: string

Timestamp when this resource was created

formatdate-time
name: string

Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly

profileId: string

ID of the actor (user or service account) that created this resource

workspaceId: string

Workspace this resource belongs to for organizational grouping (prefixed ULID)

bundleKey: optional string

Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.

externalId: optional string

External ID for the resource (e.g., a workflow ID from an external system)

labels: optional map[string]

Arbitrary key-value pairs for categorization and filtering Examples: {“environment”: “production”, “team”: “platform”, “version”: “v2”}

updatedAt: optional string

Timestamp when this resource was last updated

formatdate-time
spec: AIProviderKeySpec { apiKey, openrouter, provider }
apiKey: optional string

The provider credential. Accepted on create/update; never populated in responses (the server returns an empty value to avoid leaking it).

openrouter: optional unknown

OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as the oneof seam so provider-specific options (region, base URL, etc.) can be added later without restructuring the spec.

provider: optional "AI_PROVIDER_UNSPECIFIED" or "AI_PROVIDER_OPENROUTER"

The AI provider this key authenticates against.

formatenum
One of the following:
"AI_PROVIDER_UNSPECIFIED"
"AI_PROVIDER_OPENROUTER"
info: optional object { disabledModelCount, enabledModelCount, isPromotional }

AIProviderKeyInfo carries server-derived, read-only details about a key, for AI provider management UIs.

disabledModelCount: optional number

Number of disabled models provisioned on this key.

formatint32
enabledModelCount: optional number

Number of enabled models provisioned on this key.

formatint32
isPromotional: optional boolean

Cadenya includes promotional keys (one for onboarding, and potentially more in the future). These are not added or maintained by account administrators.

lastUsedAt: optional string

Represents the last time this model was used in an agent objective

formatdate-time

Disable a model

curl https://api.cadenya.com/v1/workspaces/$WORKSPACE_ID/models/$ID:disable \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CADENYA_API_KEY" \
    -d '{}'
{
  "metadata": {
    "id": "id",
    "accountId": "accountId",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "name": "name",
    "profileId": "profileId",
    "workspaceId": "workspaceId",
    "bundleKey": "bundleKey",
    "externalId": "externalId",
    "labels": {
      "foo": "string"
    },
    "updatedAt": "2019-12-27T18:11:19.117Z"
  },
  "spec": {
    "family": "family",
    "inputPricePerMillionTokens": "inputPricePerMillionTokens",
    "maxInputTokens": 0,
    "maxOutputTokens": 0,
    "outputPricePerMillionTokens": "outputPricePerMillionTokens",
    "provider": "provider"
  },
  "state": "STATE_UNSPECIFIED",
  "info": {
    "agentVariationCount": 0,
    "aiProviderKey": {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "createdAt": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "profileId": "profileId",
        "workspaceId": "workspaceId",
        "bundleKey": "bundleKey",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        },
        "updatedAt": "2019-12-27T18:11:19.117Z"
      },
      "spec": {
        "apiKey": "apiKey",
        "openrouter": {},
        "provider": "AI_PROVIDER_UNSPECIFIED"
      },
      "info": {
        "disabledModelCount": 0,
        "enabledModelCount": 0,
        "isPromotional": true
      }
    },
    "lastUsedAt": "2019-12-27T18:11:19.117Z"
  }
}
Returns Examples
{
  "metadata": {
    "id": "id",
    "accountId": "accountId",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "name": "name",
    "profileId": "profileId",
    "workspaceId": "workspaceId",
    "bundleKey": "bundleKey",
    "externalId": "externalId",
    "labels": {
      "foo": "string"
    },
    "updatedAt": "2019-12-27T18:11:19.117Z"
  },
  "spec": {
    "family": "family",
    "inputPricePerMillionTokens": "inputPricePerMillionTokens",
    "maxInputTokens": 0,
    "maxOutputTokens": 0,
    "outputPricePerMillionTokens": "outputPricePerMillionTokens",
    "provider": "provider"
  },
  "state": "STATE_UNSPECIFIED",
  "info": {
    "agentVariationCount": 0,
    "aiProviderKey": {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "createdAt": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "profileId": "profileId",
        "workspaceId": "workspaceId",
        "bundleKey": "bundleKey",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        },
        "updatedAt": "2019-12-27T18:11:19.117Z"
      },
      "spec": {
        "apiKey": "apiKey",
        "openrouter": {},
        "provider": "AI_PROVIDER_UNSPECIFIED"
      },
      "info": {
        "disabledModelCount": 0,
        "enabledModelCount": 0,
        "isPromotional": true
      }
    },
    "lastUsedAt": "2019-12-27T18:11:19.117Z"
  }
}