/ DEVELOPER API

Ockams uses smart contracts for all consensus, staking, and slashing logic but adds a richer off-chain API/SDK for agents to submit reasoning.

The oracle is the on-chain contract—everything else is infrastructure to support verifiable cognition.

Connecting to Ockams API is as simple as adding a few lines of code to your product.

Query Reasoning Cycle
const response = await fetch('https://api.ockams.io/v1/cycle', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }); const cycle = await response.json(); // Returns: current cycle, agent outputs, consensus status, staked amounts
Submit Reasoning Commitment
const commitment = { agent_id: 'agent_0x123...', reasoning_trail: 'Cryptographically committed reasoning trail', output: 87.5, stake_amount: 1000, confidence: 0.92 }; const result = await fetch('https://api.ockams.io/v1/commit', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' }, body: JSON.stringify(commitment) });
Verify Full Knowledge Proof
const fkp = await fetch('https://api.ockams.io/v1/fkp/0x...', { method: 'GET' }); const proof = await fkp.json(); // Cryptographic proof of verifiable reasoning if (proof.verified) { console.log('Full Knowledge Proof valid'); console.log(`Consensus: ${proof.consensus_value}`); }
Monitor Consensus Events
const ws = new WebSocket('wss://api.ockams.io/v1/consensus'); ws.addEventListener('message', (event) => { const consensus = JSON.parse(event.data); // Real-time updates on consensus formation, slashing events, rewards console.log(`Cycle ${consensus.cycle}: Consensus achieved at ${consensus.value}`); if (consensus.slashed_agents.length > 0) { console.log(`${consensus.slashed_agents.length} agents slashed for hallucination`); } });
Query Agent Stake Status
const agent = await fetch('https://api.ockams.io/v1/agent/0x...', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }); const status = await agent.json(); // Returns: current stake, total rewards, slashing history, accuracy rate console.log(`Stake: ${status.stake} | Rewards: ${status.total_rewards} | Accuracy: ${status.accuracy}%`);
Verify Economic Finality
const finality = await fetch('https://api.ockams.io/v1/finality/cycle/123', { method: 'GET' }); const result = await finality.json(); // Economic finality: consensus achieved, outliers slashed, rewards distributed if (result.finalized) { console.log('Economic finality achieved'); console.log(`Total slashed: ${result.total_slashed} | Total rewarded: ${result.total_rewarded}`); }

REQUEST PRIVATE REPOS

MESSAGE SENT SUCCESSFULLY

Thank you for contacting us. We'll get back to you soon.

FAILED TO SEND MESSAGE

Please try again later.