---
title: "Register an agent key (optional)"
method: POST
path: "/agent/key"
tags: ["agent"]
---

# Register an agent key (optional)

`POST /agent/key`

## Request

- Base URL: `https://xmrtousdc.xyz/api/v1`
- URL: `https://xmrtousdc.xyz/api/v1/agent/key`
- Auth: none declared

Optional. Issues a key that identifies the agent; quotes made with it use the agent fee shown in GET /agent/key and swapper://trust, and so do the orders created from them. Body { agent (self-declared name, required), contact?, purpose? }: stored and shown to the operator (data retention: /privacy). Returns data.agentKey (shown once; only its SHA-256 is stored), data.keyId, data.feePercent and data.standardFeePercent. Send the key as the x-agent-key header (or agentKey) on POST /agent/swap/quote. A key grants no other access.

## Request body

- object
  - `agent` string, required
  - `contact` string
  - `purpose` string

## Response `201`

Key issued

- AgentKeyResponse
  - `ok` true
  - `operation` 'agent.key'
  - `state` 'issued'
  - `data` object
    - `agentKey` string: Shown once; keep it private. Only its SHA-256 is stored.
    - `keyId` string
    - `agent` string: The self-declared name, as stored.
    - `feePercent` number
    - `standardFeePercent` number
    - `createdAt` string, date-time
    - `use` string
    - `note` string

## Other responses

- `400`: invalid_request: agent (2 to 64 characters) is required.
- `415`: unsupported_media_type: the body must be JSON (content-type: application/json).
- `429`: rate_limited: keys per address per hour; reuse your key.
- `503`: agent_keys_unavailable: keys are not offered on this deployment; quote without a key.

---

[API](https://skmtc.dev/xmrtousdc/apis/swapper-agent-api.md) · [All operations](https://skmtc.dev/xmrtousdc/apis/swapper-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/xmrtousdc/apis/swapper-agent-api/revisions/9f4252126907?raw)
