Resources
Errors
Error responses return the same JSON envelope. Branch on error.type in code; error.message
is intended for humans and may change. The one exception is 416 on a sandbox file read, which has
no body (see Status codes).
JSON
json
{
"error": {
"type": "invalid_api_key",
"message": "No key matches that token. Check the x-api-key header.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}Include request_id when contacting support. For sandbox failures, include the sandbox ID as well.
Failed requests (non-2xx) do not count against your free quota.
Status codes
| Status | error.type | Action |
|---|---|---|
400 | invalid_request | Fix the request parameters or headers and retry |
401 | invalid_api_key | Fix or rotate the x-api-key header |
402 | free_quota_exhausted, trial_only, insufficient_credits | Add credits in the console (insufficient_credits) or contact us (free_quota_exhausted, trial_only) before retrying |
403 | url_not_allowed, organization_suspended, spend_limit_reached | Blocked URL (Fetch only), a request from outside the United States, suspended org, or spend limit reached |
404 | not_found | Check the endpoint path or resource ID |
409 | conflict | Request conflicts with resource state (Sandbox only; see below) |
416 | None (empty body) | Sandbox file read only: the range starts past the end of the file. Do not decode the body as JSON; read the file's size from Content-Range: bytes */<size> |
422 | query_refused | Modify the query before retrying (Search only) |
429 | rate_limit_exceeded | Wait for Retry-After before retrying with backoff |
500 | internal_error | Retry with exponential backoff |
503 | service_unavailable | Retry with backoff, honoring Retry-After if present |
504 | timeout | Retry with exponential backoff |
400 Invalid request
JSON
json
{
"error": {
"type": "invalid_request",
"message": "The request body is invalid.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause: A required field or header is missing, malformed, out of range, or unknown (unknown JSON
fields are rejected with
400). On Time Portal endpoints, this also covers an invalid, future, or pre-1970Accept-Datetime, or apublished_aftervalue that is not earlier thanAccept-Datetime. - Common mistakes:
- Passing
as_ofin the JSON body instead of theAccept-Datetimeheader. - Setting
published_afterto a non-RFC-3339 format or on/after the resolvedAccept-Datetime(a bare date such as2026-03-01resolves to2026-03-01T23:59:59Z). - Sending unsupported search fields (
location,safe_search,published_before).
- Passing
Valid Search request example:
cURL
bash
curl https://api.epochal.com/v1/time-portal/search \
-H "x-api-key: $EPOCHAL_API_KEY" \
-H "Accept-Datetime: 2026-03-01T00:00:00Z" \
-H "Content-Type: application/json" \
-d '{"query": "european battery gigafactory delays", "num_results": 5}'Frequently hit field limits (see the API Reference for every constraint):
| Field | Limit |
|---|---|
query | 1 to 1,000 characters |
domains + exclude_domains | Up to 200 total entries, each up to 2,048 characters |
languages | Up to 8 BCP 47 tags, each 2 to 35 characters |
max_characters | 1 to 1,000,000 |
401 Invalid API key
JSON
json
{
"error": {
"type": "invalid_api_key",
"message": "No key matches that token. Check the x-api-key header.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause: The
x-api-keyheader is missing, or the key is unknown, revoked, or expired. - Fix: Verify the header name (
x-api-key) and full key value (including theek_prefix). If expired or revoked, create a new key in the console. See Authentication.
402 Quota or billing required
JSON
json
{
"error": {
"type": "free_quota_exhausted",
"message": "Your organization has used all its free requests for this API, so retrying will not help. To keep using it, contact sales at https://epochal.com/contact.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}Do not retry any of these unchanged. The fix depends on error.type:
error.type | Cause | Fix |
|---|---|---|
free_quota_exhausted | The organization has used all its free requests or sandbox hours for this API. | Contact us for more quota. |
trial_only | This API is in trial for the organization, and no trial requests remain. | Contact us. Adding credits does not unlock a trial-only API. |
insufficient_credits | The organization's prepaid balance is depleted. | Add credits in the console. |
403 Forbidden
JSON
json
{
"error": {
"type": "url_not_allowed",
"message": "This URL can't be fetched.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause:
url_not_allowed(Fetch blocks certain restricted URLs before retrieval),spend_limit_reached(your organization or key reached its configured spend limit), ororganization_suspended(billing or account is suspended). None of these are billed. - Fix: Do not retry unchanged. For
url_not_allowed, use another source; forspend_limit_reached, raise the spend limit in the console; fororganization_suspended, contact us.
Outside the United States
Epochal is available only in the United States for now. A request to any endpoint from anywhere
else is refused before it reaches the API, with a 403 and url_not_allowed, and the message
says so:
JSON
json
{
"error": {
"type": "url_not_allowed",
"message": "Epochal is only available in the United States for now. Requests from outside the United States are refused. We are expanding as soon as we can."
}
}This response has no request_id; quote its cf-ray response header instead. It is not billed.
Do not retry it from the same location.
404 Not found
JSON
json
{
"error": {
"type": "not_found",
"message": "Nothing is served at that path.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause: Unknown endpoint path, or a resource ID that does not exist in your organization.
- Fix: Verify the URL path and resource ID against the API Reference.
409 Conflict
Returned only by Sandbox endpoints when a request conflicts with the resource's current state:
| Condition | Response detail | Action |
|---|---|---|
Sandbox is still creating | The sandbox is still starting. | Poll GET /v1/time-portal/sandbox/{id}?wait=55s until its state is live before retrying. |
Sandbox has ended | The sandbox has ended. | Ended sandboxes cannot be restarted and their files and output are deleted. Create a new sandbox instead. |
| Command already exited | Returned on POST .../execs/{exec_id}/input | Read the command's output and exit status instead of sending more input. |
Input seq out of order | Response body includes next_seq | Resend with seq set to next_seq. |
Idempotency-Key reused with a different body | Returned on sandbox or command creation | Generate a new Idempotency-Key for distinct requests. |
422 Query refused
JSON
json
{
"error": {
"type": "query_refused",
"message": "This query falls under our usage policy and was refused. The request was not billed.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause: Search query refused under Epochal's usage policy. Does not count against your quota.
- Fix: Do not retry the same query.
429 Rate limit exceeded
JSON
json
{
"error": {
"type": "rate_limit_exceeded",
"message": "Over the organization's rate limit. Retry after a pause.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}- Cause: Organization rate limit, sandbox concurrency limit, or per-IP edge ceiling exceeded.
- Fix: Wait at least
Retry-Afterseconds and add random jitter before retrying. See Rate Limits.
500, 503, and 504 Server errors
JSON
json
{
"error": {
"type": "internal_error",
"message": "Something failed on our side. The request was not billed.",
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15"
}
}503 returns service_unavailable and 504 returns timeout in the same envelope. None of these
count against your free quota.
- Fix: Retry with exponential backoff (honoring
Retry-Afteron503). If errors persist, check status.epochal.com and contact support with therequest_id.
Sandbox runtime errors
When a sandbox fails to boot (state: "failed") or terminates unexpectedly (state: "ended"), the
sandbox object returned by GET and LIST (200) includes an error object:
error.type | Cause | Action |
|---|---|---|
lifetime_expired | Sandbox reached its timeout. | Create a new sandbox with a longer timeout. |
idle_expired | No running commands or write activity for idle_timeout. | Increase idle_timeout or keep the sandbox active between commands. |
out_of_memory | Sandbox exceeded its memory_gib allocation. | Reduce memory usage or create a sandbox with more memory. |
sandbox_lost | Underlying host failed. | Create a new sandbox. Download artifacts incrementally during long jobs. |
free_quota_exhausted | Free sandbox allowance exhausted. | Do not retry; contact us for more quota. |
A sandbox in failed state never booted and does not consume your free sandbox allowance. See
Lifecycle and Limits.
Retry guidelines
- Retry only
429,500,503, and504. - Use exponential backoff with random jitter and a retry cap.
- Send
Idempotency-Keyon sandbox creation and command creation so retried requests do not spawn duplicates. - Search and Fetch are read-only and idempotent: failed attempts are not billed.
Report a problem
See Getting Help for support contacts and what details to include.