---
title: "Set Engine Mode"
method: PUT
path: "/api/admin/engine-mode"
tags: ["admin"]
---

# Set Engine Mode

`PUT /api/admin/engine-mode`

## Request

- Base URL: `https://api.advisorppc.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.advisorppc.com/api/admin/engine-mode`
- Auth: HTTP bearer

Superuser toggle: flip advisor format ON/OFF per call site on this worker.

SECURITY (F2): this mutates PROCESS-GLOBAL ``settings`` (not tenant data), so
it is gated on platform superuser, NOT tenant role — every user is owner of
their personal tenant, so ``require_role("admin")`` here let any logged-in
user flip the global engine mode.

Default posture is OFF (single-model Opus path). See the module docstring for
the durable env-var control and the multi-worker caveat.

## Headers

- `X-Tenant-Id` integer, nullable

## Request body

- EngineModePatch: Partial toggle — omit a field to leave that call site unchanged. Reject unknown keys so a typo (e.g. ``advisor_enabled_char``) is a 422, not a silent no-op that leaves an operator believing the mode flipped.
  - `advisor_enabled_chat` boolean, nullable
  - `advisor_enabled_runner` boolean, nullable

## Response `200`

Successful Response

- EngineMode: Current advisor-format posture for both engine call sites.
  - `advisor_enabled_chat` boolean, required
  - `advisor_enabled_runner` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/advisorppc/apis/advisorppc-api.md) · [All operations](https://skmtc.dev/advisorppc/apis/advisorppc-api/llms.txt) · [OpenAPI document](https://skmtc.dev/advisorppc/apis/advisorppc-api/revisions/3441bd729e0c?raw)
