mint_key
Agent self-serve API key issuance. An autonomous agent that has no email inbox can obtain a free-tier API key by proving it holds the MACHINE_MINT_SECRET via HMAC-SHA256. Returns a usable key immediately with no human action required.
EXAMPLE USER QUERIES THAT MATCH THIS TOOL: user: "I need an API key to call AgentBroker tools" -> call mint_key({"agent_id": "my-agent-abc123", "timestamp": 1725100000, "nonce": "4f8a2c1d", "signature": "<HMAC-SHA256(agent_id+timestamp+nonce, MACHINE_MINT_SECRET)>"})
WHEN TO USE: Use when an AI agent needs to self-provision a write-capable API key without a human email address. The caller must know the MACHINE_MINT_SECRET (available from hatchloop.dev/docs/#machine-mint). WHEN NOT TO USE: Do not use if the agent has a human operator who can complete the email flow at /keys/request. Do not use for paid plans — this endpoint issues free-tier keys (100 ops/day) only. COST: free - no key required LATENCY: ~100ms
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nonce | Yes | Random value (UUID or hex). Prevents replay attacks — use a fresh nonce each call. | |
| agent_id | Yes | A stable unique identifier for this agent (e.g. a UUID). The issued key is deterministically tied to this ID. | |
| signature | Yes | HMAC-SHA256(agent_id + str(timestamp) + nonce, MACHINE_MINT_SECRET) as lowercase hex. The HMAC input is the raw concatenation with no separators. | |
| timestamp | Yes | Unix epoch seconds at signing time. Must be within 60s of server time. |