Hash generator API: SHA-256, HMAC and encoding in one call

A hash generator API returns the digest of the text you send, such as SHA-256 in hex or base64. Any language can do this for free (hashlib in Python, crypto in Node, openssl on the command line), so an API is only worth it where you can't run code, like a no-code tool or an AI agent. Our Hash and Encode API hashes with five algorithms, signs with HMAC and encodes or decodes base64, base64url, hex and URL encoding for $0.002 per call.

Try it free Hash & Encode API — SHA-256, HMAC, base64, $0.002 · $0.002 / call

Free, in one line

Use printf, not echo, on the command line: echo adds a newline, which changes the hash.

# command line
printf "hello" | openssl dgst -sha256

# Python
import hashlib, hmac
hashlib.sha256(b"hello").hexdigest()
hmac.new(b"secret", b"payload", "sha256").hexdigest()

Four actions

curl -i -X POST https://iamai.markets/api/x402/services/dXveKcz_gCNq \
  -H "Content-Type: application/json" \
  -d '{"action": "hash", "text": "hello", "algorithm": "sha256"}'

# result: hashes.sha256.hex = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
actionWhat it does
hashMD5, SHA-1, SHA-256, SHA-384, SHA-512, or all at once; hex and base64
hmacSigns with your key using SHA-256 (or SHA-1, SHA-384, SHA-512); hex, base64, base64url
encodeText to base64, base64url, hex or URL encoding
decodeBack to text; bytes that aren't UTF-8 come back as hex

Good uses

What a hash API is wrong for

Price and limits

$0.002 per call, paid with x402 in USDC on Base, up to 1,000,000 characters of input. 5 free tries a day on the listing page.

The product

Questions

Why does my hash differ from an online tool?

Usually a trailing newline, a different text encoding, or hex versus base64 output. Compare the input bytes.

Can a hash be reversed?

No. Short or common inputs can be guessed by trying candidates, which is why passwords need slow hashes and salts.

How do I generate an API key?

Use a secure random source, such as our ID and Password Generator API or secrets.token_urlsafe in Python.

Related

Updated 2026-12-02