x402 Inference
Chat Completion
Paid chat completion, streamed as server-sent events
POST
Runs one chat completion against the selected Dolphin model. This endpoint is x402-protected: unpaid requests receive
402 Payment Required, and paid requests must include the X-PAYMENT header.
Headers
Must be
application/json.Base64-encoded signed x402 payment payload. Omit on the first request to
receive the payment requirements via a 402 response.
Body
Conversation history as an array of
{ role, content } objects. Roles are
user and assistant. Must be non-empty.Model ID. Must be one of the IDs returned by
GET /v1/inference/models. Invalid values return
400 with the supported list.Prompt template. Must be one of the names returned by
GET /v1/inference/templates. Invalid values
return 400 with the supported list.Response
On success (200), the completion is streamed as text/event-stream. Each event is an OpenAI-style chunk; concatenate choices[0].delta.content across chunks to build the full reply. Settlement details (including the transaction hash) are returned in the X-PAYMENT-RESPONSE header.