curl --request POST \
--url https://api.context.dev/v1/web/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "fast",
"task": "Find the pricing page URL and plan names for context.dev.",
"json_format": {
"pricing_page_url": "",
"plans": [
{
"name": ""
}
]
}
}
'{
"json_content": {},
"sources": [
"<string>"
],
"partial": true,
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Answer a Research Task
Research the live web and return structured answers with source URLs. Choose Fast for quick lookups or Ultra for deeper research.
curl --request POST \
--url https://api.context.dev/v1/web/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "fast",
"task": "Find the pricing page URL and plan names for context.dev.",
"json_format": {
"pricing_page_url": "",
"plans": [
{
"name": ""
}
]
}
}
'{
"json_content": {},
"sources": [
"<string>"
],
"partial": true,
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}task. Answers searches the web, reads relevant pages, and returns json_content in your requested shape, along with the sources used.
Choose a mode
| Mode | Credits per successful request | Research limit | Use for |
|---|---|---|---|
fast | 10 | 30 seconds | Quick factual lookups and focused questions. |
ultra | 100 | 50 seconds | Questions that need deeper research, comparisons, or several sources. |
ultra. Set mode in the JSON request body to select a level.
Successful responses consume the selected mode’s credits, including answers with unknown values. Validation, research, and timeout failures are not charged. The X-Credits-Used response header reports the charge.
Shape the answer
Passjson_format as an example object. Its keys and placeholder values describe the answer you want. For example, use this request body to find a company’s pricing page and plan names:
{
"mode": "fast",
"task": "Find the pricing page URL and plan names for context.dev.",
"json_format": {
"pricing_page_url": "",
"plans": [{ "name": "" }]
}
}
json_content and returns source URLs separately:
{
"json_content": {
"pricing_page_url": "https://www.context.dev/pricing",
"plans": [
{ "name": "Developer" },
{ "name": "Pro" },
{ "name": "Scale" }
]
},
"sources": ["https://www.context.dev/pricing"]
}
json_format, the answer uses {"result": ""}. Nonempty objects preserve their keys. Text, numbers, and true/false values preserve their types. Unknown values may be null. An example array describes the shape of its items; the returned array can contain any number of matching items.
Empty objects accept arbitrary fields, empty arrays accept any JSON items, and a null placeholder accepts any JSON value. The example supports at most 8 levels, 500 values, and 16,000 serialized characters. Use an example object rather than a JSON Schema definition.
Sources and research scope
Include a domain or complete page URL intask to focus research on that site. The task can contain up to 2,000 characters after trimming.
sources contains the URLs that supplied search results or readable page content, deduplicated in first-seen order. It does not map individual fields to citations. A listed URL may have contributed a search snippet without its full page being read. Page reads contribute a source only when they return readable content.
Timeouts and errors
SettimeoutOpts.behavior to "return-partial" to stop research before the deadline and return an answer from the evidence already gathered. A successful partial answer still matches json_format, includes partial: true, and costs the selected mode’s credits. If usable evidence or a valid answer is unavailable, the request fails without a charge. The default behavior is "fail"; see Timeouts and partial results.
timeoutOpts.milliseconds accepts 1,000–300,000 milliseconds. A value below the selected mode’s research limit shortens the deadline; a larger value keeps the 30-second Fast or 50-second Ultra limit.
| Status | Meaning |
|---|---|
400 | Invalid input, an unsupported example shape, or a zero data retention request. |
408 | The caller’s deadline expired without a usable partial answer, or with behavior: "fail". |
502 | Research could not gather usable evidence or produce the requested JSON answer. |
504 | The research or model time limit expired. |
400 ZDR_NOT_SUPPORTED before research and billing. Standard authentication and rate limits also apply.Authorizations
Bearer authentication header of the form Bearer <API_KEY>. Keys have full access by default.
Body
What to research and answer, in plain language. Naming a domain in the task (for example "pricing on context.dev") makes the agent read that site before it searches.
1 - 2000Research level: fast uses a smaller model and research budget for 10 credits; ultra uses deeper reasoning and research for 100 credits. Defaults to ultra. Only successful requests consume credits.
fast, ultra An example object with placeholder values (for example {"pricing_page_url": "", "plans": [{"name": "", "price": 0}]}). Object keys and value types are preserved; unknown values may be null. Empty arrays accept any JSON items. Defaults to {"result": ""}. Maximum 8 levels, 500 values, and 16000 characters.
Show child attributes
Show child attributes
Optional request deadline and behavior on timeout. For GET requests, use timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded timeoutOpts object.
Show child attributes
Show child attributes
Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
201 - 50["production", "team-alpha"]
Response
The requested JSON shape, plus the sources used
The answer, in the shape requested by json_format.
Show child attributes
Show child attributes
URLs that supplied search results or readable page content, in first-seen order. Unreadable pages are excluded.
True when the request deadline ended research and the answer uses the evidence collected so far.
Credit usage, included whenever a valid API key is provided.
Show child attributes
Show child attributes
Was this page helpful?