Answers — AI Grounding
Paid Answers proxy via x402 pay-per-use (HTTP 402).
Prerequisites: This skill requires x402-payment. Complete the setup steps before first use.
Service URLs
| Role | Domain |
|---|
| API Provider | https://www.cpbox.io |
| Facilitator |
https://www.cppay.finance |
Endpoint (Agent Interface)
CODEBLOCK0
Payment Flow (x402 Protocol)
- 1. First request (no
PAYMENT-SIGNATURE) -> 402 Payment Required with requirements JSON - Client signs (EIP-712) -> INLINECODE2
- Retry with
PAYMENT-SIGNATURE -> Server settles and returns response
With @springmint/x402-payment or x402-sdk-go, payment is automatic.
When to Use
| Use Case | Skill | Why |
|---|
| Quick factual answer (raw context) | INLINECODE6 | Single search, returns raw context for YOUR LLM |
| Fast AI answer with citations |
answers (single-search) | streaming, citations |
| Thorough multi-search deep research |
answers (research mode) | Iterative deep research, synthesized cited answer |
This endpoint (/res/v1/chat/completions) supports two modes:
- - Single-search (default): Fast AI-grounded answer from a single search. Supports
enable_citations. - Research (
enable_research=true): Multi-iteration deep research with progress events and synthesized cited answer.
Quick Start (cURL)
Blocking (Single-Search)
CODEBLOCK1
Streaming with Citations (Single-Search)
CODEBLOCK2
Research Mode
CODEBLOCK3
Using with x402-payment
CLI (AI Agent)
CODEBLOCK4
Payload/Response
OpenAI-compatible chat.completions JSON + SSE streaming (pass-through).
Two Modes
| Feature | Single-Search (default) | Research (enable_research=true) |
|---|
| Speed | Fast | Slow |
| Searches |
1 | Multiple (iterative) |
| Streaming | Optional (
stream=true/false) |
Required (
stream=true) |
| Citations |
enable_citations=true (streaming only) | Built-in (in
<answer> tag) |
| Progress events | No | Yes (
<progress> tags) |
| Blocking response | Yes (
stream=false) | No |
Parameters
Standard Parameters
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE20 | array | Yes | - | Single user message (exactly 1 message) |
| INLINECODE21 |
string |
Yes | - | Use
"default" |
|
stream | bool | No | true | Enable SSE streaming |
|
country | string | No | "US" | Search country (2-letter country code or
ALL) |
|
language | string | No | "en" | Response language |
|
safesearch | string | No | "moderate" | Search safety level (
off,
moderate,
strict) |
|
max_completion_tokens | int | No | null | Upper bound on completion tokens |
|
enable_citations | bool | No | false | Include inline citation tags (single-search streaming only) |
|
web_search_options | object | No | null | OpenAI-compatible;
search_context_size:
low,
medium,
high |
Research Parameters
| Parameter | Type | Required | Default | Description |
|---|
| INLINECODE38 | bool | No | INLINECODE39 | Enable research mode |
| INLINECODE40 |
bool | No |
true | Enable extended thinking |
|
research_maximum_number_of_tokens_per_query | int | No |
8192 | Max tokens per query (1024-16384) |
|
research_maximum_number_of_queries | int | No |
20 | Max total search queries (1-50) |
|
research_maximum_number_of_iterations | int | No |
4 | Max research iterations (1-5) |
|
research_maximum_number_of_seconds | int | No |
180 | Time budget in seconds (1-300) |
|
research_maximum_number_of_results_per_query | int | No |
60 | Results per search query (1-60) |
Constraints (IMPORTANT)
| Constraint | Error |
|---|
| INLINECODE52 requires INLINECODE53 | "Blocking response doesn't support 'enableresearch' option" |
| INLINECODE54 incompatible with INLINECODE55 |
"Research mode doesn't support 'enablecitations' option" |
|
enable_citations=true requires
stream=true | "Blocking response doesn't support 'enable_citations' option" |
Notes for Agent Usage
- - Use
x402-payment to handle the payment handshake automatically, especially for streaming (stream=true).
Response Format
Blocking Response (stream=false, single-search only)
Standard OpenAI-compatible JSON:
CODEBLOCK5
Streaming Response
SSE response with OpenAI-compatible chunks:
CODEBLOCK6
Streaming Tags by Mode
Single-Search (with enable_citations=true)
| Tag | Purpose |
|---|
| INLINECODE62 | Inline citation references |
| INLINECODE63 |
JSON cost/billing data |
Research Mode
| Tag | Purpose | Keep? |
|---|
| INLINECODE64 | Generated search queries | Debug |
| INLINECODE65 |
URL counts (verbose) | Debug |
|
<thinking> | URL selection reasoning | Debug |
|
<progress> | Stats: time, iterations, queries, URLs analyzed, tokens | Monitor |
|
<blindspots> | Knowledge gaps identified |
Yes |
|
<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 |
Usage Tag Format
The <usage> tag contains JSON-stringified cost and token data:
CODEBLOCK7
Use Cases
- - Chat interface integration: Use this endpoint to get a web-grounded answer payload in OpenAI-compatible format.
- Deep research / comprehensive topic research: Use research mode (
enable_research=true) for complex questions needing multi-source synthesis (e.g., "Compare approaches to nuclear fusion"). - OpenAI SDK drop-in: Same SDK, same streaming format — just change
base_url and api_key. Works with both sync and async clients. - Cited answers: Enable
enable_citations=true in single-search mode for inline citation tags, or use research mode which automatically includes citations in its answer.
Notes
- - Timeout: Set client timeout to at least 30s for single-search, 300s (5 min) for research
- Single message: The
messages array must contain exactly 1 user message - Cost monitoring: Parse the
<usage> tag from streaming responses to track costs
答案 — AI接地
通过 x402按次付费(HTTP 402)的付费答案代理。
前置条件:此技能需要x402支付。首次使用前,请完成设置步骤。
服务URL
| 角色 | 域名 |
|---|
| API提供方 | https://www.cpbox.io |
| 促进方 |
https://www.cppay.finance |
端点(代理接口)
http
POST /api/x402/answers
支付流程(x402协议)
- 1. 首次请求(无PAYMENT-SIGNATURE)-> 返回402 Payment Required及需求JSON
- 客户端签名(EIP-712)-> PAYMENT-SIGNATURE
- 重试携带PAYMENT-SIGNATURE -> 服务器结算并返回响应
使用@springmint/x402-payment或x402-sdk-go,支付将自动完成。
使用场景
| 使用场景 | 技能 | 原因 |
|---|
| 快速事实性回答(原始上下文) | llm-context | 单次搜索,返回供您的LLM使用的原始上下文 |
| 带引用的快速AI回答 |
answers(单次搜索) | 流式传输,引用 |
| 全面的多搜索深度研究 |
answers(研究模式) | 迭代深度研究,综合引用回答 |
此端点(/res/v1/chat/completions)支持两种模式:
- - 单次搜索(默认):通过单次搜索快速获得AI接地回答。支持enablecitations。
- 研究(enableresearch=true):多轮迭代深度研究,包含进度事件和综合引用回答。
快速开始(cURL)
阻塞式(单次搜索)
bash
curl -X POST https://www.cpbox.io/api/x402/answers \
-H Content-Type: application/json \
-d {
messages: [{role: user, content: 詹姆斯·韦伯太空望远镜是如何工作的?}],
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: 聚变能方面最近有哪些突破?}],
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: 比较量子计算方法}],
model: default,
stream: true,
enable_research: true,
research
maximumnumber
ofiterations: 3,
research
maximumnumber
ofseconds: 120
}
配合x402-payment使用
CLI(AI代理)
bash
npx @springmint/x402-payment \
--url https://www.cpbox.io/api/x402/answers \
--method POST \
--input {messages:[{role:user,content:詹姆斯·韦伯太空望远镜是如何工作的?}],model:default,stream:false}
载荷/响应
兼容OpenAI的chat.completions JSON + SSE流式传输(透传)。
两种模式
| 特性 | 单次搜索(默认) | 研究(enable_research=true) |
|---|
| 速度 | 快 | 慢 |
| 搜索次数 |
1 | 多次(迭代) |
| 流式传输 | 可选(stream=true/false) |
必需(stream=true) |
| 引用 | enable_citations=true(仅流式) | 内置(在
标签中) |
| 进度事件 | 无 | 有(