cloadyDocs
API ReferenceEndpointsWorkspaces

Change the workspace's AI gateway settings

Change the gateway's models, budget, guardrails and routing (admin role). Fields left out keep their values.

PATCH
/api/workspaces/{workspaceSlug}/ai
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/workspaces/string/ai" \  -H "Content-Type: application/json" \  -d '{}'
{  "ai": {    "settings": {      "models": [        "string"      ],      "defaultModel": "string",      "budgetCents": 0,      "onLimit": "notify",      "alerts": [        50      ],      "keyDefaults": {        "budgetCents": 0,        "rpm": 1,        "models": "all"      },      "redactPii": true,      "logPrompts": true,      "retentionDays": 7,      "maxTokens": 256,      "aliases": [        {          "id": "string",          "chain": [            "string"          ],          "strategy": "fallback"        }      ],      "retries": 0,      "timeoutSec": 5,      "fallbackOn": [        "429"      ]    },    "role": "owner",    "endpoint": "string",    "month": {      "spentMicros": 0,      "freeMicros": 0,      "requests": 0    }  }}