# JWT Decode API

> JWT Decode API is a paid API for AI agents from api.bakhour.ca, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Decodes a JWT token and returns its header, payload, and signature verification status

## Facts

- Endpoint: GET https://api.bakhour.ca/jwt/decode
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/jwt-decode-api-5c01d17b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-Wv5DtKhJ30DN9HzIa97j

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 jwt-decode-api-5c01d17b
```

Example prompt: Can you decode this JWT for me and show me what's in the header and payload: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIn0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

## When to prefer this

Use this endpoint when you need a quick, serverless way to decode and inspect a JWT token's header and payload without setting up a local JWT library. Ideal for agents and automated workflows that encounter JWTs in API responses and need to extract claims like subject, expiry, or roles on the fly. Prefer this over implementing JWT parsing locally when operating in lightweight scripting environments or when you need a deterministic, paid utility call.

## Known failure modes

- Malformed or non-JWT string returns an error or unparseable response
- Missing required 'token' query parameter results in a validation error
- Invalid base64 encoding in token segments causes a decode failure
- Network or service unavailability returns a non-200 HTTP status
- Payment failure (402) if USDC payment header is missing or insufficient

## How this service works

Decision-grade security/due-diligence outcome reports ($20-$100) plus deterministic paid utilities ($0.001+) for software agents and automated workflows.

## Output

Returns a JSON object with three fields: 'header' (containing algorithm and token type), 'payload' (containing the decoded JWT claims such as sub, iat, exp, etc.), and 'signature_verified' (boolean indicating whether the signature was cryptographically verified).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token"
     ],
     "properties": {
      "token": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "header": {
   "alg": "HS256"
  },
  "payload": {
   "sub": "123"
  },
  "signature_verified": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/jwt-decode-api-5c01d17b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.bakhour.ca](https://www.zero.xyz/host/api.bakhour.ca/llms.txt)
