Agent API
Machine-readable documentation endpoint for AI agents to discover and learn the Gradience SDK.
Endpoint
GET /api/v1/docs → All documentation sections (JSON)
GET /api/v1/docs?section=arena → Specific section
GET /api/v1/docs?format=yaml → YAML formatResponse Schema
interface DocSection {
id: string; // "arena", "chain-hub", "a2a", "evm", "indexer"
title: string;
description: string;
endpoints?: [{ // REST API endpoints
method: string;
path: string;
description: string;
params?: Record<string, string>;
response: string;
}];
instructions?: [{ // Solana program instructions
name: string;
discriminator: number;
description: string;
accounts: string[];
}];
}Usage by AI Agents
// Agent discovers available APIs
const docs = await fetch('https://docs.gradiences.xyz/api/v1/docs');
const sections = await docs.json();
// Agent learns about Arena instructions
const arena = sections.find(s => s.id === 'arena');
console.log('Instructions:', arena.instructions.length);
// Agent generates code based on schema
for (const ix of arena.instructions) {
console.log(`${ix.name} (discriminator: ${ix.discriminator})`);
console.log(' Accounts:', ix.accounts.join(', '));
}Sections Available
| ID | Content |
|---|---|
arena | 10 Solana instructions |
chain-hub | 4 core instructions |
a2a | 4 core instructions |
indexer | 6 REST endpoints |
evm | 3 contract functions |