---
title: "Mint a scoped API key"
method: POST
path: "/v1/keys"
tags: ["Workspace"]
---

# Mint a scoped API key

`POST /v1/keys`

## Request

- Base URL: `https://ratchetgate.com`
- URL: `https://ratchetgate.com/v1/keys`
- Auth: HTTP bearer

Grant only the scopes an agent needs. A worker that performs effects needs effects:begin and effects:report, and nothing else.

## Request body

- object
  - `name` string, required
  - `scopes` string[]
  - `daily_budget_micros` integer, nullable: Hard ceiling on external spend this key may declare per UTC day.

## Response `201`

Default Response

- object

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid API key.
- `402`: Insufficient prepaid credit.
- `403`: Scope, policy, or budget refusal.
- `404`: Not found.
- `409`: Conflicting state or idempotency-key reuse.
- `413`: Payload too large.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/ratchetgate/apis/ratchet-api.md) · [All operations](https://skmtc.dev/ratchetgate/apis/ratchet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ratchetgate/apis/ratchet-api/revisions/5712f33c692f?raw)
