Skip to content

The API and gRPC

Two SDKs, one protocol. Inference and payment messages travel on separate streams over the same client connection.

How the SDKs connect

The Python agent SDK connects to a Python or Rust provider SDK using gRPC over HTTP/2 and TLS. One client connection carries separate streams for inference and payments. Your prompts and responses remain JSON inside the protocol's typed messages.

RPCDirectionCarries
/mppi.v1.Chat/CompletionsServer streaming · CompleteA signed request envelope, preserved inference JSON bytes and a final Terminal.
/mppi.v1.Control/SessionBidirectional · ControlUnpaid setup, authenticated attachment, vouchers, meters, receipts, funding guidance and close messages.

Complete carries each request and its output. Control carries payment messages, without prompts or generated text. Concurrent requests use separate Complete streams and share the funded session.

Reusing the connection and session lets payments progress alongside inference, with accumulated usage collected on-chain. There is no new settlement transaction for every request. Actual performance still depends on the network, queues and inference engine.

The final inference result and payment receipt arrive on different streams. Either can arrive first or be lost. Payment recovery cannot recreate missing model output.

Coming from an HTTP API

ConcernCommon HTTP inference integrationMPPI
Calling conventionHTTP JSON request; JSON response or SSE stream.SDK calls over native gRPC, with preserved JSON inside typed envelopes.
Payment authorityOften an API key and an account billing arrangement.Funding wallet, fixed session signer and signed run/payment authorization.
During generationInference output and application-defined usage records.Complete carries output while Control coordinates authorization and accounting.
SettlementDetermined by the service's billing system.Eligible cumulative USDC capture from a funded session on Arc.
FailuresHTTP status and an application error body.gRPC status, payment details and, when established, a definitive terminal outcome.

This is a comparison with a common integration pattern. HTTP APIs can stream, use HTTP/2 and perform well. MPPI adds a shared inference payment protocol; it does not make every gRPC call faster than every HTTP API. Its public inference endpoint is not an ordinary /v1 HTTP endpoint.

The API and gRPC | Agent providers | MPPI Docs