Skip to content
POST AI agent ready /v1/jwt/generate

JWT Generate API - Free Signed Token Creator

Create a JWT with a custom payload, sign it with a secret key using HS256, and optionally set an expiration time in seconds.

Parameters

objectrequired

The claims object to include in the JWT.

stringrequired

The secret key used to sign the token.

number

Token expiry in seconds. Defaults to 3600 (1 hour).

Code examples

curl -X POST https://api.botoi.com/v1/jwt/generate \
  -H "Content-Type: application/json" \
  -d '{"payload":{"sub":"user_123","role":"admin"},"secret":"my-secret-key-123","expires_in":3600}'

When to use this API

Testing protected API routes

Generate JWTs with specific claims and expiry to test your API authorization logic without going through a full login flow.

Prototyping auth systems

Quickly create tokens with different roles (admin, editor, viewer) to prototype role-based access control before building a full auth service.

Frequently asked questions

Should I use this in production?
This endpoint is designed for testing and prototyping. In production, sign JWTs on your own server using your private key.
Which signing algorithm is used?
The API uses HS256 (HMAC-SHA256). Asymmetric algorithms like RSA or ECDSA are not supported.
How do I set the token expiry?
Pass expires_in as a number of seconds. For example, 3600 for 1 hour, 86400 for 1 day. If omitted, the token defaults to a 1-hour expiry.
Is the iat (issued at) claim added automatically?
Yes. The API automatically adds the iat claim with the current timestamp.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.