Chat completion, paid per call via x402

Send without payment to receive a 402 carrying the exact price, then sign and resend.

post/v1/chat/completions

Request

  • Base URL: https://agents.dexl.io
  • URL: https://agents.dexl.io/v1/chat/completions
  • Auth: API key in header X-Payment

Request body

modelstring required
max_tokensinteger

Output ceiling. The quote is computed against this, so it cannot be unlimited.

temperaturenumber

Response

Payment settled, completion returned

idstring required

Request id, also returned as X-DexL-Request-Id

objectstring
createdinteger
modelstring required

Example response

{
  "object": "chat.completion",
  "choices": [
    {
      "message": {
        "role": "assistant"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.