Execute API (/execute)
The primary entry point to the rtrvr.ai planner + tools engine. Send one JSON payload that can browse the web, load tabular data as in-memory sheets, call tools, and return structured results.
Execute API Playground
POST/executePlanner + tools engine in API mode.
Use your API key in the Authorization header:
Authorization: Bearer rtrvr_your_api_keyhttps://api.rtrvr.ai/executeSend a single JSON payload describing what you want. The planner orchestrates browser tabs, tools, and in-memory sheets to get the job done.
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarize the main points of this page in 5 bullet points.",
"urls": ["https://example.com/blog/ai-trends-2025"],
"response": { "verbosity": "final" }
}'Internally, this maps to an execution trajectory. New requests get a new trajectoryId; continuations reuse it.
For low-level raw page data, see the Scrape API docs (/scrape).
Both endpoints share the same browser + proxy infra but are optimized for different jobs. Use this table to pick the right primitive for your use case.
| Dimension | /execute | /scrape |
|---|---|---|
| What it does | Full agent run: planner + tools + browser + optional Sheets/Docs/etc. | Loads pages and returns extracted text + accessibility tree. |
| Typical latency | Higher – dominated by LLM calls and multi-step tools. | Lower – usually just browser + proxy round-trips. |
| Credits | Infra credits + model/tool credits. | Infra-only credits (browser + proxy); no model/tool usage. |
| Best for | End-to-end automations, multi-step workflows, writing back to external systems (Docs, Sheets, CRMs, etc.). | Feeding your own LLM/RAG stack, ad-hoc scraping, prefetching page data. |
| Capabilities | Planner, tools, Sheets workflows, Docs/PDF generation, ask_user, etc. | Extracted text, accessibility tree, elementLinkRecord, usage metrics. |
Trajectory & Phase
A trajectory is a stable ID for a workflow. Use it to group related phases (e.g. discovery → enrichment → reporting) and continuations.
- Omit
trajectoryIdto start fresh. - Reuse the same
trajectoryIdwithhistory.continue = trueto continue. phase(default1) lets you structure long-running projects into multiple stages.
Planner + Tools
You don't call tools directly. Instead, you describe the task and optionally configure which enableAdditionalTools to allow. Support for tools.enableAdditionalTools in the public API will come soon.
Under the hood, the planner can call tools like act_on_tab, crawl_and_extract_from_tab, sheets_workflow, create_sheet_from_data, and more. Only a subset (Docs, Slides, PDFs, Sheets, ask_user, etc.) is gated behind enableAdditionalTools to control cost and latency.
Tabular Inputs & In-Memory Sheets
Use dataInputs to attach CSV/TSV/JSON, text, markdown, or binary formats (XLSX/Parquet via URL or storage). The system:
- Infers the format from extension or content type when omitted.
- Parses header and row schema.
- Creates an in-memory sheet (no Google Drive write) exposed to tools like
sheets_workflow.
The full request shape is ApiExecuteRequest:
type ApiVerbosity = 'final' | 'steps' | 'debug';
interface ApiExecuteRequest {
// Core
trajectoryId?: string;
phase?: number; // default: 1
input: string; // main user instruction
urls?: string[]; // pages to open in browser
schema?: Schema; // optional: expected result shape (OpenAPI-style)
// Extra data to load as sheets
dataInputs?: ApiTabularInput[];
// Per-request user settings override (advanced)
settings?: Partial<UserSettings>;
// Planner continuation
history?: {
continue?: boolean;
previousSteps?: PlannerPreviousStep[];
lastToolPreviousSteps?: ToolPreviousSteps;
};
// Tooling configuration
tools?: ApiToolsConfig;
// Response configuration
response?: {
verbosity?: ApiVerbosity; // default 'final'
inlineOutputMaxBytes?: number; // snapshot beyond this size
};
// Internal / advanced
options?: {
skipToolsStorageLoad?: boolean;
};
}Core fields
inputstringrequiredNatural-language task description; what you want the system to do.
urlsstring[]Optional list of URLs to open. The first real URL loads full content; others default to text-only for efficiency.
schemaSchemaOptional OpenAPI-style JSON Schema describing the desired final JSON shape. Planner and tools will try to honor it when producing result.json.
trajectoryIdstringStable ID for a workflow. Omit to start a new trajectory; reuse to continue or add phases.
phasenumberdefault: 1Phase index within a trajectory. Use ≥2 for multi-stage workflows.
{
"type": "object",
"properties": {
"bullets": {
"type": "array",
"items": { "type": "string" }
},
"sourceUrl": {
"type": "string"
}
},
"required": ["bullets"]
}Tabular inputs (dataInputs)
dataInputsApiTabularInput[]Optional list of tabular inputs to materialize as in-memory sheets.
dataInputs[].descriptionstringHuman-readable description. Used as sheet title in the UI.
dataInputs[].format"text" | "markdown" | "csv" | "tsv" | "json" | "xlsx" | "parquet"Optional explicit format. If omitted, inferred from file extension or content type.
dataInputs[].inlinestringRaw content (CSV/TSV/JSON/text/markdown) embedded directly in the request. For XLSX/Parquet prefer URL or storageRef.
dataInputs[].urlstringHTTP(S) URL to fetch as a tabular source (works well for large CSV/XLSX/Parquet files).
dataInputs[].storageRefStorageReferenceAdvanced: backend-managed GCS object reference when clients upload to storage directly.
# CSV inline
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Enrich each company with website and description.",
"dataInputs": [
{
"description": "Companies",
"format": "csv",
"inline": "company\\nOpenAI\\nDeepMind\\nAnthropic\\n"
}
],
"response": { "verbosity": "steps" }
}'# JSON inline (array of objects)
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Infer seniority and return an updated JSON array.",
"dataInputs": [
{
"description": "Contacts",
"format": "json",
"inline": "[{\"name\":\"Alice\",\"title\":\"VP Engineering\"},{\"name\":\"Bob\",\"title\":\"Software Engineer\"}]"
}
],
"response": { "verbosity": "steps" }
}'# XLSX via URL
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type": "application/json" \
-d '{
"input": "Summarize opportunity pipeline from this Excel file.",
"dataInputs": [
{
"description": "Sales pipeline",
"format": "xlsx",
"url": "https://example.com/sales-pipeline.xlsx"
}
],
"response": { "verbosity": "steps" }
}'# Parquet via URL
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Compute daily active users per region from this Parquet dataset.",
"dataInputs": [
{
"description": "Events parquet",
"format": "parquet",
"url": "https://example.com/events.parquet"
}
],
"response": { "verbosity": "steps" }
}'Tools configuration (tools)
tools.enableAdditionalToolsstring[]Coming soon: optional list of higher-power tool families to enable for this request.
"ask_questions""generate_docs""generate_websites""generate_pdfs""pdf_filling""generate_sheets"Core tools (browser actions, extraction, sheets_workflow on in-memory sheets, etc.) are always enabled. Additional tools control Docs, Slides, PDFs, persistent Sheets, and explicit ask_user behavior. Support for tools.enableAdditionalTools will come soon.
Response configuration (response)
response.verbosity"final" | "steps" | "debug"default: "final"Controls how much detail you get back.
"final""steps""debug"response.inlineOutputMaxBytesnumberHard cap (in bytes) for inline output blocks. Larger payloads are snapshot to storage and previewed.
History & continuation (history)
history.continuebooleanSignal that this call should continue a previous workflow state.
history.previousStepsPlannerPreviousStep[]Planner-internal state from previous runs. Returned in response.history for advanced clients.
history.lastToolPreviousStepsToolPreviousStepsTool execution state for the last tool. Used for precise continuations.
Advanced options
settingsPartial<UserSettings>Per-request overrides for stored user settings (model, proxy, extraction config, etc.). Generally only needed from first-party or advanced SDKs.
options.skipToolsStorageLoadbooleanInternal optimization flag when all tools are provided directly. Most clients should omit.
Every call returns an ApiExecuteResponse. This gives you:
- A high-level
successflag andstatusreason. - Rich
outputblocks (text, JSON, optional per-tool results). - A convenience
resultview withtextandjsonfor the final answer. - Detailed
usageandmetadatafor billing, observability, and continuation.
interface ApiExecuteResponse {
success: boolean;
status: 'success' | 'error' | 'cancelled' | 'requires_input' | 'executing';
trajectoryId: string;
phase: number;
// Rich output blocks
output: ApiOutputBlock[];
// Convenience view of final output
result?: {
text?: string;
json?: any;
};
// Present when verbosity !== 'final'
steps?: ApiStepSummary[];
usage: {
creditsUsed: number;
creditsLeft?: number;
currentCreditsUsed?: number;
expiryReason?: string;
};
metadata: {
taskRef: string;
inlineOutputMaxBytes: number;
toolsUsed: string[];
outputTooLarge?: boolean;
responseRef?: StorageReference;
};
warnings?: string[];
error?: string;
// Continuation payload for advanced clients
history?: {
previousSteps?: PlannerPreviousStep[];
lastToolPreviousSteps?: ToolPreviousSteps;
};
}Output blocks & result
The low-level output is an array of blocks:
output[].type"text" | "json" | "tool_result"Block type: final text, JSON payload, or detailed tool result (debug mode).
output[].textstringPresent when type = 'text'.
output[].dataanyPresent when type = 'json'.
output[].tool_result…When type = 'tool_result', includes stepId, toolName, args, output preview, thought, etc. Only present when verbosity = 'debug'.
result.text is the concatenation of all text blocks. result.json is either the single JSON block, or an array of JSON blocks if the workflow produced multiple.
Steps & usage
When response.verbosity is "steps" or "debug", you also get steps: ApiStepSummary[]:
steps[].toolNamestringWhich tool ran in this step (e.g. 'sheets_workflow', 'act_on_tab').
steps[].statusExecutionStatussuccess, error, executing, etc. per step.
steps[].durationnumberExecution time in ms for this step (when available).
steps[].creditsUsednumberCredits consumed by this step, useful for analytics.
steps[].hasOutputbooleanWhether this step produced output or an outputRef.
steps[].hasSheetsbooleanWhether this step produced or touched tabular data.
steps[].hasGeneratedContentbooleanWhether this step generated external content (docs, slides, etc.).
usage mirrors your credit accumulator and is ideal for per-customer dashboards and server-side cost control.
Large output handling
When the full response exceeds inlineOutputMaxBytes:
- • The full response is snapshot to storage under
metadata.responseRef. - • The inline response is truncated to a safe preview.
- •
metadata.outputTooLargeis set totrue.
Client pattern: render the preview for UX, but fetch responseRef.downloadUrl from your backend when you need the full payload.
status & success
status"success" | "error" | "cancelled" | "requires_input" | "executing"Execution-level status. success implies success = true; all others imply success = false.
- •
"success"– Final result is available inresultandoutput. - •
"error"– Workflow failed. You still getusage,steps(if enabled), and partial output if any. - •
"cancelled"– Client abort or timeout. Credits are accounted for partial work. - •
"requires_input"– Planner paused because it needs human answers (ASK_USER).
- When you see
status: "requires_input", surface your own UI to collect missing info. - On the next call, send the same
trajectoryIdwithhistory.continue = trueand the updatedhistoryobject returned from the previous response.
# 1. Minimal – summarize a page
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarize the main points of this page in 5 bullet points.",
"urls": ["https://example.com/blog/ai-trends-2025"],
"response": { "verbosity": "final" }
}'
# 2. CSV dataInputs – enrich row by row (inline)
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "For each company in the uploaded CSV, find the official website and a one-sentence description, then return a JSON array of {company, website, description}.",
"dataInputs": [
{
"description": "Companies to enrich",
"format": "csv",
"inline": "company\\nOpenAI\\nDeepMind\\nAnthropic\\n"
}
],
"response": { "verbosity": "steps" }
}'
# 3. TSV dataInputs – per-row operations (inline)
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Score each lead based on fit and return a TSV with an extra score column.",
"dataInputs": [
{
"description": "Leads",
"format": "tsv",
"inline": "company\tcountry\\nOpenAI\tUS\\nDeepMind\tUK\\n"
}
],
"response": { "verbosity": "steps" }
}'
# 4. JSON dataInputs – array of objects (inline)
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "For each contact, infer seniority and return an updated JSON array.",
"dataInputs": [
{
"description": "Contacts",
"format": "json",
"inline": "[{\"name\":\"Alice\",\"title\":\"VP Engineering\"},{\"name\":\"Bob\",\"title\":\"Software Engineer\"}]"
}
],
"response": { "verbosity": "steps" }
}'
# 5. text dataInputs – one item per line
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Classify each line as positive, negative, or neutral.",
"dataInputs": [
{
"description": "Reviews",
"format": "text",
"inline": "Loved it!\\nTerrible support.\\nOkay overall."
}
],
"response": { "verbosity": "steps" }
}'
# 6. XLSX dataInputs – via URL
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarize pipeline metrics from the uploaded Excel file.",
"dataInputs": [
{
"description": "Pipeline metrics",
"format": "xlsx",
"url": "https://example.com/data/pipeline.xlsx"
}
],
"response": { "verbosity": "steps" }
}'
# 7. Parquet dataInputs – via URL
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Compute aggregate stats per region from this Parquet dataset.",
"dataInputs": [
{
"description": "Events",
"format": "parquet",
"url": "https://example.com/data/events.parquet"
}
],
"response": { "verbosity": "steps" }
}'
# 8. Structured JSON with schema
curl -X POST https://api.rtrvr.ai/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Summarize the main points of this page in 5 bullet points.",
"urls": ["https://example.com/blog/ai-trends-2025"],
"schema": {
"type": "object",
"properties": {
"bullets": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["bullets"]
},
"response": { "verbosity": "final" }
}'