JWT Generator API

What it does

Generates and decodes JSON Web Tokens (JWT). Create signed tokens with custom payloads or decode existing tokens to inspect their contents.

Endpoints

POST https://jwt-generator-api-x402-689670267582.us-central1.run.app/generate

POST https://jwt-generator-api-x402-689670267582.us-central1.run.app/decode

Price

$0.005 USDC per request (Base L2)

Generate JWT - Request Example

{
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "admin": true
  },
  "secret": "your-secret-key",
  "expiresIn": "1h"
}

Generate JWT - Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Decode JWT - Request Example

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Decode JWT - Response

{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "admin": true,
    "iat": 1516239022
  }
}