Skip to main content
api.pinaivu.com is the developer-facing surface: each customer holds their own API key, and the gateway is intentionally stateless — no memory layer, no enclave, just a thin proxy in front of the coordinator. For the end-user chat product with built-in memory, see chat-relayer API.
Neither this gateway nor its caller ever talks to a node directly — the coordinator dispatches the job over its existing libp2p connection to the winning node and returns the final answer in one HTTP round trip.

Authentication

Required on every call to /v1/chat/completions. Issued per developer via the gateway’s key-management endpoints.

POST /v1/chat/completions

Request:
Response:
That’s the entire round trip — no node_url, no second call. The coordinator ran the auction, dispatched the job to the winning node over libp2p, and waited for the reply before responding.
This single-round-trip shape differs from earlier internal docs that described a 307-redirect / node_url flow — the gateway and chat-relayer both now do the node round trip server-side, so callers never see a node’s address or a dispatch token.

Encrypted mode (optional)

For prompt privacy from the operator, send client_x25519_pubkey_hex + messages_encrypted + messages_nonce instead of plaintext messages, using an ECDH scheme. Fetch the coordinator’s X25519 key from GET /enclave_health first. The gateway passes these fields through untouched.

Other routes (no auth required)

What a gateway client must persist

A gateway client never persists or sees a node’s address, a dispatch token, or anything node-specific — that’s fully internal to the coordinator.

On-chain verification

How the response you get back is independently verifiable on Sui, even though you never see the raw receipt directly