Paid Answers proxy via x402 pay-per-use (HTTP 402).
Prerequisites: This skill requires x402-payment. Complete the setup steps before first use.
RoleDomainAPI Providerhttps://www.cpbox.ioFacilitatorhttps://www.cppay.finance
http
POST /api/x402/answers
PAYMENT-SIGNATURE) -> 402 Payment Required with requirements JSONPAYMENT-SIGNATUREPAYMENT-SIGNATURE -> Server settles and returns responseWith @springmint/x402-payment or x402-sdk-go, payment is automatic.
Use CaseSkillWhyQuick factual answer (raw context)llm-contextSingle search, returns raw context for YOUR LLMFast AI answer with citations**answers** (single-search)streaming, citationsThorough multi-search deep research**answers** (research mode)Iterative deep research, synthesized cited answer
This endpoint ( /res/v1/chat/completions) supports two modes:
enable_citations.enable_research=true): Multi-iteration deep research with progress events and synthesized cited answer.bash
curl -X POST "https://www.cpbox.io/api/x402/answers" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "How does the James Webb Space Telescope work?"}],
"model": "default",
"stream": false
}'
bash
curl -X POST "https://www.cpbox.io/api/x402/answers" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "What are recent breakthroughs in fusion energy?"}],
"model": "default",
"stream": true,
"enable_citations": true
}'
bash
curl -X POST "https://www.cpbox.io/api/x402/answers" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Compare quantum computing approaches"}],
"model": "default",
"stream": true,
"enable_research": true,
"research_maximum_number_of_iterations": 3,
"research_maximum_number_of_seconds": 120
}'
bash
npx @springmint/x402-payment \
--url https://www.cpbox.io/api/x402/answers \
--method POST \
--input '{"messages":[{"role":"user","content":"How does the James Webb Space Telescope work?"}],"model":"default","stream":false}'
OpenAI-compatible chat.completions JSON + SSE streaming (pass-through).
FeatureSingle-Search (default)Research ( enable_research=true)SpeedFastSlowSearches1Multiple (iterative)StreamingOptional ( stream=true/false)Required ( stream=true)Citationsenable_citations=true (streaming only)Built-in (in <answer> tag)Progress eventsNoYes ( <progress> tags)Blocking responseYes ( stream=false)No
ParameterTypeRequiredDefaultDescriptionmessagesarrayYes-Single user message (exactly 1 message)modelstringYes-Use "default"``streamboolNotrueEnable SSE streamingcountrystringNo"US"Search country (2-letter country code or ALL)languagestringNo"en"Response languagesafesearchstringNo"moderate"Search safety level ( off, moderate, strict)max_completion_tokensintNonullUpper bound on completion tokensenable_citationsboolNofalseInclude inline citation tags (single-search streaming only)web_search_optionsobjectNonullOpenAI-compatible; search_context_size: low, medium, high
ParameterTypeRequiredDefaultDescriptionenable_researchboolNofalseEnable research moderesearch_allow_thinkingboolNotrueEnable extended thinkingresearch_maximum_number_of_tokens_per_queryintNo8192Max tokens per query (1024-16384)research_maximum_number_of_queriesintNo20Max total search queries (1-50)research_maximum_number_of_iterationsintNo4Max research iterations (1-5)research_maximum_number_of_secondsintNo180Time budget in seconds (1-300)research_maximum_number_of_results_per_queryintNo60Results per search query (1-60)
ConstraintErrorenable_research=true requires stream=true"Blocking response doesn't support 'enable_research' option"enable_research=true incompatible with enable_citations=true"Research mode doesn't support 'enable_citations' option"enable_citations=true requires stream=true"Blocking response doesn't support 'enable_citations' option"
x402-payment to handle the payment handshake automatically, especially for streaming ( stream=true).stream=false, single-search only)#Standard OpenAI-compatible JSON:
json
{
"id": "chatcmpl-...",
"object": "chat.completion",
"choices": [{"message": {"role": "assistant", "content": "The James Webb Space Telescope works by..."}, "index": 0, "finish_reason": "stop"}],
"usage": {"prompt_tokens": 10, "completion_tokens": 50, "total_tokens": 60}
}
SSE response with OpenAI-compatible chunks:
text
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"delta":{"content":"Based on"},"index":0}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"delta":{"content":" recent research"},"index":0}]}
data: [DONE]
enable_citations=true)TagPurpose<citation>Inline citation references<usage>JSON cost/billing data
TagPurposeKeep?<queries>Generated search queriesDebug<analyzing>URL counts (verbose)Debug<thinking>URL selection reasoningDebug<progress>Stats: time, iterations, queries, URLs analyzed, tokensMonitor<blindspots>Knowledge gaps identifiedYes<answer>Final synthesized answer (only the final answer is emitted; intermediate drafts are dropped)Yes<usage>JSON cost/billing data (included at end of streaming response)Yes
The <usage> tag contains JSON-stringified cost and token data:
text
<usage>{"X-Request-Requests":1,"X-Request-Queries":8,"X-Request-Tokens-In":15000,"X-Request-Tokens-Out":2000,"X-Request-Requests-Cost":0.005,"X-Request-Queries-Cost":0.032,"X-Request-Tokens-In-Cost":0.075,"X-Request-Tokens-Out-Cost":0.01,"X-Request-Total-Cost":0.122}</usage>
enable_research=true) for complex questions needing multi-source synthesis (e.g., "Compare approaches to nuclear fusion").base_url and api_key. Works with both sync and async clients.enable_citations=true in single-search mode for inline citation tags, or use research mode which automatically includes citations in its answer.messages array must contain exactly 1 user message<usage> tag from streaming responses to track costs