JWT Sign API
Create and sign JSON Web Tokens (JWT) via REST API. Provide a payload object and a secret key, and receive a signed HS256 JWT ready to use as a Bearer token, session token, or API key. Useful for testing JWT-based auth flows without setting up a full auth library.
Try it live →How it works
POST a JSON payload object and a secret string. The API signs the payload with HMAC-SHA256 (HS256), adds standard claims (iat, exp if you provide expiresIn), and returns the complete JWT string in three base64url-encoded parts.
Use cases
- Generate test JWTs for API endpoint testing in CI/CD pipelines
- Create service-to-service authentication tokens for microservices
- Issue short-lived tokens for one-time operations like email verification
- Prototype JWT-based auth flows before implementing a full auth library
API Reference
POST https://slopshop.gg/v1/crypto-jwt-sign
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input / data |
string | required | The input data to hash or process |
Example response
{
"data": {
"result": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"algorithm": "jwt-sign"
},
"meta": {
"credits_used": 1,
"engine": "real",
"ms": 4
}
}
Examples
Three real-world scenarios showing how developers use JWT Sign in production.
curl -X POST https://slopshop.gg/v1/crypto-jwt-sign \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"payload": {"user_id": 42, "role": "admin"}, "secret": "my-app-secret", "expiresIn": "24h"}'
curl -X POST https://slopshop.gg/v1/crypto-jwt-sign \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"payload": {"service": "billing", "scope": "read:invoices"}, "secret": "internal-secret", "expiresIn": "5m"}'
curl -X POST https://slopshop.gg/v1/crypto-jwt-sign \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"payload": {"email": "user@example.com", "action": "verify"}, "secret": "verify-secret", "expiresIn": "1h"}'
Code examples
curl
curl -X POST https://slopshop.gg/v1/crypto-jwt-sign \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "your data here"}'
Python
import requests
response = requests.post(
"https://slopshop.gg/v1/crypto-jwt-sign",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"input": "your data here"}
)
result = response.json()
print(result["data"])
Node.js
const response = await fetch("https://slopshop.gg/v1/crypto-jwt-sign", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);
CLI
# Install the Slopshop CLI
npm install -g slopshop
# Set your API key
export SLOPSHOP_KEY=your_api_key
# Call crypto-jwt-sign
slop crypto-jwt-sign '{"input": "your data here"}'
Pricing
Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.
Related APIs in Crypto & Security
View the full API catalog · Try in playground · Documentation