Skip to main content
← Back to Docs
Node.js Quickstart

Sign your first AI output in 60 seconds

From plain Node.js (18+). Native fetch, no install needed. Multi-model. Designed for admissibility under FRE 902(13)/(14) self-authenticating digital evidence.

1. Get your API key

Sign up at certnode.io/sign-up if you don't have an account. Then create an API key from the dashboard. Free tier gives you 100 signings/month, no card required.

Get API key →

2. Set the API key in your environment

# .env (or set CERTNODE_API_KEY in your hosting env)
CERTNODE_API_KEY=cn_live_…

3. Sign an AI output

Save this as sign.mjs and run it with node sign.mjs:

const response = await fetch('https://certnode.io/api/v1/provenance/sign', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.CERTNODE_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    content: 'Hello from your AI model',
    model: 'claude-opus-4-7',
    contentType: 'ai_output',
  }),
})

const receipt = await response.json()

console.log('Receipt ID:', receipt.receiptId)
console.log('Verify URL:', receipt.verifyUrl)
console.log('Timestamps:', receipt.timestamps)  // CertNode + RFC 3161 + Bitcoin OTS chain

4. Verify the receipt

Open the verify URL in a browser. Anyone with the URL can verify the three-layer chain — no authentication needed. Verifications are always free.

Production tips

  • Use a test-mode key in CI. Keys prefixed with cn_test_ skip Stripe metering even for paid orgs. Set CERTNODE_API_KEY in CI to a test key, in prod to a live key.
  • Idempotency. The receipt ID is stable for a given content hash within the same minute. Calling sign() twice with the same content returns the same receipt.
  • Free-tier cap. If your org hits 100/mo without a payment method, the next call returns 402 with free_tier_exceeded. Add a payment method in the dashboard; metered billing kicks in at $0.01/signing with graduated volume discounts.

Next steps