Skip to main content
POST
/
x402
/
v1
/
ask
Ask
curl --request POST \
  --url https://gateway.sanfoundation.com/x402/v1/ask \
  --header 'Content-Type: application/json' \
  --header 'Payment-Signature: <api-key>' \
  --data '
{
  "question": "What is the current state of US-China trade negotiations?"
}
'
{
  "answer": "<string>",
  "basis": [
    {
      "field": "<string>",
      "reasoning": "<string>",
      "citations": [
        {
          "url": "<string>",
          "title": "<string>",
          "excerpts": [
            "<string>"
          ]
        }
      ],
      "confidence": "<string>"
    }
  ]
}

Authorizations

Payment-Signature
string
header
required

Base64-encoded signed payment payload as defined by the x402 protocol. Omit on the first attempt to receive the 402 challenge in the PAYMENT-REQUIRED response header; include it on the retry to settle payment and receive the resource.

The legacy header name X-PAYMENT is also accepted by the server for backward compatibility — clients may send either, but Payment-Signature is preferred.

See x402.org for the on-the-wire shape of the PaymentRequired challenge and the settlement receipt returned in the PAYMENT-RESPONSE response header.

Body

application/json
question
string
required

The free-form question to answer.

Required string length: 1 - 4000

Response

OK — synthesized answer with field-level basis and citations.

answer
string
required

Synthesized factual answer to the submitted question.

basis
object[]
required

Field-level reasoning and citations supporting the answer.