{"uid":"cap_t4U2Ka_j2WtEgjcMhIeTn","slug":"jwt-toolkit-sign-e0860182","name":"JWT Toolkit – Sign","description":"Mint a signed JSON Web Token from a JSON claims object, using a shared secret (HS*) or a PEM private key (RS/ES/PS). Supports expiresInSec, notBeforeSec, issuer, audience, subject and keyid. An unusable key or option is rejected before payment.","url":"https://jwt.openverbs.com/v1/sign","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["payload","key","algorithm"],"properties":{"key":{"type":"string","maxLength":16384,"minLength":1,"description":"The HMAC shared secret (HS*) or the PEM-encoded private key (RS/ES/PS)."},"keyid":{"type":"string","description":"Set the `kid` header."},"issuer":{"type":"string","description":"Set the `iss` claim."},"payload":{"type":"object","description":"The claims to encode (an object)."},"subject":{"type":"string","description":"Set the `sub` claim."},"audience":{"type":"string","description":"Set the `aud` claim."},"algorithm":{"enum":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512"],"type":"string","description":"Signing algorithm, one of HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512."},"noTimestamp":{"type":"boolean","description":"Omit the automatic `iat` claim."},"expiresInSec":{"type":"integer","minimum":0,"description":"Set `exp` this many seconds from now."},"notBeforeSec":{"type":"integer","minimum":0,"description":"Set `nbf` this many seconds from now."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_bt1u2dViuxcaa_Xg78S80","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Signs a JSON payload as a JWT using a specified algorithm and key, returning a signed token with configurable claims.","exampleAgentPrompt":"Sign a JWT using HS256 with the secret key 'my-super-secret-key', set the issuer to 'myapp.com', subject to 'user-42', audience to 'api.myapp.com', and make it expire in 3600 seconds.","exampleUseCases":[{"title":"Issuing short-lived API access tokens","prompt":"Create a signed JWT using RS256 with my PEM private key, set the issuer to 'auth.myservice.io', subject to 'client-789', and make it expire in 900 seconds — don't include the timestamp."},{"title":"Generating user session tokens","prompt":"Sign a JWT with HS512 using the shared secret 'ultrasecretpassphrase', include the claims {userId: 'usr_001', role: 'admin'}, set the audience to 'dashboard.app', and have it expire in 86400 seconds."},{"title":"Minting tokens for microservice-to-microservice auth","prompt":"I need a JWT signed with ES256 using my PEM-encoded EC private key, with issuer 'service-orders', subject 'service-payments', kid set to 'key-v3', and expiry in 300 seconds."}],"resultDescription":"The endpoint returns a signed JWT string (compact serialization: header.payload.signature) that encodes the provided claims, ready to be used as a Bearer token or passed to any JWT-aware service for verification.","failureModes":["Invalid or mismatched key for the chosen algorithm (e.g. passing an HMAC secret for RS256) returns a signing error","Malformed PEM-encoded key returns a key parsing error","Missing required fields (payload, key, algorithm) returns a validation error","Unsupported algorithm value returns an enum validation error","Key too short for the selected algorithm may return a security constraint error","Payment not attached or insufficient USDC balance returns a 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need to programmatically sign JWTs server-side without managing a local crypto library, or when running in an agent/serverless context where importing jsonwebtoken or similar is inconvenient. It supports the full suite of HMAC, RSA, ECDSA, and RSASSA-PSS algorithms. Prefer this over a full auth server when you only need token minting, not a complete identity management solution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:30:22.634Z","isFirstParty":false}