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-Datetime goes 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}/files takes the file's bytes as the request body (application/octet-stream), and GET on 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 own Content-Type, and the page's outcome is in the x-fetch-status-code and x-fetch-status-message response headers. The default format: "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 returns 416 with only a Content-Range header. Check the status code before decoding a body.

Machine-readable documentation

ResourceContentsWhen to use
https://docs.epochal.com/llms.txtIndex of every page with a one-line summaryDiscover 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 pageLoad a single guide or endpoint schema
https://docs.epochal.com/llms-full.txtComplete documentation corpus in one fileLoad all docs at once when context allows
https://docs.epochal.com/SKILL.mdInstallable epochal-api Agent SkillOne-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.md

Other 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:

  1. Fix Accept-Datetime in the harness, not the prompt.

    Inject the same Accept-Datetime header inside your tool implementation so the model cannot advance or omit the cutoff.

  2. 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.

  3. Run agent code in a Time Portal sandbox.

    Create sandboxes at the same Accept-Datetime with network: "time-portal" so outbound HTTP calls and package installs stay time-gated.

  4. 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

FieldDefaultAllowed range
Accept-DatetimeRequired (no default)Past timestamp, >= 1970-01-01T00:00:00Z (Search/Fetch) or >= 2023-04-01T00:00:00Z (Sandbox)
num_results101 to 10
max_characters1000001 to 1,000,000
Sandbox networknonenone or time-portal
Sandbox timeout1h1m to 24h
Sandbox idle_timeout10m (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

Quickstart

Get started with the search, fetch, and sandbox Time Portal APIs.

MCP Server

Expose time-gated web search and fetch tools to MCP-compatible agents.

How the Instant Works

Every Time Portal request evaluates against a point-in-time cutoff specified in Accept-Datetime.

Errors

Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.