{"article":{"title":"Management keys","breadcrumb":["Getting started","Management keys"],"body":"**What this solves**: Configure channels, routing and data protection from your own product with an API key, without opening the Tare console.\n\nA management key does one thing: change the account's configuration. It is meant for a partner product that sets up channels, routes and DLP rules for its own customers through an API. It cannot call models, read billing, look up generations or issue keys.\n\n### What it can and cannot call\n\n| | Management key |\n|---|---|\n| `/v1/manage/providers/**` | Channels: list, add, change, delete, cost prices, test, dialect |\n| `/v1/manage/routers/**` | Routing: routers and the routes inside them |\n| `/v1/manage/dlp/**` | Data protection: account and key settings, custom rules, test scan |\n| Model endpoints, `/v1/generation`, `/v1/keys`, `/v1/integration/*` | `403` |\n| `/v1/manage/providers/{id}/chat` | `403` |\n\nThe `/v1/manage/*` paths accept **only** a management key. An inference, provisioning or reconciliation key gets `403` there, and so does a console session; the console keeps using the unprefixed paths (`/v1/providers`, `/v1/routers`, `/v1/dlp`). Both sets of paths run the same handlers, so request and response bodies are identical.\n\n**Channel chat is not available** with a management key. It sends a real prompt to the upstream and spends tokens on that channel. **Test**, **detect dialect** and **route test** do not send a prompt and do not spend tokens, so they are allowed. Channel evaluations also spend money and stay in the console.\n\n### Creating one\n\nConsole → **API Keys** → **Create** → type **Management**. Or with a console session: `POST /v1/api-keys` with `\"keyType\": \"management\"`. The full key is shown once, at creation time.\n\nA management key has no routes, no credit limit and no DLP settings of its own. Disabling it takes effect immediately; configuration it already wrote stays.\n\n### Every change is in the audit trail\n\nEvery `POST`, `PUT` and `DELETE` made with a management key writes a `MANAGEMENT_API_CALL` event to the [Audit trail](audit-trail): the key's id and name, the method, the path and the response status. Changes to DLP rules additionally write `DLP_TENANT_POLICY_CHANGED` with `viaKeyId` set to the management key. Read-only calls (`GET`) are not recorded.\n\n### Request and response shape\n\nBase URL: `https://tare.jamerly.ai/v1/manage`. Every response is the console's envelope:\n\n```json\n{ \"code\": 200, \"message\": \"success\", \"data\": { } }\n```\n\nValidation errors return `400` with the reason in `message`. An id that belongs to another account returns `404`.\n\n### Channels\n\n```bash\nexport TARE_MANAGE_KEY=ak-...\n\n# List\ncurl https://tare.jamerly.ai/v1/manage/providers \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Add\ncurl https://tare.jamerly.ai/v1/manage/providers \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"customer-42-openai\",\"baseUrl\":\"https://api.openai.com/v1\",\"apiStyle\":\"OPENAI\",\"apiKey\":\"sk-...\"}'\n\n# Change (only the fields you send are changed; \"paused\": true takes it out of traffic)\ncurl -X PUT https://tare.jamerly.ai/v1/manage/providers/101 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"paused\":false}'\n\n# Test address, key and dialect (no tokens spent)\ncurl -X POST https://tare.jamerly.ai/v1/manage/providers/101/test \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Enter a cost price for one upstream model (USD per 1M tokens)\ncurl -X PUT https://tare.jamerly.ai/v1/manage/providers/101/costs \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"providerModelName\":\"gpt-4.1-mini\",\"inputPrice\":0.4,\"outputPrice\":1.6}'\n\n# Delete\ncurl -X DELETE https://tare.jamerly.ai/v1/manage/providers/101 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n```\n\nThe other channel endpoints follow the same pattern under `/v1/manage/providers/{id}`: `GET costs`, `POST costs/delete`, `GET missing-costs`, `GET upstream-models`, `POST detect-dialect`, `GET`/`PUT dialects`. The fields are described in [Channels](channels) and [Cost prices](cost-prices).\n\n### Routing\n\nA channel carries no traffic until a route points a model name at it.\n\n```bash\n# List routers\ncurl https://tare.jamerly.ai/v1/manage/routers \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Create a router\ncurl https://tare.jamerly.ai/v1/manage/routers \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"customer-42\",\"enablePlatformModels\":false}'\n\n# Add a route: model name callers send → channel and upstream model name\ncurl https://tare.jamerly.ai/v1/manage/routers/7/routes \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"modelName\":\"gpt-4.1-mini\",\"providerId\":101,\"providerModelName\":\"gpt-4.1-mini\",\"priority\":1,\"weight\":100}'\n\n# Change a route: priority, weight, enabled\ncurl -X PUT https://tare.jamerly.ai/v1/manage/routers/7/routes/55 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":false}'\n\n# Order a model's routes by measured speed (SPEED) or cost price (COST)\ncurl -X POST https://tare.jamerly.ai/v1/manage/routers/7/routes/arrange \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"modelName\":\"gpt-4.1-mini\",\"mode\":\"COST\"}'\n\n# Test a route, including whether the upstream model name exists (no tokens spent)\ncurl -X POST https://tare.jamerly.ai/v1/manage/routers/7/routes/55/test \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Delete a route, then the router\ncurl -X DELETE https://tare.jamerly.ai/v1/manage/routers/7/routes/55 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\ncurl -X DELETE https://tare.jamerly.ai/v1/manage/routers/7 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n```\n\nAlso available: `PUT /v1/manage/routers/{id}` (rename, make default, platform models), `GET /v1/manage/routers/{id}/routes`, and `GET` / `PUT /v1/manage/routers/{id}/capabilities` (what `/v1/models` reports for a model: `{\"modelName\":\"my-vl\",\"inputModalities\":[\"text\",\"image\"],\"outputModalities\":[\"text\"]}`; empty arrays go back to the upstream's). See [Routing](routing) for how candidates, priority and weight work.\n\n### Data protection\n\n```bash\n# Account switch and per-type actions\ncurl https://tare.jamerly.ai/v1/manage/dlp/policy \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\ncurl -X PUT https://tare.jamerly.ai/v1/manage/dlp/policy \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":true,\"types\":{\"EMAIL\":\"MASK\",\"TW_NATIONAL_ID\":\"BLOCK\"}}'\n\n# What custom rules can be built from\ncurl https://tare.jamerly.ai/v1/manage/dlp/capabilities \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Custom rules\ncurl \"https://tare.jamerly.ai/v1/manage/dlp/rules?scope=ALL\" \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\ncurl https://tare.jamerly.ai/v1/manage/dlp/rules \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"scope\":\"TENANT\",\"name\":\"Employee ID\",\"kind\":\"FORMAT\",\"format\":{\"prefix\":\"EMP-\",\"charset\":\"DIGITS\",\"length\":{\"min\":6,\"max\":6},\"boundary\":\"WORD\"},\"action\":\"MASK\"}'\ncurl -X PUT https://tare.jamerly.ai/v1/manage/dlp/rules/12 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":false}'\ncurl -X DELETE https://tare.jamerly.ai/v1/manage/dlp/rules/12 \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\"\n\n# Try a draft rule on sample text before saving\ncurl -X POST https://tare.jamerly.ai/v1/manage/dlp/rules/test \\\n  -H \"Authorization: Bearer $TARE_MANAGE_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"text\":\"Ticket from EMP-204811\",\"rule\":{\"name\":\"Employee ID\",\"kind\":\"FORMAT\",\"format\":{\"prefix\":\"EMP-\",\"charset\":\"DIGITS\",\"length\":{\"min\":6,\"max\":6},\"boundary\":\"WORD\"},\"action\":\"MASK\"}}'\n```\n\nPer-key skip settings are under `/v1/manage/dlp/keys/{keyId}/skip` and `/v1/manage/dlp/keys/{keyId}/skip/secret`, and the recommended rules under `/v1/manage/dlp/pack`, with the same bodies as in [Data protection (DLP)](security). The rule schema is in [Custom DLP rules](dlp-custom-rules).\n\n### Next steps\n\n- Write detection rules for your own identifiers: read [Custom DLP rules](dlp-custom-rules).\n- Know which customer an alert is about: read the webhook payload in [Alerts](alerts).\n- Issue one inference key per customer: read [Provisioning keys](provisioning).\n"}}