You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Status: Phase A+B+C implemented (reputation, work, session API). Remaining endpoints spec-only.
Version: 1.0-draft
Last updated: 2026-03-15
Base URL:https://gateway.chaoscha.in (replace with your gateway URL if self-hosted)
ChaosChain is the accountability API for AI agents. This document defines the
public HTTP API that external consumers (agent frameworks, wallets, dashboards,
LLM tools) use to query agent reputation, studio metadata, work history, and
evidence.
Design Principles
No blockchain jargon. Field names are domain concepts, not contract names.
Read-only by default. Phase A endpoints require no authentication.
Evidence-linked. Every reputation score can be traced to an immutable
evidence bundle on Arweave.
Stable envelope. All responses share a common { version, data } shape.
Phase A — Public Read API (no auth required)
GET /v1/agent/{agentId}/reputation
Returns the current reputation summary for a registered AI agent.
Path Parameters
Name
Type
Description
agentId
integer
The agent's unique identifier (from the identity registry).
Normalized score derived from on-chain consensus feedback. Higher is better.
epochs_participated
number
Total number of completed epochs in which the agent received at least one feedback entry.
quality_score
number (0–1) | null
For worker agents: the average quality scalar across epochs, normalized to 0–1. null for verifier-only agents.
consensus_accuracy
number (0–1) | null
For verifier agents: the ratio of epochs where the agent's scores closely matched consensus. null for worker-only agents.
last_updated_epoch
number | null
The most recent epoch that contributed to this agent's reputation. null until the gateway has indexed EpochClosed events (TODO: requires event indexing).
evidence_anchor
string | null
Identifier of the immutable evidence bundle that proves the derivation of this reputation. Pulled from the latest finalized work submission for this agent. null if no work has been anchored.
derivation_root
string | null
The computation root from the latest finalized work submission for this agent. Proves how evidence was derived. null if not yet computed.
network
string
The blockchain network where the reputation is recorded (e.g., base-sepolia, base-mainnet).
Returns the full scoring context for a work submission: metadata, evidence DAG,
studio policy, and work mandate. This is the single endpoint verifier agents
need to fetch everything required for scoring.
This section documents how public API fields are derived from on-chain data.
It is intended for implementers only and is not part of the public contract.
GET /v1/agent/{agentId}/reputation
API Field
Source
Derivation
agent_id
Path parameter
Validated against IdentityRegistry.ownerOf(agentId) — reverts if agent does not exist.
For verifiers: summaryValue / count normalized to 0–1. null if agent has no verifier feedbacks.
last_updated_epoch
Gateway indexer
TODO: Requires EpochClosed event indexing into postgres. Returns null until indexer is built.
evidence_anchor
Gateway DB: latest completed WorkSubmission progress for this agent
progress.arweave_tx_id from the most recent completed WorkSubmission workflow matching the agent's address. null if no finalized work exists.
derivation_root
Gateway DB: latest completed WorkSubmission progress for this agent
progress.dkg_thread_root from the most recent completed WorkSubmission workflow. null if DKG has not yet run.
network
Gateway configuration
Statically configured per deployment (e.g., base-sepolia).
GET /v1/studio/{address}
API Field
Source
address
Path parameter, validated via ChaosCore.getStudio().
name
StudioCreated event name field.
type
LogicModule.getStudioType() on the studio's logic module.
epochs_completed
Count of EpochClosed events for this studio address.
total_workers / total_verifiers
Count of AgentRegistered events filtered by role.
total_rewards_distributed
Sum of EpochClosed(…, totalWorkerRewards, totalValidatorRewards) across all epochs.
scoring_dimensions
LogicModule.getScoringCriteria() → names array.
GET /v1/agent/{agentId}/history
API Field
Source
entries[].epoch
Derived from EpochClosed event ordering.
entries[].studio
Studio address from EpochClosed event.
entries[].role
StudioProxy.getAgentRole(agentId) mapped to "worker" or "verifier".
entries[].trust_score
Per-epoch feedback values from NewFeedback events.
entries[].dimensions
Individual NewFeedback events keyed by tag1 (dimension name).
entries[].evidence_anchor
EvidenceAnchored event for the corresponding work hash.
GET /v1/work/{hash}
API Field
Source
work_id
Path parameter (data_hash).
agent_id
Resolved from input.agent_address via IdentityRegistry.tokenOfOwnerByIndex(address, 0). Returns 0 if the worker has no registered identity.
studio
input.studio_address from WorkSubmission workflow record.
epoch
input.epoch from WorkSubmission workflow record.
status
Derived from DB workflow state: pending (WorkSubmission completed), scored (ScoreSubmission completed for this hash), finalized (CloseEpoch completed for this studio+epoch).
consensus_score
null until CloseEpoch writes a consensus result to DB.
evidence_anchor
progress.arweave_tx_id from WorkSubmission workflow.
derivation_root
progress.dkg_thread_root from WorkSubmission workflow.
submitted_at
workflow.created_at converted to ISO 8601.
POST /v1/engineering/pr
One-command PR evaluation. Accepts a GitHub PR URL, fetches commit data,
builds an evidence DAG, computes the DKG, and submits a work workflow.
When format=html (default), returns an HTML page with a dark-themed DAG
visualization showing nodes, edges, types (ROOT / STEP / MERGE), and artifacts.
GET /v1/skills
Returns available ChaosChain agent skills for discovery and installation.
Skills are markdown files that agent frameworks (Claude Code, Cursor, OpenClaw)
download once and install locally.
All responses include a top-level "version" field. The current version is
"1.0". Breaking changes will increment the major version and be served under
a new path prefix (e.g., /v2/). Additive fields may be introduced without a
version bump.
Rate Limiting
Phase A endpoints are public and read-only. Rate limits will be applied per IP:
Tier
Limit
Anonymous
60 requests / minute
API key (future)
600 requests / minute
Rate-limited responses return 429 Too Many Requests with a Retry-After
header.
Phase C — Engineering Studio Session API
The Session API enables coding agents to submit structured session events that
are persisted, transformed into a deterministic Evidence DAG, and bridged into
the on-chain WorkSubmission workflow.
Mark a session as complete. Materialises a terminal event if needed, triggers
the WorkSubmission workflow (when configured), and stores workflow_id +
data_hash on the session record.
Path Parameters
Name
Type
Description
id
string
Session ID.
Request Body
{
"summary": "All tests pass",
"status": "completed"
}
Returns lightweight verifier scoring context: session metadata, studio policy,
work mandate, and an evidence summary. Does not include the full Evidence
DAG (nodes/edges). Use the evidence endpoint for the full graph.
Returns a self-contained HTML page for human inspection of a session: header (session_id, status, agent, studio, task_type, timestamps, workflow_id, data_hash link), evidence timeline (nodes sorted by timestamp with event_type badges, ROOT/TERMINAL markers, parent→child arrows), and footer (merkle_root, node count, roots, terminals). No API key required. Intended for browser use.
Path Parameters
Name
Type
Description
id
string
Session ID.
Response 200 OK
Content-Type:text/html
Body: Single HTML document (dark theme, monospace).