{"uid":"cap_RNd4GWkndA3BI1WAgHFiv","slug":"agent402-tools-jwt-sign-b0be4741","name":"agent402.tools JWT Sign","description":"Mint a signed JSON Web Token (HMAC: HS256 default, HS384, HS512) from a payload + secret. Pairs with jwt-decode/jwt-verify to complete the trio. Deterministic - same payload, secret, and alg always produce the same token.","url":"https://agent402.tools/api/jwt-sign","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"alg":{"type":"string","description":"HS256 (default) | HS384 | HS512"},"secret":{"type":"string","description":"HMAC signing secret"},"payload":{"type":"object","description":"claims to encode (object)"}}},"responseSchema":{"type":"json","example":{"alg":"HS256","token":"eyJhbGci..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_I5lj_giYMC3wdUUTPpXyi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Mints a signed HMAC JSON Web Token (HS256/HS384/HS512) from a payload and secret key","exampleAgentPrompt":"Sign a JWT using HS256 with the secret 'my-super-secret-key' and this payload: { \"sub\": \"user_123\", \"role\": \"admin\", \"exp\": 1800 }.","exampleUseCases":null,"resultDescription":"A signed JWT string (e.g. eyJhbGci...) that can be passed as a bearer token or verified later; deterministic — identical inputs always produce the same token.","failureModes":["Missing required 'secret' field returns 400 error","Missing required 'payload' field returns 400 error","Invalid algorithm string (not HS256/HS384/HS512) returns 400 error","Payment not attached or insufficient USDC returns 402 error","Malformed payload (non-object) may return 400 error"],"whenToPreferThis":"Use this endpoint when you need to programmatically mint HMAC-signed JWTs (HS256, HS384, HS512) without setting up a local crypto library. Ideal for agents that need to generate auth tokens, session tokens, or signed claims objects on-the-fly. Pairs naturally with jwt-decode and jwt-verify endpoints on the same platform. Choose this over RSA/EC signing endpoints when symmetric (shared-secret) signing is sufficient.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:50:06.571Z","isFirstParty":false}