POST https://api-beta.ai-baseline.xyz/v2/sandp_500/query to query filing evidence. Every request includes a natural-language query and can optionally set mode, effort, metadata_filters, include, and retrieval.
The minimal request body contains only query:
mode: "basic" and effort: "medium". It returns rendered evidence, evidence_instructions, evidence_budget, and summary by default.
Modes
basic rejects non-empty metadata filters. If you send metadata_filters, explicitly set mode to research or agentic_research.
Effort
effort controls how much work the API spends on supporting evidence. The default is medium.
Include Controls
Theinclude object controls optional response sections:
evidence: true returns grounding evidence directly in top-level evidence. Use evidence_format: "rendered" for XML-like grounding with a trailing <source_key> quick reference. This is the recommended default when you want grounded context to pass to your own LLM. Use evidence_format: "xml" for the same grounding without that source-key footer.
evidence_instructions: true returns top-level evidence_instructions, a separate string containing guidance for how a downstream LLM should use the returned evidence to generate a grounded answer. These instructions are returned by default when evidence is included and are not part of the evidence content itself. Set evidence_instructions: false to omit them.
agent_context: true returns top-level agent_context, a derived convenience payload intended for direct handoff to another LLM or agent. It is not the canonical evidence contract. evidence remains the canonical grounding evidence field, and evidence_instructions remains the canonical downstream answer-generation guidance field.
agent_context.content_type is currently always "text/markdown". agent_context.text combines the evidence-use instructions with the selected evidence format. For agentic_research, it also includes the task-aware coverage assessment. agent_context.source_fields lists the canonical response fields used to construct the payload.
agent_context honors include.evidence_format: with "rendered", the context includes rendered evidence; with "xml", it includes XML evidence with the same public XML formatting behavior as top-level evidence.
Clients building custom prompts or UIs should use evidence and evidence_instructions directly. Use agent_context when you want one ready-to-feed context block and do not need separate raw fields.
metadata_distribution: true returns structured metadata distribution keyed by canonical field names such as sec_ticker and sec_form_type. Each metric entry includes a readable display_name plus values for distributions, or value for text summaries. metadata_dashboard: true can return the rendered dashboard independently.
summary contains the selected mode, effort, submitted_metadata_filters, applied_metadata_filters, warnings, and evidence_count, which counts the retrieved evidence paths used to ground the response.
For agentic_research, retrieval_plan.queries[].applied_metadata_filters shows the metadata filters applied to each retrieval branch.
Agentic Coverage
agentic_research currently decomposes a question into up to four independently required retrieval inputs. For financial comparisons and calculations, these can include every issuer, current and comparison periods, each requested metric, and source inputs such as a numerator and denominator.
The top-level coverage object reports whether the delivered evidence covers those planned inputs:
Each
coverage.requirements[] item includes the requirement id, label, retrieval query, retrieved_evidence_count, returned_evidence_count, and one of these statuses:
covered: at least one associated evidence chain was returned.missing: no associated evidence chain survived retrieval and delivery.omitted_by_budget: evidence was available for this requirement, but none of its complete chains fit withinretrieval.max_evidence_tokens.
coverage.limitations can contain planning_fallback, requirement_limit, missing_evidence, or token_budget. coverage.omitted_requirements lists required inputs that did not fit within the decomposition limit.
Coverage is a retrieval-completeness signal. It means evidence was returned for every planned input; it does not independently certify that the evidence is factually correct or sufficient for a final calculation.
Retrieval Controls
The public/query API supports evidence-count and estimated-token controls:
retrieval.max_evidence must be a positive integer. It controls the maximum number of evidence chains returned to the API consumer.
retrieval.max_evidence_tokens must also be a positive integer. It is a strict cap on the deterministic estimated size of the returned evidence. Selection keeps complete evidence chains, prioritizes chains that cover the most uncovered agentic requirements, and then fills the remaining budget in rerank order. The evidence and its regenerated source registry are re-estimated after each candidate, so the final estimate does not exceed the requested cap.
The estimator is chars_div_4_v1, calculated as ceil(projected evidence characters / 4). It is deterministic and useful for payload planning, but it is not a provider-exact tokenizer. Evidence instructions, dashboards, and agent-context wrappers are excluded.
Both controls are uncapped by default. If max_evidence is omitted, no caller-supplied chain-count cap is added after the normal retrieval, relevance filtering, and deduplication stages. If max_evidence_tokens is omitted or null, no token cap is applied.
Whenever evidence or agent_context is requested, the response includes evidence_budget:
requested_max_tokens is null; the API returns all evidence that survived the earlier stages and provides estimate metadata only.
If no complete chain fits within the requested cap, evidence is omitted rather than cut into a malformed chain. This is not reported as "No data found" because retrieval did find evidence.
Other retrieval control fields are not supported on the public /query API and are rejected by request validation.
Request Examples
Structured/custom integrations can use the canonical fields directly and only override the defaults they need to change:agent_context without duplicated raw fields:
agent_context and omits top-level evidence and evidence_instructions.