Resources
For Agents
The Epochal API is designed for agent use. Every endpoint is plain HTTPS authenticated with the
x-api-key header, and most exchange JSON, so agents can call the API directly over HTTP or through
the MCP server and SDKs. Four details are easy for an agent to get wrong:
Accept-Datetimegoes on Search, Fetch, and sandbox creation only. It sets the point-in-time cutoff. A sandbox keeps the cutoff it was created with, and no other sandbox endpoint takes the header.- Sandbox file contents are raw bytes, not JSON.
PUT /v1/time-portal/sandbox/{id}/filestakes the file's bytes as the request body (application/octet-stream), andGETon the same path returns bytes. JSON-encoding an upload changes the bytes written. - Fetch with
format: "page"returns the document itself. The body is the archived page with its ownContent-Type, and the page's outcome is in thex-fetch-status-codeandx-fetch-status-messageresponse headers. The defaultformat: "structured"returns JSON. - Some responses have no body. Terminating a sandbox and removing a file return
204, and a file read that starts past the end of the file returns416with only aContent-Rangeheader. Check the status code before decoding a body.
Machine-readable documentation
| Resource | Contents | When to use |
|---|---|---|
https://docs.epochal.com/llms.txt | Index of every page with a one-line summary | Discover which pages apply to a task |
<page-url>.md (e.g. https://docs.epochal.com/docs/time-portal/search.md) | Plain markdown twin of any guide or reference page | Load a single guide or endpoint schema |
https://docs.epochal.com/llms-full.txt | Complete documentation corpus in one file | Load all docs at once when context allows |
https://docs.epochal.com/SKILL.md | Installable epochal-api Agent Skill | One-time installation for coding agents |
Install the Agent Skill
This documentation site generates and serves an Agent Skill at
https://docs.epochal.com/SKILL.md containing the base URL, required headers, endpoints, and
markdown doc links.
To install it in Claude Code, download it into Claude Code's personal skills directory
(~/.claude/skills/):
Shell
bash
mkdir -p ~/.claude/skills/epochal-api
curl -o ~/.claude/skills/epochal-api/SKILL.md https://docs.epochal.com/SKILL.mdOther coding agents that follow the Agent Skills format can load the same SKILL.md from their own
skills directory.
Use the MCP server
If your agent supports MCP, use the MCP Server to expose time-gated
web_search and web_fetch tools directly without writing custom tool wrappers.
Wiring Time Portal into an agent harness
For backtests and evaluations, bind Search, Fetch, and Sandbox to the same Accept-Datetime cutoff:
- Fix
Accept-Datetimein the harness, not the prompt.Inject the same
Accept-Datetimeheader inside your tool implementation so the model cannot advance or omit the cutoff. - Route all page reads through Time Portal Fetch.
Never open search result URLs with a live HTTP client or browser — doing so exposes current web content.
- Run agent code in a Time Portal sandbox.
Create sandboxes at the same
Accept-Datetimewithnetwork: "time-portal"so outbound HTTP calls and package installs stay time-gated. - Record responses for deterministic replay.
Cache tool responses locally so subsequent evaluation passes replay cleanly without issuing extra API requests. See How the Instant Works.
Parameter defaults and bounds
| Field | Default | Allowed range |
|---|---|---|
Accept-Datetime | Required (no default) | Past timestamp, >= 1970-01-01T00:00:00Z (Search/Fetch) or >= 2023-04-01T00:00:00Z (Sandbox) |
num_results | 10 | 1 to 10 |
max_characters | 100000 | 1 to 1,000,000 |
Sandbox network | none | none or time-portal |
Sandbox timeout | 1h | 1m to 24h |
Sandbox idle_timeout | 10m (or timeout if shorter) | 1m to timeout |
Error handling
Always branch on error.type rather than error.message when handling error responses. Retry
rate_limit_exceeded, service_unavailable, timeout, and internal_error with backoff (honoring
Retry-After when present); do not retry 4xx client or policy errors unchanged. See
Errors for the full error table.
API key hygiene for agents
Never paste API keys into prompts. Export EPOCHAL_API_KEY in the tool host environment and issue
a dedicated, expiring key per agent workflow so exposure is easy to revoke. See
Authentication.
Next steps
Get started with the search, fetch, and sandbox Time Portal APIs.
Expose time-gated web search and fetch tools to MCP-compatible agents.
Every Time Portal request evaluates against a point-in-time cutoff specified in Accept-Datetime.
Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.