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

Statuserror.typeAction
400invalid_requestFix the request parameters or headers and retry
401invalid_api_keyFix or rotate the x-api-key header
402free_quota_exhausted, trial_only, insufficient_creditsAdd credits in the console (insufficient_credits) or contact us (free_quota_exhausted, trial_only) before retrying
403url_not_allowed, organization_suspended, spend_limit_reachedBlocked URL (Fetch only), a request from outside the United States, suspended org, or spend limit reached
404not_foundCheck the endpoint path or resource ID
409conflictRequest conflicts with resource state (Sandbox only; see below)
416None (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>
422query_refusedModify the query before retrying (Search only)
429rate_limit_exceededWait for Retry-After before retrying with backoff
500internal_errorRetry with exponential backoff
503service_unavailableRetry with backoff, honoring Retry-After if present
504timeoutRetry 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-1970 Accept-Datetime, or a published_after value that is not earlier than Accept-Datetime.
  • Common mistakes:
    • Passing as_of in the JSON body instead of the Accept-Datetime header.
    • Setting published_after to a non-RFC-3339 format or on/after the resolved Accept-Datetime (a bare date such as 2026-03-01 resolves to 2026-03-01T23:59:59Z).
    • Sending unsupported search fields (location, safe_search, published_before).

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

FieldLimit
query1 to 1,000 characters
domains + exclude_domainsUp to 200 total entries, each up to 2,048 characters
languagesUp to 8 BCP 47 tags, each 2 to 35 characters
max_characters1 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-key header is missing, or the key is unknown, revoked, or expired.
  • Fix: Verify the header name (x-api-key) and full key value (including the ek_ 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.typeCauseFix
free_quota_exhaustedThe organization has used all its free requests or sandbox hours for this API.Contact us for more quota.
trial_onlyThis API is in trial for the organization, and no trial requests remain.Contact us. Adding credits does not unlock a trial-only API.
insufficient_creditsThe 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), or organization_suspended (billing or account is suspended). None of these are billed.
  • Fix: Do not retry unchanged. For url_not_allowed, use another source; for spend_limit_reached, raise the spend limit in the console; for organization_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:

ConditionResponse detailAction
Sandbox is still creatingThe sandbox is still starting.Poll GET /v1/time-portal/sandbox/{id}?wait=55s until its state is live before retrying.
Sandbox has endedThe sandbox has ended.Ended sandboxes cannot be restarted and their files and output are deleted. Create a new sandbox instead.
Command already exitedReturned on POST .../execs/{exec_id}/inputRead the command's output and exit status instead of sending more input.
Input seq out of orderResponse body includes next_seqResend with seq set to next_seq.
Idempotency-Key reused with a different bodyReturned on sandbox or command creationGenerate 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-After seconds 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-After on 503). If errors persist, check status.epochal.com and contact support with the request_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.typeCauseAction
lifetime_expiredSandbox reached its timeout.Create a new sandbox with a longer timeout.
idle_expiredNo running commands or write activity for idle_timeout.Increase idle_timeout or keep the sandbox active between commands.
out_of_memorySandbox exceeded its memory_gib allocation.Reduce memory usage or create a sandbox with more memory.
sandbox_lostUnderlying host failed.Create a new sandbox. Download artifacts incrementally during long jobs.
free_quota_exhaustedFree 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, and 504.
  • Use exponential backoff with random jitter and a retry cap.
  • Send Idempotency-Key on 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.