Gateway Endpoints
Gateway routes are mounted under /api/gateway/* and enforce auth/billing checks
before upstream proxying.
LLM Gateway
Section titled “LLM Gateway”Base route: /api/gateway/llm
| Method | Path |
|---|---|
POST | /api/gateway/llm/v1/chat/completions |
POST | /api/gateway/llm/v1/responses |
Search Gateway
Section titled “Search Gateway”Base route: /api/gateway/search
| Method | Path |
|---|---|
GET | /api/gateway/search/v1/web/search |
GET | /api/gateway/search/v1/news/search |
Usage Webhook and Usage View
Section titled “Usage Webhook and Usage View”Base route: /api/webhooks/usage
| Method | Path | Description |
|---|---|---|
POST | /api/webhooks/usage | ingest usage events |
GET | /api/webhooks/usage | read usage snapshot/records |
Copy/Paste Examples
Section titled “Copy/Paste Examples”LLM Proxy Request
Section titled “LLM Proxy Request”curl -X POST "$ROBERTO_API_URL/api/gateway/llm/v1/chat/completions" \ -H "x-api-key: $ROBERTO_AGENT_GATEWAY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "moonshotai/kimi-k2.5", "messages": [ {"role":"user","content":"Summarize today'\''s support incidents in 3 bullets."} ] }'Response shape is provider pass-through (OpenAI-compatible object).
Search Proxy Request
Section titled “Search Proxy Request”curl "$ROBERTO_API_URL/api/gateway/search/v1/web/search?q=robertoagent%20updates" \ -H "Authorization: Bearer $ROBERTO_AGENT_GATEWAY_TOKEN"Response shape is upstream search-provider pass-through.
Usage Webhook Ingest
Section titled “Usage Webhook Ingest”curl -X POST "$ROBERTO_API_URL/api/webhooks/usage?agentId=$AGENT_ID" \ -H "Content-Type: application/json" \ -H "x-idempotency-key: evt_123" \ -d '{ "messages": 2, "inputTokens": 540, "outputTokens": 180, "eventId": "evt_123" }'Example 200 response:
{ "success": true, "duplicate": false}Read Usage Snapshot
Section titled “Read Usage Snapshot”curl "$ROBERTO_API_URL/api/webhooks/usage?agentId=$AGENT_ID"Example 200 response:
{ "messages": 120, "inputTokens": 45200, "outputTokens": 19100, "totalTokens": 64300, "estimatedCost": "0.2345", "estimatedCostUsd": 0.2345, "eventCount": 85, "lastUpdated": "2026-02-21T12:00:00.000Z"}