# cohost.set

Source: https://docs.lightair.app/developers/remote-api/cohost.set

> Turns the AI co-host on or off, as its switch does.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Avatars and co-host. Script plugins need the `project.write` permission.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `on` | `boolean` | yes | On or off. |
| `source` | `string` | no | A co-host's source id or name. Default: the active co-host. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `on` | `boolean` | no | As set. |

## Errors

Invalid params (-32602) without `on`, or when the source isn't an AI co-host. Not found (-32004) when there's no co-host.

## Events

- `workspace.changed`

## From an AI agent

The MCP server's `cohost (action: on or off)` reaches this method.

## Related

- [cohost.status](https://docs.lightair.app/developers/remote-api/cohost.status.md)
- [cohost.say](https://docs.lightair.app/developers/remote-api/cohost.say.md)
