> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuralcleave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Settings API

> Update LLM provider credentials, active model, thinking level, privacy mode, pipeline, and voice settings at runtime without a gateway restart.

## POST /settings/llm

Update LLM provider API keys/endpoints. Also persists to `~/.neuralcleave/config.toml` under `[models]`, so keys survive a restart.

```bash theme={null}
curl -X POST http://localhost:7432/api/v1/settings/llm \
  -H "Content-Type: application/json" \
  -d '{
    "openai_api_key": "sk-...",
    "anthropic_api_key": "sk-ant-...",
    "web_search_enabled": true
  }'
```

```json theme={null}
{ "applied": true, "updated_fields": ["openai_api_key", "anthropic_api_key", "web_search_enabled"] }
```

Accepts a key/endpoint field per provider — see [LLM Providers](/llm-providers) for the full list (`gemini_api_key`, `deepseek_api_key`, `mistral_api_key`, `xai_api_key`, `cohere_api_key`, `moonshot_api_key`, `zhipuai_api_key`, `dashscope_api_key`, `qianfan_api_key`, `ark_api_key`, `ollama_base_url`, `openrouter_api_key`, `azure_api_key`, `azure_endpoint`, `bedrock_region`, `groq_api_key`, `together_api_key`, `fireworks_api_key`).

## POST /settings/model

Force the active provider, set the reasoning-effort level, or toggle privacy mode — all runtime-only, **not** persisted to `config.toml` (unlike `/settings/llm` above).

```bash theme={null}
curl -X POST http://localhost:7432/api/v1/settings/model \
  -H "Content-Type: application/json" \
  -d '{ "provider": "anthropic", "thinking": "high", "privacy_mode": false }'
```

```json theme={null}
{ "applied": true, "settings": { "provider": "anthropic", "thinking": "high", "privacy_mode": false } }
```

| Field          | Values                                                                             | Effect                                                                                                          |
| -------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `provider`     | a provider name (some accept aliases, e.g. `xai`/`grok`, `zhipu`/`glm`), or `null` | Force every request through this provider; `null` restores automatic task-based routing.                        |
| `thinking`     | `off`/`low`/`medium`/`high`/`xhigh`/`max`, or `null`                               | Normalized reasoning effort — see [LLM Providers → Reasoning effort](/llm-providers#reasoning-effort-thinking). |
| `privacy_mode` | boolean                                                                            | Forces every request to local Ollama when `true`.                                                               |

At least one field must be present; unrecognized `provider`/`thinking` values return `422`.

## POST /settings/pipeline

```bash theme={null}
curl -X POST http://localhost:7432/api/v1/settings/pipeline \
  -H "Content-Type: application/json" \
  -d '{ "max_tool_steps": 8 }'
```

```json theme={null}
{ "applied": true, "updated_fields": ["max_tool_steps"], "settings": { "max_tool_steps": 8 } }
```

`max_tool_steps` (1–20) caps how many agentic tool-call iterations run per pipeline turn.

## POST /settings/voice

Update voice settings. See [Voice API](/api-reference/voice) for the full field list and `GET /voice/config` for reading current values back.

## Slash-command equivalents

Most settings are also reachable without the REST API, directly in any channel:

```
/model anthropic          # same as {"provider": "anthropic"}
/model auto                # same as {"provider": null}
/think high                # same as {"thinking": "high"}
/privacy on                # same as {"privacy_mode": true}
```
