# Swift Bot Labs Toolbox – HMAC Signature Generator

> Swift Bot Labs Toolbox – HMAC Signature Generator is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Computes an HMAC signature for a message using a secret key and optionally verifies it against an expected signature, returning hex and base64 encodings.

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/hmac?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-hmac-signature-generator-fa51ca2d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_y2MrtZ-DHP_iiO1P_flLP

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability swift-bot-labs-toolbox-hmac-signature-generator-fa51ca2d -d '<json body>'
```

Example prompt: Compute an HMAC-SHA256 signature for the message 'order_id=12345&amount=99.99' using the secret key 'mysecretkey' and give me both the hex and base64 outputs.

## When to prefer this

Choose this endpoint when you need a quick, serverless, no-account HMAC computation or verification without standing up your own crypto infrastructure. Ideal for agents that need to sign payloads or verify webhook authenticity on demand, especially in x402 pay-per-call pipelines where persistent credentials are undesirable. Prefer over rolling your own crypto when auditability of the exact algorithm and encoding is important.

## Known failure modes

- Missing required 'key' or 'message' fields returns a validation error
- Invalid algorithm value (not sha1/sha256/sha384/sha512/md5) returns an error
- Key or message exceeding max length (4096 / 1MB) may be rejected
- Payment failure via x402 protocol returns 402 before processing
- Malformed expected signature (invalid hex or base64) may cause comparison to return false rather than error

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

A JSON object with ok:true, the tool name, and a result containing the HMAC as both a hex string and a base64 string, the algorithm used, and a 'matches' boolean (true/false if an expected signature was provided for comparison, null otherwise).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "maxLength": 4096
  },
  "message": {
   "type": "string",
   "maxLength": 1048576
  },
  "expected": {
   "type": "string",
   "maxLength": 512,
   "description": "Optional signature to compare (hex or base64, optional \"sha256=\" prefix)"
  },
  "algorithm": {
   "enum": [
    "sha1",
    "sha256",
    "sha384",
    "sha512",
    "md5"
   ],
   "type": "string",
   "default": "sha256"
  },
  "keyEncoding": {
   "enum": [
    "utf8",
    "hex",
    "base64"
   ],
   "type": "string",
   "default": "utf8"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "hmac",
  "result": {
   "hex": "6f0c0b5b...",
   "base64": "bwwLW...",
   "matches": null,
   "algorithm": "sha256"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-hmac-signature-generator-fa51ca2d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
