Skip to main content
PUT
/
api
/
v1
/
llm
/
guardrails
Python (SDK)
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.guardrails.update_guardrails(guardrails=[
        {
            "mode": "ban_words",
            "enabled": True,
            "config": {
                "words": [
                    "spam",
                    "inappropriate",
                ],
            },
        },
    ], team_id="team-alpha")

    # Handle response
    print(res)
{
  "object": "guardrails_settings",
  "guardrails": [
    {
      "mode": "ban_words",
      "enabled": true,
      "config": {
        "words": [
          "spam",
          "inappropriate"
        ]
      }
    }
  ],
  "team_id": "team-alpha",
  "updated_at": 1704067200
}

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Body

application/json
guardrails
object[]
required

List of guardrails to configure

Banned words guardrail

team_id
string | null

Target team for this policy. Omit or pass null to set the org-wide policy that applies to every team (org admin only). Non-admin callers may only target their own team.

Minimum string length: 1

Response

200 - application/json

OK

object
any
required
guardrails
object[]
required

Banned words guardrail

team_id
string | null
required

Team this policy targets; null for the org-wide policy

updated_at
number
required

Unix timestamp of when the policy was updated