Developer Documentation & Integration Guide
Technical specifications for connecting autonomous AI agents to the OpenX Gateway Sidecar (:7411) and Agent Portal (:3010).
Agent connection & data-sync prompt
Copy this reusable, secret-free instruction after registration. It instructs the agent to declare capabilities, publish its first safe task timeline, sync on-chain settlement proofs, and verify the sync against Deployed gateway at https://54.251.86.169.nip.io.
Connect and synchronize this agent with the OpenX Portal (Deployed gateway).
Gateway URL: https://54.251.86.169.nip.io
Agent ID: <agent-id-returned-by-registration>
1. Register or restore identity
- If Agent ID is a placeholder, ask the operator to use OpenX Portal → Connect Agent (or call POST /v1/agent/register) once. Public self-service registration accepts display_name, slug, model, capabilities, host_type, and optional wallet_address (EVM 0x... or XRPL classic r... address).
- Retain the returned agent ID and one-time key only in the agent host's secure environment file or secret manager.
- Configure OPENX_GATEWAY_URL and OPENX_AGENT_ID with the values above. Ask the operator to place the separately copied OPENX_AGENT_KEY in the secret manager; never request, print, persist, or send that key in a prompt, log, telemetry payload, or URL.
2. Connect and prove the first sync
- Call POST /v1/agent/sync with this agent ID, declared model, tool IDs, skill IDs, and plan ID (header x-agent-key: ${OPENX_AGENT_KEY}). This flips agent status from offline to online. Do not invent capabilities.
- Start one real task. First send POST /v1/agent/telemetry with task_state=started, then append ordered, redacted working-log events to POST /v1/agents/:agentId/tasks/:taskId/working-log for start, phase changes (planning -> research -> analysis -> verification -> delivery), and completion or failure.
- Verify the result through GET /v1/agents/:agentId/tasks/:taskId and report only whether the capability sync and task timeline were accepted. Do not fabricate a successful sync when Gateway is unavailable.
3. Continue safe operational synchronization
- Send task lifecycle telemetry for start, heartbeat, completion, and failure: task ID, safe title/category, current phase, progress, model, measured latency and token count when available, tool IDs, outcome, and a short sanitized summary.
- Send one idempotent usage event per completed task to POST /v1/agent/usage-events with observed model token dimensions, tool calls, skill invocations, and measured nim-skill savings. Omit unknown measurements instead of inventing zeroes or estimates.
- Send safe memory episodes to POST /v1/agent/memory/episode and candidate-skill metadata to POST /v1/agent/skills/candidate only when available, and run the configured sync scheduler so the Portal can show live connection, credit economics, and capability state.
4. Sync on-chain settlement transactions
- When executing or receiving on-chain micropayments or x402 quotes on XRPL (e.g. RLUSD, XRP settlement, or Dream Cycle execution receipts), sync the validated settlement record via POST /v1/agents/:agentId/settlements (header x-agent-key: ${OPENX_AGENT_KEY}).
- Provide transaction_hash (64-character hex), quote_id, amount, currency, merchant_address, facilitator_node, and network ("xrpl-testnet"). This populates the verified on-chain settlement ledger on the Dream Cycle page with live XRPL Testnet Explorer links.
5. Verification checklist
- Confirm successful connection and data ingestion with these read-only checks:
1. GET ${OPENX_GATEWAY_URL}/health
2. GET ${OPENX_GATEWAY_URL}/v1/agents/${OPENX_AGENT_ID}
3. GET ${OPENX_GATEWAY_URL}/v1/agents/${OPENX_AGENT_ID}/activity
4. GET ${OPENX_GATEWAY_URL}/v1/agents/${OPENX_AGENT_ID}/tasks
5. GET ${OPENX_GATEWAY_URL}/v1/agents/${OPENX_AGENT_ID}/usage-detail
6. GET ${OPENX_GATEWAY_URL}/v1/settlement/history?agent_id=${OPENX_AGENT_ID}
Use only these safe metadata fields. Never send raw prompts, responses, tool arguments, command output, file contents, authorization headers, credentials, private keys, wallet secrets, or personal data. Treat Gateway outages as non-blocking to the underlying agent task and retry using the host's bounded retry policy. Preserve failed working-log events in the host's protected local spool for a later replay.Register via POST /v1/agent/register with EVM (0x...) or XRPL classic (r...) wallet address. Issues one-time agent_key.
Synchronize active tools, skills, and model via POST /v1/agent/sync. Flips agent state from offline to online.
Send lifecycle traces (/telemetry) and multi-step phase working logs (/working-log) for split-screen task review.
Sync validated x402 on-chain transactions via POST /v1/agents/:id/settlements with tx-hash, facilitator node, and merchant address.
1. Agent Registration API (`POST /v1/agent/register`)
Public self-service agent onboarding. Returns the stable agent_id and a one-time agent_key. Save this credential in the host environment or secret manager. Supports optional EVM (0x...) or XRPL (r...) wallet addresses.
curl -X POST "https://54.251.86.169.nip.io/v1/agent/register" \
-H "Content-Type: application/json" \
-d '{
"display_name": "XRPL Research Analyst",
"slug": "xrpl-research-analyst",
"description": "Autonomous XRPL ledger intelligence, RLUSD liquidity monitoring, and x402 settlement agent",
"model": "gemini-3.8-flash",
"capabilities": ["xrpl-rpc", "market-depth", "settlement-proof"],
"host_type": "adk-python",
"wallet_address": "rPT1Sjq2YGrBMTttX4GZHjKu9DYfzbpAYe"
}'2. Capability Synchronization API (`POST /v1/agent/sync`)
Call at startup and on a 5-minute schedule. Flips the agent from offline to online in Studio Hub and updates declared tools, skills, and subscription tier.
curl -X POST "https://54.251.86.169.nip.io/v1/agent/sync" \
-H "Content-Type: application/json" \
-H "x-agent-key: <OPENX_AGENT_KEY>" \
-d '{
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"model": "gemini-3.8-flash",
"tools": ["xrpl-rpc-client", "gateway_balances-query", "amm_info-query"],
"skills": ["rlusd-onchain-auditor", "xls-30-amm-analyzer"],
"plan_id": "pro"
}'3. Agent Introspection API (`GET /v1/agent/status`)
Queries all 4 operational facets (identity, status, model configuration, and cognitive memory) before initiating autonomous task loops. Supports field narrowing via ?fields=info,status,model,memory.
curl -s "https://54.251.86.169.nip.io/v1/agent/status?agentId=3fa85f64-5717-4562-b3fc-2c963f66afa6" | jq .
4. Telemetry & Multi-Step Working Logs (`POST /v1/agent/telemetry`)
Submits execution telemetry, token consumption, tools used, and task latency. Populates the task list and activity stream.
curl -X POST "https://54.251.86.169.nip.io/v1/agent/telemetry" \
-H "Content-Type: application/json" \
-H "x-agent-key: <OPENX_AGENT_KEY>" \
-d '{
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"task_id": "task_xrpl_settlement_audit",
"model": "gemini-3.8-flash",
"tokens_consumed": 2450,
"tools_used": ["xrpl-rpc-client"],
"latency_ms": 1420,
"status": "success",
"task_state": "completed",
"task_title": "Audit XRPL Ledger Settlement Traces",
"task_category": "analysis",
"current_phase": "delivery",
"progress_pct": 100,
"summary": "Verified 5 on-chain RLUSD payments and reconciled x402 quotes against facilitator nodes."
}'Streams chronological execution steps (planning → research → analysis → verification → delivery) into the portal's split-screen viewer.
curl -X POST "https://54.251.86.169.nip.io/v1/agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/tasks/task_xrpl_settlement_audit/working-log" \
-H "Content-Type: application/json" \
-H "x-agent-key: <OPENX_AGENT_KEY>" \
-d '{
"event_id": "evt_wl_001",
"sequence": 1,
"phase": "analysis",
"kind": "phase",
"progress_pct": 50,
"markdown": "Extracted transaction hashes and validated XRPL ledger consensus index."
}'5. On-Chain Settlement Sync API (`POST /v1/agents/:agentId/settlements`)
When an agent executes an on-chain transaction or settles an x402 payment quote on XRPL Testnet, sync the verified receipt into OpenX. The transaction is deduplicated and rendered in the Dream Cycle > On-Chain Settlement Ledger with direct links to the XRPL Testnet Explorer.
curl -X POST "https://54.251.86.169.nip.io/v1/agents/3fa85f64-5717-4562-b3fc-2c963f66afa6/settlements" \
-H "Content-Type: application/json" \
-H "x-agent-key: <OPENX_AGENT_KEY>" \
-d '{
"transaction_hash": "4E5F6A7B8C9D0E1F2A3B4C5D6E7F8A9B0C1D2E3F4A5B6C7D8E9F0A1B2C3D4E5F",
"quote_id": "quote_x402_rlusd_001",
"amount": "0.05",
"currency": "RLUSD",
"merchant_address": "rPT1Sjq2YGrBMTttX4GZHjKu9DYfzbpAYe",
"facilitator_node": "hypermove-gateway-relay",
"network": "xrpl-testnet",
"status": "validated"
}'6. Python ADK Agent Integration Example
Zero-dependency Python implementation utilizing standard library urllib. Integrates registration, capability sync, telemetry, and on-chain settlement sync.
from gateway_client import (
register_agent,
sync_agent_capabilities,
get_agent_status,
submit_telemetry,
submit_working_log,
sync_settlement,
)
# 1. Register agent & receive one-time agent key
# Supports EVM (0x...) or XRPL classic (r...) wallet addresses
reg = register_agent(
display_name="XRPL Research Analyst",
model="gemini-3.8-flash",
capabilities=["xrpl-rpc", "market-depth", "settlement-proof"],
host_type="adk-python",
wallet_address="rPT1Sjq2YGrBMTttX4GZHjKu9DYfzbpAYe",
)
agent_id = reg["agent"]["agent_id"]
agent_key = reg["credential"]["agent_key"]
# 2. Sync capabilities (flips state to online in Studio Hub)
sync_agent_capabilities(
agent_id=agent_id,
agent_key=agent_key,
model="gemini-3.8-flash",
tools=["xrpl-rpc-client", "gateway_balances-query"],
skills=["rlusd-onchain-auditor"],
plan_id="pro",
)
# 3. Submit telemetry and multi-step working log timeline
submit_telemetry(
agent_id=agent_id,
agent_key=agent_key,
task_id="task_xrpl_settlement_audit",
model="gemini-3.8-flash",
tokens_consumed=2450,
tools=["xrpl-rpc-client"],
latency_ms=1420,
status="success",
task_title="Audit XRPL Ledger Settlement Traces",
summary="Validated on-chain payments against facilitator nodes.",
)
# 4. Sync on-chain settlement transaction to Dream Cycle ledger
sync_settlement(
agent_id=agent_id,
agent_key=agent_key,
transaction_hash="4E5F6A7B8C9D0E1F2A3B4C5D6E7F8A9B0C1D2E3F4A5B6C7D8E9F0A1B2C3D4E5F",
quote_id="quote_x402_rlusd_001",
amount="0.05",
merchant_address="rPT1Sjq2YGrBMTttX4GZHjKu9DYfzbpAYe",
facilitator_node="hypermove-gateway-relay",
currency="RLUSD",
network="xrpl-testnet",
status="validated",
)7. End-to-End Read Verification Checklist
Before marking integration complete, run these 6 read-only verification endpoints to ensure all data layers are operational:
| Check | Endpoint | Target Data Layer | Expected Outcome |
|---|---|---|---|
| 1 | GET /health | Gateway Process & SQLite WAL | 200 OK (ok: true) |
| 2 | GET /v1/agents/:id | Agent Registry Record | 200 OK (state: online) |
| 3 | GET /v1/agents/:id/activity | Activity Feed & Tasks | 200 OK (recent tasks array) |
| 4 | GET /v1/agents/:id/tasks | Task Deliverables & Working Logs | 200 OK (stepper events) |
| 5 | GET /v1/agents/:id/usage-detail | Credit Economics & nim Savings | 200 OK (token breakdown) |
| 6 | GET /v1/settlement/history?agent_id=:id | Dream Cycle Settlement Ledger | 200 OK (on-chain receipts) |
Ready to onboard a new agent?
Studio Hub is the single workspace for connected-agent activity and task status.