# Config, Endpoints, Keys, Profiles, And Projects

## Endpoint Summary

| Method | Path | Purpose |
| --- | --- | --- |
| `GET` | `/v1/config` | Get daemon config and settings |
| `PATCH` | `/v1/config` | Update settings |
| `GET` | `/v1/config/model` | Show active model |
| `PUT` | `/v1/config/model` | Switch model |
| `POST` | `/v1/config/model/check` | Probe model readiness with non-empty text |
| `GET` | `/v1/config/endpoint` | Show active backend endpoint |
| `PUT` | `/v1/config/endpoint` | Switch endpoint with TUI-compatible normalization |
| `POST` | `/v1/config/endpoint/test` | Probe endpoint from daemon process |
| `GET` | `/v1/config/endpoint/history` | List recently used endpoints |
| `DELETE` | `/v1/config/endpoint/history` | Remove an endpoint from history |
| `POST` | `/v1/share/generate` | Generate a remote-access share URL |
| `GET` | `/v1/keys` | List runtime API keys |
| `POST` | `/v1/keys` | Mint runtime API key |
| `DELETE` | `/v1/keys/{prefix}` | Revoke runtime API keys by prefix |
| `GET` | `/v1/profiles` | List tool profiles |
| `POST` | `/v1/profiles` | Create a tool profile |
| `GET` | `/v1/profiles/{name}` | Get profile details |
| `DELETE` | `/v1/profiles/{name}` | Delete profile |
| `GET` | `/v1/projects` | List known projects |
| `GET` | `/v1/projects/current` | Get active project |
| `POST` | `/v1/projects/switch` | Switch active project |
| `POST` | `/v1/projects/register` | Register project root |
| `POST` | `/v1/projects/rename` | Rename project |
| `GET`/`PUT` | `/v1/projects/preferences` | Read or patch project preferences |

## Endpoint Switching

Endpoint switching uses the same normalization as the TUI. Use `/v1/config/endpoint/test` before switching a remote endpoint in automation.

Endpoint history mirrors the `/endpoint` TUI flow. It records recently used endpoints with metadata so users can reselect external routers, sponsor endpoints, and OpenAI-compatible URLs without retyping them.

`POST /v1/share/generate` creates a remote-access URL embedding the daemon host and auth material needed by the browser client. Use it only in authenticated contexts.

## Model Switching

`PUT /v1/config/model` updates the active model for subsequent requests and the daemon process, so `GET /v1/config/model` is read-after-write consistent. Clients can still pass per-request `model` fields to chat endpoints.

`POST /v1/config/model/check` performs a real chat probe and returns `ok`, `backend_normalized_model_id`, `provider_model_id`, endpoint metadata, and whether non-empty visible text was produced. Use it to distinguish model catalog visibility from compute readiness.

## Runtime Keys

Runtime keys are persistent, scoped, and revocable. See `docs/rest/auth-and-scopes.md`.

## Profiles

Profiles constrain tools and runtime behavior for a key or request path. Use them for CI, dashboards, or remote clients that should not receive the full local tool surface.

## Projects

The daemon is process-wide, but project endpoints track the active workspace and per-project preferences such as selected model, chat session, and UI choices.
