Choose a mode
Set the mode in the JSON body. A valid answer with unknown values is still billable. Validation, research, and timeout failures are not charged; inspect
key_metadata and X-Credits-Used for the actual charge.
Ask for a structured answer
Copy an API key from the dashboard, setCONTEXT_DEV_API_KEY on your server, and install an SDK if needed. A restricted key needs data:execute; see API key permissions.
This request accepts a valid answer from the evidence collected within 30 seconds:
These examples use the SDKs’ low-level request methods to send the current API contract, including fields not yet exposed by the 2.14.0 typed helpers. Authentication, retries, and error handling still come from the SDK. See SDK compatibility.
Shape and check the answer
task is required, trimmed, and limited to 2,000 characters. json_format is an example object whose keys and placeholder values describe the desired output. Omit it for the default {"result": ""} shape.
- Nonempty objects preserve their keys; strings, numbers, and booleans preserve their types. Unknown values can be
null. - An example array describes its items; the answer can contain any number of matching items.
- Empty objects permit arbitrary fields, empty arrays permit any JSON items, and a
nullplaceholder permits any JSON value. - Examples support at most eight levels, 500 values, and 16,000 serialized characters.
Read sources and partial results
sources lists contributing search results or readable pages, deduplicated in first-seen order. A URL may have contributed a search snippet without its full page being read. Sources do not map individual answer fields to citations. Check important claims against the source before using them in a decision.
Page reads request fresh content; search snippets can still reflect indexed material. With timeoutOpts.behavior: "return-partial", research can stop early enough to produce a valid answer from collected evidence. A partial answer includes partial: true and costs the selected mode’s price. Preserve that marker when storing or displaying the result.
timeoutOpts.milliseconds accepts 1,000–300,000 and can shorten the mode’s research budget. It cannot extend the 30-second Fast or 50-second Ultra limit. See Timeouts and partial results.
Handle failures
Standard authentication, credits, and rate limits also apply. Follow Troubleshooting for shared errors.