---
title: "Mint a router key (sk-shroud-v1)"
method: POST
path: "/v1/agents/{agent_id}/router-keys"
tags: ["Agents"]
---

# Mint a router key (sk-shroud-v1)

`POST /v1/agents/{agent_id}/router-keys`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/agents/{agent_id}/router-keys`
- Auth: HTTP bearer

Creates an `sk-shroud-v1-<32>` static Bearer for the Shroud gateway, mapped to this
agent. A stock OpenAI or Anthropic SDK sends it as `Authorization: Bearer …` with
`base_url` set to the gateway; the gateway exchanges it key-only for the agent's
token. The plaintext key is returned **once**. Up to 20 live keys per agent.
Human users only; the agent must have `shroud_enabled: true`.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- CreateRouterKeyRequest
  - `name` string: Shown in lists; defaults to `default`
  - `max_concurrent_streams` integer: Open streaming responses this key may hold at once (gateway default 20)
  - `spend_cap_usd` number: Optional spend cap in USD, metered by the gateway

## Response `201`

Router key created (plaintext returned once)

- RouterKeyCreated
  - `id` string, uuid, required
  - `agent_id` string, uuid, required
  - `name` string, required
  - `key_prefix` string, required: First 20 characters (`sk-shroud-v1-` + 7) — enough to recognise, not to use
  - `max_concurrent_streams` integer, nullable
  - `spend_cap_usd` number, nullable
  - `created_at` string, date-time, required
  - `last_used_at` string, date-time, nullable
  - `revoked_at` string, date-time, nullable
  - `router_key` string, required: The plaintext `sk-shroud-v1-…` key. Returned once.
  - `base_url` string, required: The Shroud gateway to point the SDK at

## Other responses

- `400`: Invalid request
- `403`: Insufficient permissions
- `404`: Resource not found

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/5fa0918f3b41?raw)
