Loading…
Loading…
Record your agent's input, output and model metadata through one API. Return a verification link with every result.
Name a key for your service. Copy it once and store it in PROOFAPI_API_KEY on your server.
Get an API keyexport PROOFAPI_API_KEY="YOUR_KEY"$env:PROOFAPI_API_KEY="YOUR_KEY"The proofapi package on npm. Install it in your server application, not in the browser.
npm install proofapiUse the response from your existing AI provider. ProofAPI records it; it doesn't generate another answer.
import { ProofAPI } from 'proofapi';
const proofapi = new ProofAPI({
apiKey: process.env.PROOFAPI_API_KEY,
});
// input and answer come from your application
const record = await proofapi.seal({
input: 'Classify support ticket #42',
output: 'billing',
model: 'your-model',
label: 'support-agent',
});
console.log(record.status, record.certificateUrl);Text mode stores input/output in downloadable evidence. Use sample data here; use hash-only mode for confidential content.
Try the PlaygroundOpen certificateUrl or call verify(id). ANCHORED means the seal was recorded; PENDING_CHAIN means recording is incomplete.
const verification = await proofapi.verify(record.id);
console.log(verification.result.status);
// VERIFIED | FAILED | NOT_ON_CHAIN
const evidence = await proofapi.evidence(record.id);Send only locally computed SHA-256 fingerprints. Keep the original bytes and salt so you can prove the content later.
import { createHash, randomBytes } from 'node:crypto';
const salt = randomBytes(32); // keep the salt and original bytes
const hash = (text: string) => createHash('sha256')
.update(Buffer.concat([salt, Buffer.from(text)])).digest('hex');
const record = await proofapi.sealHashes({
inputHash: hash(input), outputHash: hash(answer),
metadataHash: hash(JSON.stringify({ model: 'your-model' })),
});Agents in Claude, Cursor and other MCP clients can seal their own answers without code. Add the server to the client's MCP settings; it gives the agent four tools: seal_answer, seal_hashes, verify_record and get_evidence.
{
"mcpServers": {
"proofapi": {
"command": "npx",
"args": ["-y", "-p", "proofapi", "proofapi-mcp"],
"env": { "PROOFAPI_API_KEY": "pk_live_..." }
}
}
}Without a key, anonymous demo limits apply. Agents and tools can also read the API description at /llms.txt and /openapi.json.
curl -X POST https://proofapi.vercel.app/api/v1/seal -H "Authorization: Bearer $PROOFAPI_API_KEY" -H "Content-Type: application/json" -d '{"input":"Classify ticket #42","output":"billing","model":"your-model"}'Beta runs on Solana devnet. Local memory mode simulates recording. A seal proves integrity, not AI accuracy or the identity of the declared model.
import { ProofAPIError } from 'proofapi';
try {
const record = await proofapi.seal({ input, output: answer });
if (record.status === 'PENDING_CHAIN') {
// Record saved; wait for anchoring before relying on it.
}
} catch (error) {
if (error instanceof ProofAPIError) {
console.error(error.status, error.code);
// 400 validation, 401 key, 429 limit, 500/503 service
}
// No automatic retries for writes: avoid duplicate records.
}const proofapi = new ProofAPI({
apiKey: process.env.PROOFAPI_API_KEY,
baseURL: 'http://127.0.0.1:3000', // local server only
timeoutMs: 65000,
});