New The MCP server is live: all 45 APIs in Claude, Cursor or any MCP client. Connect your agent

Sign, verify, and decode JSON Web Tokens at the edge

JWT API

The JWT API is a production-grade JSON Web Token service running on a global edge network. Built on the battle-tested jose library with native WebCrypto, it lets you sign new tokens, cryptographically verify incoming ones, and decode any token for inspection — all without standing up your own auth infrastructure.

Supports the full range of algorithms used in production: symmetric HS256/HS384/HS512 (shared secret) and asymmetric RS256/ES256/PS256 (PEM PKCS8 to sign, PEM SPKI to verify). The verify endpoint enforces exp/nbf, issuer, and audience claims and guards against the classic JWT algorithm-confusion attack by pinning accepted algorithms to your key material.

Free tier included, no credit card required. One key works across every API.

At a glance

JWT API

1 credit / call
Free calls / month
1,000
Algorithms
6
Cold Path
<10ms
Uptime SLA
99.9%
Get your free API key

1,000 free calls on the free plan

Key features

  • Sign / mint tokens with automatic iat and flexible expiresIn durations
  • Cryptographic verification of signature and claims
  • Decode any token to inspect header and payload without verifying
  • Symmetric HS256/HS384/HS512 with shared secrets
  • Asymmetric RS256/ES256/PS256 with PEM keys
  • exp/nbf, issuer, and audience claim enforcement
  • Algorithm-confusion protection via accepted-algorithm pinning

Built for

  • Microservice and service-to-service authentication
  • API gateway token issuance and validation
  • Webhook signature verification
  • Stateless session and access tokens
  • Short-lived signed links and download URLs
  • Single sign-on and identity propagation
  • Token inspection and debugging during development
  • Offloading crypto from constrained or serverless clients

MCP · for your agent

Hand the JWT API to your agent

Connect Claude, Cursor or any MCP client once, then ask in plain words. Your agent finds this API, reads its docs and makes the call: 1 credit per call, the same as REST, from your team's balance.

Mint a token for testing

“Mint a 15-minute test token for user_42 with role 'admin', audience 'billing-api' and a unique ID, using our staging secret.”

list_apis · get_api_docsfree

api_request POST /jwt/v1/sign 1 cr

+ Developer Toolbox API1 cr

A signed HS256 token expiring in 15 minutes, with a fresh UUID as its jti claim.

Debug a rejected token

“Our API rejects this token with a 401. Verify it against the staging secret and tell me which check fails.”

list_apis · get_api_docsfree

api_request POST /jwt/v1/verify 1 cr

Whether it's valid, and if not, the exact reason: expired, bad signature, audience or issuer.

Inspect a token's claims

“What's inside the token from this failing mobile request? When was it issued, when does it expire, and what's the role?”

list_apis · get_api_docsfree

api_request GET /jwt/v1/decode?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzQyIn0.abc123 1 cr

Decoded header and claims with issue and expiry times as dates, marked as unverified.

$ claude mcp add --transport http apicodex https://mcp.apicodex.io

Illustrative asks; the calls and prices are real. Claude, Cursor, VS Code and Windsurf setup: mcp.apicodex.io

Try it

Build the request for your data

Edit the parameters below and see the exact request and curl command you'd send. No key required to preview.

POST /jwt/v1/sign
Open in Playground

Parameters

Request · HTTP
POST /jwt/v1/sign?apikey=YOUR_KEY HTTP/1.1
Host: api.apicodex.io
Content-Type: application/json

{
  "payload": { "sub": "user_42", "role": "admin" },
  "alg": "HS256",
  "secret": "super-secret-value",
  "expiresIn": "2h",
  "issuer": "https://auth.example.com",
  "audience": "my-app"
}
Response · JSON 200 OK
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzQyIn0.r3kY8Qw2..."
}

Documentation

JWT API Documentation

The JWT API exposes three endpoints: POST /v1/sign to issue tokens with automatic iat and flexible expiresIn durations, POST /v1/verify for full cryptographic validation of signature and claims, and GET /v1/decode to inspect any token without trusting it. Symmetric algorithms use a shared secret; asymmetric algorithms use PEM PKCS8 private keys to sign and PEM SPKI public keys to verify.

Base URL

url
https://api.apicodex.io/jwt

Authentication

Authenticate by passing your API key as the apikey query parameter, or by sending it in an X-Api-Key header:

headers
// Query parameter
https://api.apicodex.io/jwt/v1/sign?apikey=YOUR_KEY

// Header
{
  "X-Api-Key": "YOUR_API_KEY"
}

Request and response

Illustrative values. Confirm current endpoint behavior, quotas, and data freshness in the API documentation before production use.

request · http
POST /jwt/v1/sign?apikey=YOUR_KEY HTTP/1.1
Host: api.apicodex.io
Content-Type: application/json

{
  "payload": { "sub": "user_42", "role": "admin" },
  "alg": "HS256",
  "secret": "super-secret-value",
  "expiresIn": "2h",
  "issuer": "https://auth.example.com",
  "audience": "my-app"
}
response · json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzQyIn0.r3kY8Qw2..."
}

Code examples

cURL
curl --request POST \
  --url 'https://api.apicodex.io/jwt/v1/sign?apikey=YOUR_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "payload": { "sub": "user_42", "role": "admin" },
    "alg": "HS256",
    "secret": "super-secret-value",
    "expiresIn": "2h",
    "issuer": "https://auth.example.com",
    "audience": "my-app"
  }'

Endpoints

POST /v1/sign

Sign / mint a JWT. Supply a payload plus the key material for your chosen algorithm. iat is set automatically and expiresIn controls exp.

curl -X POST "https://api.apicodex.io/jwt/v1/sign?apikey=YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"payload":{"sub":"user_42"},"alg":"HS256","secret":"super-secret-value","expiresIn":"2h"}'

POST /v1/verify

Verify a JWT signature and claims. Returns valid:true with payload+header on success, or valid:false with error+code (HTTP 200) for a bad, expired, or claim-mismatched token.

curl -X POST "https://api.apicodex.io/jwt/v1/verify?apikey=YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"token":"eyJhbGci...","secret":"super-secret-value","algorithms":["HS256"]}'

GET /v1/decode

Decode a JWT WITHOUT verifying it. Returns the unverified header and payload plus a warning. Use only for inspection; never trust the data.

curl "https://api.apicodex.io/jwt/v1/decode?token=eyJhbGci...&apikey=YOUR_KEY"

Sign Parameters

Required parameters

  • payload Custom claims to embed as a JSON object. iat is set automatically.

Optional parameters

  • alg Signing algorithm: HS256, HS384, HS512, RS256, ES256, or PS256. Defaults to HS256.
  • secret Shared secret. Required for HS* algorithms.
  • privateKey PEM-encoded PKCS8 private key. Required for RS*/ES*/PS* algorithms.
  • expiresIn Duration string (e.g. '2h', '30m', '7d') or seconds-from-now. Takes precedence over any exp in payload.
  • issuer Value to set as the iss claim.
  • audience Value to set as the aud claim (string or array of strings).
  • subject Value to set as the sub claim.

Verify Parameters

Required parameters

  • token The compact JWS to verify.

Optional parameters

  • secret Shared secret. Required for HS* algorithms.
  • publicKey PEM-encoded SPKI public key. Required for RS*/ES*/PS* algorithms.
  • algorithms Array restricting accepted algorithms (defends against alg-confusion), e.g. ['HS256'].
  • issuer Expected iss claim; verification fails on mismatch.
  • audience Expected aud claim (string or array); verification fails on mismatch.

Pricing

JWT API Pricing

This API costs 1 credit per request. Credits are shared across every API on your plan.

Cost estimator

requests per month → cheapest plan that covers it

Estimate your monthly cost

Drag the slider to match your expected request volume. We'll recommend the cheapest plan that covers it.

10,000

Recommended plan

Starter

$29.99 /month

Credits used
Credits included
Cost per 1K requests
Choose Starter

Free

Free
1,000 credits · ~1,000 requests/mo · 2 rps
  • All APIs included
  • No credit card required
  • Full documentation and examples
  • MCP server for your AI agents
  • Up to 5 active API keys
Start for free

Starter

Popular
$29.99 /month
50,000 credits · ~50,000 requests/mo · 10 rps
  • All APIs included
  • Email support
  • Usage dashboard and analytics
  • MCP server for your AI agents
  • Up to 5 active API keys
Start with Starter

Pro

$99.99 /month
250,000 credits · ~250,000 requests/mo · 25 rps
  • All APIs included
  • Priority support
  • MCP server for your AI agents
  • Up to 5 active API keys
Start with Pro

Need a different plan?

Tell us about your API, volume, or support requirements.

Contact us

FAQ

Frequently asked questions

Ready to integrate JWT?