La documentation est disponible en anglais.

Documentation / A2A deep dive

A2A Gateway — Introduction

TokenSaver exposes a governed Agent-to-Agent (A2A) proxy: clients send JSON-RPC 2.0 to /a2a/v1/{agent_id}, TokenSaver handles auth, PII scan, audit, lineage, and optional pipeline routing. Authenticate with your TokenSaver API key (ts_…) or an OAuth access token with scope a2a:invoke.

What it does

The A2A Gateway is the third data-path proxy alongside the OpenAI/Anthropic LLM surfaces and the MCP Trust Gateway. Each registered agent is reachable at a stable URL on TokenSaver; upstream agent URLs and credentials stay server-side.

Base URL pattern

https://api.tokensaver.fr/a2a/v1/{agent_id}

Replace {agent_id} with the identifier you registered via POST /api/v1/a2a/agents. Clients discover capabilities through the proxied Agent Card.

Routing by JSON-RPC method

Method family Treatment
message/send, message/stream PII pre-scan, then pipeline LLM (routing_kind=pipeline) or forward (forward)
GetTask, ListTasks, tasks/* Transparent forward to upstream agent URL
SendStreamingMessage (A2A v1) SSE stream forward

Quick start

# Register an agent (dashboard API)
curl -X POST https://api.tokensaver.fr/api/v1/a2a/agents \
  -H "Authorization: Bearer ts_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "demo-agent",
    "upstream_url": "https://upstream.example/a2a",
    "routing_kind": "forward"
  }'

# Invoke (JSON-RPC)
curl -X POST https://api.tokensaver.fr/a2a/v1/demo-agent \
  -H "Authorization: Bearer ts_your_key" \
  -H "X-Tokensaver-Execution-Trace-Id: exec_demo_001" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"GetTask","id":"1","params":{"id":"task-1"}}'