POST /v1/agents/{agent_id}/invoke. The gateway runs a series of policy checks—provider status, blocklist, authentication, region, cost, and risk—and then forwards your request to the agent’s registered endpoint as an A2A SendMessage JSON-RPC call. The call blocks until the agent responds and returns the result directly in the HTTP response.
Basic Invocation
200 OK:
raw field contains the unmodified A2A JSON-RPC response from the agent for debugging or advanced parsing.
Request Fields
Free-text message to send to the agent. Serialized as an A2A
text message part.Structured data payload. Serialized as an A2A
data message part alongside message if both are provided.Bearer token for the agent. Required when the agent’s
securitySchemes declares any scheme other than none. The gateway passes this as an Authorization: Bearer header to the agent endpoint.ID of a stored auth context registered via
/v1/auth-contexts/register. Use this instead of auth_token to avoid passing raw credentials in every request. The gateway resolves the stored token at invocation time.ISO 3166-1 alpha-2 country code (e.g.
"AU", "US"). Required when the agent’s review profile has a non-empty allowed_regions list. The gateway rejects the call if the region does not match.Must be
true to invoke agents with risk_level: "high". Provides an explicit acknowledgement that the caller understands the risk.Maximum cost units the caller is willing to pay. If the agent’s declared
cost field in its agent card exceeds this value, the gateway rejects the call before forwarding.A2A task ID to continue an existing task. Maps to the
taskId field in the A2A SendMessage payload.A2A context ID for multi-turn conversations. Maps to
contextId in the A2A payload.Target a specific skill on the agent. Maps to
skillId in the A2A payload. If omitted, the agent chooses the default skill.Optional payment settlement request forwarded to the agent via the A2A
extensions field. See Settlement (x402) below.Arbitrary extension data forwarded to the agent in the A2A
extensions.agent_envelope field. Use this to pass caller identity, source agent cards, or custom context.Response Fields
The agent that was invoked.
A2A task state string from the agent response. Common values:
TASK_STATE_COMPLETED, TASK_STATE_WORKING, TASK_STATE_FAILED, TASK_STATE_UNKNOWN.ServiceNet execution receipt ID. Use
GET /v1/receipts/{receipt_id} to fetch the stored receipt and its verification status.The A2A task ID returned by the agent. Pass this in subsequent invocations to continue the task.
The A2A context ID returned by the agent.
The last text message part extracted from the agent’s response.
The first data artifact part extracted from the agent’s response. For agents that return structured data, this is the primary result field.
The normalized settlement request forwarded to the agent, if one was provided.
Payment receipt extracted from the agent’s response artifacts, if present.
The full, unmodified A2A JSON-RPC response body from the agent.
Policy Enforcement
The gateway runs the following checks in order before forwarding the call. Any failure returns403 Forbidden immediately.
Provider status
The agent’s provider must exist and not be in
revoked status. Revoked providers cannot serve invocations.Provider blocklist
The provider must not be on the trust blocklist. Blocked providers are prevented from serving calls while an investigation is open.
Agent blocklist
The agent itself must not be blocked. Individual agents can be blocked without affecting other agents under the same provider.
Authentication check
If the agent’s
securitySchemes declares any scheme other than none, either auth_token or auth_context_id must be present. A missing token results in a 403 with "auth token or auth context is required".Region check
If the agent’s review profile has a non-empty
allowed_regions list, the region field must be present and match one of the allowed values (case-insensitive). A missing or mismatched region results in 403.Cost check
If
max_cost_units is provided in the request (or a default is configured on the node via SERVICENET_GATEWAY_MAX_COST_UNITS), and the agent’s declared cost field in its agent card exceeds that limit, the gateway returns 403 with "agent cost exceeds caller budget".Settlement (x402)
Thesettlement field allows you to attach a Web3 payment alongside the invocation. The gateway normalizes the request and forwards it to the agent inside the A2A extensions.settlement field.
x402 rail on the web3 layer. The request object is passed through to the agent after normalization (adding a "protocol": "x402" field if absent).
web2 settlement rails are not yet implemented. Submitting a web2 settlement request returns 403 Forbidden.Error Reference
| HTTP Status | Condition |
|---|---|
403 Forbidden | Provider revoked or blocked; agent blocked; auth token missing; region not allowed; cost exceeded; high-risk not confirmed |
404 Not Found | Agent not found in the published registry |
502 Bad Gateway | The downstream agent returned an HTTP error, a non-JSON body, or an A2A error object; or the connection timed out or was refused |