ephemerisAPI docs

Ephemeris API · v1

Time-series forecasting through one API.

Send a time series and get a probabilistic forecast back. Choose one model, let Ephemeris choose, or run an ensemble. Credits are reserved up front and you are charged only for the models that ran. Wallet agents can also pay USDC per explicit-model forecast through x402.

Base URLhttps://ephemeris-staging.cascade.industries/api/v1
01

Start here

Quickstart

Create an API key in the dashboard, add credits, and submit a forecast. Keep the same idempotency key when retrying an identical request.

cURL
UTF-8
curl --request POST \
  --url https://ephemeris-staging.cascade.industries/api/v1/forecast \
  --header "Authorization: Bearer pc_live_your_key" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: forecast-2026-08-26-001" \
  --data '{
    "mode": "route",
    "series": [{
      "values": [100.2, 101.4, 99.8, 103.1, 104.6, 102.2],
      "freq": "H"
    }],
    "horizon": 24,
    "quantiles": [0.1, 0.5, 0.9]
  }'
02

Security

Authentication

Bearer API keys

The models, balance, usage, and standard forecast endpoints require an Ephemeris API key in the Authorization header. The x402 forecast endpoint uses wallet payment instead. Store keys server-side and revoke any key that may have been exposed.

Header
UTF-8
Authorization: Bearer pc_live_your_key
03

Reference

Endpoints

POST/api/v1/x402/forecast

Pay per forecast with an agent wallet

Explicit-model forecasts paid in USDC through x402 v2. No Ephemeris account or API key required; an unsigned request returns a payment quote.

GET/api/v1/models

List models

Lists available models with their price and maximum billable context.

GET/api/v1/balance

Get balance

Returns the credits you can spend now. Credits reserved by in-progress forecasts are excluded.

POST/api/v1/forecast

Run a forecast

Runs a forecast and returns the result with the models used and the cost.

GET/api/v1/usage

List usage

Returns paginated forecast request history. Supports limit and offset query parameters.

04

Core operation

Forecast request

explicit

Single model

You pick the model. Use this when you already know which one fits your data.

route

Auto-select

Ephemeris picks the best model for your series. If that model fails, it falls back to a small ensemble.

ensemble

Ensemble

Runs all compatible models and blends the results. Models that fail are left out and not charged.

FieldTypeRequirement
modestringRequired: explicit, route, or ensemble.
modelstringRequired only for explicit mode.
seriesobject[]One or more entries containing numeric values.
series[].valuesnumber[] | number[][]Flat for univariate; nested for multivariate.
series[].freqstringOptional per-series frequency; mixed batches are split safely upstream.
series[].covariatesobjectOptional aligned past and known-future named channels.
context_lenintegerHow many recent points to bill for. Defaults to 256.
horizonintegerOptional; defaults to 64.
quantilesnumber[]Optional values strictly between 0 and 1.
top_kintegerOptional ensemble-only model limit from 1 to 16.
combinestringHow ensemble results are blended. Mixture averages distributions; vincentize averages quantiles. Defaults to mixture.

Safe retries

Use an idempotency key

For the API-key forecast endpoint, keys accept 8–128 letters, numbers, dots, underscores, colons, or hyphens. Completed retries return the stored response without running or charging for the forecast again.

Request header
UTF-8
Idempotency-Key: forecast-2026-08-26-001
Example response
UTF-8
{
  "forecasts": [
    {
      "quantiles": {
        "0.1": [103.8, 104.1, 104.5],
        "0.5": [105.2, 105.7, 106.1],
        "0.9": [106.9, 107.4, 108.0]
      }
    }
  ],
  "meta": {
    "gateway_request_id": "req_01J...",
    "request_id": "model_01J...",
    "models_used": ["chronos2"],
    "model_revisions": { "chronos2": "3f9c1e0a..." },
    "billing": {
      "settled_mc": "12",
      "balance_mc": "4988"
    }
  }
}

forecasts has one entry per input series, in request order. Univariate entries return flat horizon arrays; multivariate entries return nested arrays. Quantile keys are decimal strings such as 0.5. meta.model_revisions names the exact weights (Hugging Face commit) each model served, so a forecast can be tied to a model revision, not just an API version.

05

Model Context Protocol

Agents (MCP)

Ephemeris is a remote MCP server. Any client that speaks the Model Context Protocol over Streamable HTTP can use it: coding agents, desktop assistants, agent frameworks and server-side SDKs alike. There is nothing to install and no client is preferred; the endpoint and one header are all a client needs.

MCP endpointhttps://ephemeris-staging.cascade.industries/api/mcp

Connect your account

Create an API key on the API keys page and add credits. Register the endpoint in your client with the key as a bearer header. Every call the agent makes is charged to that key's account and shows up in usage. Revoke the key to disconnect the agent.

Most clients accept the JSON on the right as-is. Client-specific shapes follow below.

Generic config (mcpServers)
UTF-8
{
  "mcpServers": {
    "ephemeris": {
      "url": "https://ephemeris-staging.cascade.industries/api/mcp",
      "headers": {
        "Authorization": "Bearer pc_live_your_key"
      }
    }
  }
}
ClientWhere
Cursor.cursor/mcp.json
Claude Codeterminal, or .mcp.json with the generic config
VS Code (Copilot).vscode/mcp.json
Codex CLI~/.codex/config.toml, key read from an environment variable
Gemini CLI~/.gemini/settings.json
Claude Desktopclaude_desktop_config.json, through the mcp-remote bridge
OpenAI Responses API and Agents SDKhosted MCP tool
Anthropic Messages APIMCP connector
Any other client or SDKStreamable HTTP transport

Cursor

.cursor/mcp.json

Config
UTF-8
{
  "mcpServers": {
    "ephemeris": {
      "url": "https://ephemeris-staging.cascade.industries/api/mcp",
      "headers": {
        "Authorization": "Bearer pc_live_your_key"
      }
    }
  }
}

Claude Code

terminal, or .mcp.json with the generic config

Config
UTF-8
claude mcp add --transport http ephemeris \
  https://ephemeris-staging.cascade.industries/api/mcp \
  --header "Authorization: Bearer pc_live_your_key"

VS Code (Copilot)

.vscode/mcp.json

Config
UTF-8
{
  "servers": {
    "ephemeris": {
      "type": "http",
      "url": "https://ephemeris-staging.cascade.industries/api/mcp",
      "headers": {
        "Authorization": "Bearer pc_live_your_key"
      }
    }
  }
}

Codex CLI

~/.codex/config.toml, key read from an environment variable

Config
UTF-8
[mcp_servers.ephemeris]
url = "https://ephemeris-staging.cascade.industries/api/mcp"
bearer_token_env_var = "EPHEMERIS_API_KEY"

Gemini CLI

~/.gemini/settings.json

Config
UTF-8
{
  "mcpServers": {
    "ephemeris": {
      "httpUrl": "https://ephemeris-staging.cascade.industries/api/mcp",
      "headers": {
        "Authorization": "Bearer pc_live_your_key"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json, through the mcp-remote bridge

Config
UTF-8
{
  "mcpServers": {
    "ephemeris": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://ephemeris-staging.cascade.industries/api/mcp",
        "--header", "Authorization: Bearer pc_live_your_key"
      ]
    }
  }
}

OpenAI Responses API and Agents SDK

hosted MCP tool

Config
UTF-8
"tools": [{
  "type": "mcp",
  "server_label": "ephemeris",
  "server_url": "https://ephemeris-staging.cascade.industries/api/mcp",
  "headers": { "Authorization": "Bearer pc_live_your_key" }
}]

Anthropic Messages API

MCP connector

Config
UTF-8
"mcp_servers": [{
  "type": "url",
  "url": "https://ephemeris-staging.cascade.industries/api/mcp",
  "name": "ephemeris",
  "authorization_token": "pc_live_your_key"
}]

Any other client or SDK

Streamable HTTP transport

Config
UTF-8
URL:     https://ephemeris-staging.cascade.industries/api/mcp
Header:  Authorization: Bearer pc_live_your_key

Stateless: no session id, no SSE stream to keep open.
Stdio-only clients: npx mcp-remote <url> --header "Authorization: Bearer <key>"
toolforecast

Runs the same pipeline as POST /api/v1/forecast. Accepts an optional idempotency_key and returns the forecast plus a one-line summary of models used and credits charged.

toollist_models

The live model panel with prices and context caps.

toolget_balance

Spendable credits, excluding holds from in-flight forecasts.

toolget_usage

Newest-first request log with pagination.

The transport is stateless Streamable HTTP; there is no session to keep alive. Every forecast result includes settled_mc and balance_mc so the agent, and you, can see what each call cost. A missing or revoked key returns 401; an empty balance returns a tool error carrying a top-up link the agent can hand back to you. OAuth sign-in for one-click connectors is planned; today every client needs a key.

06

Pay per request

Agent wallet payments (x402)

A wallet-equipped agent can buy one forecast with USDC without creating an Ephemeris account. This delivers the forecast directly; it does not buy a credit pack or increase a dashboard balance. Use the REST endpoint below or connect an x402-capable MCP client to /api/mcp/x402. The existing /api/mcpendpoint uses API keys and account credits.

Discover models and their prices

Browse model capabilities and the public pricing page. Agents with an API key can retrieve the JSON catalog below. Use the returned model name exactly, and check its capabilities, price_per_kslot_mc, and billing_context_cap. Without an API key, the unsigned x402 request gives the authoritative price for that request.

Model catalog (API key required)
UTF-8
curl https://ephemeris-staging.cascade.industries/api/v1/models \
  --header "Authorization: Bearer $EPHEMERIS_API_KEY"

Get a quote before paying

Send a forecast with mode: explicit and an active model. Routing and ensembles are not supported by x402. The example returns HTTP 402 with a JSON challenge and a base64 PAYMENT-REQUIREDheader. This request does not make a payment or run a forecast.

cURL · unpaid quote
UTF-8
curl --include --request POST \
  --url https://ephemeris-staging.cascade.industries/api/v1/x402/forecast \
  --header "Content-Type: application/json" \
  --data '{
    "mode": "explicit",
    "model": "chronos2",
    "series": [{"values": [100.2, 101.4, 99.8, 103.1, 104.6, 102.2], "freq": "H"}],
    "context_len": 256,
    "horizon": 16,
    "quantiles": [0.1, 0.5, 0.9]
  }'

Let your wallet client pay and receive the forecast

  1. Use an x402 v2 client, such as Coinbase Agentic Wallet tooling. Fund the buyer wallet with USDC on the network in the challenge.
  2. Inspect accepts: check network, asset, payTo, and amount against your spending policy. USDC has six decimals: an amount of 1000 is 0.001 USDC.
  3. Sign the offered requirements, preserving all extra fields including ephemerisQuote. Retry the same URL and unchanged JSON body with the base64 PAYMENT-SIGNATURE header. A compatible client handles this exchange automatically.
  4. HTTP 200 returns the forecast and a base64 PAYMENT-RESPONSE settlement receipt. Decode that receipt to record the transaction, payer, and network alongside the forecast.

Follow the official Coinbase buyer quickstart for wallet client setup, then use this POST endpoint and request body. Buyer wallet credentials stay in your agent environment; never send private keys or CDP secrets to Ephemeris.

Pay directly through MCP

Connect to /api/mcp/x402 over Streamable HTTP without an Authorization header. This server exposes free list_modelsdiscovery and a paid forecast tool. Use an x402 v2 MCP client with a funded wallet; a regular MCP client alone cannot sign a payment. Forecast arguments require mode: explicitand a model returned by discovery.

  1. Call forecast without payment. The result has isError: true and the same payment challenge in structuredContent and content[0].text; no forecast runs.
  2. Select one offered network, inspect the price and payee, and sign with your wallet. Preserve all accepted requirements, including extra.ephemerisQuote.
  3. Repeat the unchanged tool arguments with the payment at params._meta["x402/payment"]. The successful result contains the forecast and a settlement receipt at _meta["x402/payment-response"].
  4. Keep the signed tool call for retries. An identical completed retry returns the stored result and receipt without another charge. A quote belongs to its REST or MCP entry point; obtain a new unpaid quote when switching transports.

Follow Coinbase's MCP payment guide for the wire format. Wallet keys stay with the buyer. This endpoint has no account balance or credit-pack purchase tools.

Price, expiry, and safe retries

The same model cost formula below applies. One mc costs 0.000001 USDC; 3000 mc costs 0.003 USDC. Credit-pack bonuses do not apply. Quotes last ten minutes and requests above 100 USDC are rejected. A challenge can offer multiple configured networks: Base, Polygon, Arbitrum or World on mainnet, and Base Sepolia or World Sepolia for testing. Choose one entry from accepts that your wallet supports and holds USDC on. Only networks enabled on this deployment and available from the facilitator are offered. A payment on one network does not move funds across chains. Solana is not supported by this EVM payment integration.

If your wallet SDK has no default token for World, explicitly allow the verified USDC contract from the challenge with a per-payment spending cap. Keep your network, token and payee allowlists enabled.

After submitting a signed payment, retain that exact signed request. A completed retry returns the saved forecast and receipt without another charge. HTTP 409 means the payment is processing, conflicts, or needs reconciliation: do not create a second payment. On a timeout or HTTP 503, retry the same signed request. If unresolved, contact support with the payer address and receipt, if available. A signed request cannot be reused for a different forecast.

Before signing, HTTP 400 means the request or price is invalid, and HTTP 402 supplies a quote or rejects a payment authorization. HTTP 429 means rate limited. HTTP 502 means forecast or settlement failure; read the returned error before attempting another payment. HTTP 503 can also mean x402 is disabled on that deployment.

07

Millicredits

Pricing

Cost per model

price_per_kslot_mc × slots × ceil(context / 1024) × ceil(horizon / 64)

Each model is priced per series, per 1,024 context points, and per 64 forecast steps.

1 credit = 1,000 mc

“mc” means millicredits.

Reserve, then charge

Before a forecast runs, Ephemeris reserves the maximum possible cost. You are charged only for models that returned a result, and the rest is released.

Live prices

Read model prices and maximum billable context from GET /models.

08

Request guardrails

Limits

Series64per request
Series slots256variates total
Context16,384points per variate
Horizon4,096forecast steps
Quantiles21per request
JSON body10 MBmaximum

Slots × horizon × quantiles must not exceed 120,000 output values. Requests without explicit quantiles are budgeted as 21 quantiles. API-key forecasts use a token bucket of 10 requests per minute with a burst of 20. Calls waiting longer than 30 seconds return 429 with guidance on when to retry.

09

Recovery

Errors

400

Invalid request

The body, limits, mode, model, or pagination is invalid.

401

Unauthorized

The bearer API key is missing, invalid, or revoked.

402

Insufficient credits

Top up using the returned topup_url, then retry.

409

Idempotency conflict

The key is in progress or was reused with a different body.

429

Rate limited

Retry after the number of seconds in Retry-After.

503

Temporarily unavailable

Pricing or the model service is unavailable.

Ready to forecast

Create a key and run your first request.