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

Sign your first AI output in 60 seconds

From a Next.js App Router route handler. Server-side, 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. Add the API key to your Next.js env

# .env.local
CERTNODE_API_KEY=cn_live_…

3. Sign an AI output from a route handler

Drop this into app/api/sign/route.ts:

import { NextRequest, NextResponse } from 'next/server'

export async function POST(req: NextRequest) {
  const { aiOutput, model } = await req.json()

  const r = 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: aiOutput,
      model,
      contentType: 'ai_output',
    }),
  })

  const receipt = await r.json()
  // receipt.receiptId  — UUID for the signed evidence
  // receipt.verifyUrl  — public verification page anyone can hit
  // receipt.timestamps — three-layer chain: CertNode + RFC 3161 + Bitcoin OTS

  return NextResponse.json(receipt)
}

4. Test it

curl -X POST http://localhost:3000/api/sign \
  -H "Content-Type: application/json" \
  -d '{"aiOutput":"Hello from Claude","model":"claude-opus-4-7"}'

You'll get back a receipt with a verify URL. Open it in a browser — anyone with the URL can verify the three-layer chain without authentication.

Next steps