# agent402.tools JWT Sign

> agent402.tools JWT Sign is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Mints a signed HMAC JSON Web Token (HS256/HS384/HS512) from a payload and secret key

## Facts

- Endpoint: POST https://agent402.tools/api/jwt-sign
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-jwt-sign-b0be4741
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RNd4GWkndA3BI1WAgHFiv

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 agent402-tools-jwt-sign-b0be4741 -d '<json body>'
```

Example prompt: Sign a JWT using HS256 with the secret 'my-super-secret-key' and this payload: { "sub": "user_123", "role": "admin", "exp": 1800 }.

## When to prefer this

Use this endpoint when you need to programmatically mint HMAC-signed JWTs (HS256, HS384, HS512) without setting up a local crypto library. Ideal for agents that need to generate auth tokens, session tokens, or signed claims objects on-the-fly. Pairs naturally with jwt-decode and jwt-verify endpoints on the same platform. Choose this over RSA/EC signing endpoints when symmetric (shared-secret) signing is sufficient.

## Known failure modes

- Missing required 'secret' field returns 400 error
- Missing required 'payload' field returns 400 error
- Invalid algorithm string (not HS256/HS384/HS512) returns 400 error
- Payment not attached or insufficient USDC returns 402 error
- Malformed payload (non-object) may return 400 error

## How this service works

Mint a signed JSON Web Token (HMAC: HS256 default, HS384, HS512) from a payload + secret. Pairs with jwt-decode/jwt-verify to complete the trio. Deterministic - same payload, secret, and alg always produce the same token.

## Output

A signed JWT string (e.g. eyJhbGci...) that can be passed as a bearer token or verified later; deterministic — identical inputs always produce the same token.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "alg": {
   "type": "string",
   "description": "HS256 (default) | HS384 | HS512"
  },
  "secret": {
   "type": "string",
   "description": "HMAC signing secret"
  },
  "payload": {
   "type": "object",
   "description": "claims to encode (object)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "alg": "HS256",
  "token": "eyJhbGci..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-jwt-sign-b0be4741/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
