Create a grounded response
Runs the grounded search pipeline (Plan → Collect → Process → Analyze) and returns a cited answer in the OpenAI Responses API shape.
Non-streaming (default). Omit stream (or pass stream: false) to
receive a single JSON body equal to the response field of the terminal
response.completed event. This matches OpenAI's spec.
Streaming. Pass stream: true to receive a Server-Sent Events stream of
OpenAI Responses events: response.created → response.in_progress →
response.output_item.added → response.output_text.delta* →
response.output_item.done → response.completed. The official OpenAI
SDKs consume this stream natively.
Drop-in mode. Pass vendor_events: false (recommended for SDK consumers)
to suppress non-OpenAI events: response.pipeline_stage,
response.source_texts, and the web_search_call output item. Leave it
true if you want to surface pipeline progress (planning, collection,
processing) in your UI.
Citations. Every output_text content part carries a
url_citation annotation for each inline [N] marker — see the
UrlCitationAnnotation schema and the API overview above for code that
expands them into footnotes or tooltips.
Follow-up turns. Pass request_id from a prior response to continue the
same conversation; input is appended to the existing history.
Parameters
Returns
Terminal response.completed payload (returned only when stream: false).
Create a grounded response
import CementedAI from 'cemented.ai';
const client = new CementedAI({
apiKey: process.env['CEMENTED_AI_API_KEY'], // This is the default and can be omitted
});
const response = await client.responses.create({
input: 'What did NVIDIA report in its latest 10-Q?',
model: 'grounded-sonnet',
});
console.log(response);{}Returns Examples
{}