/api/v1/x402/forecastPay 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.
Ephemeris API · v1
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.
https://ephemeris-staging.cascade.industries/api/v1Start here
Create an API key in the dashboard, add credits, and submit a forecast. Keep the same idempotency key when retrying an identical request.
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]
}'Security
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.
Authorization: Bearer pc_live_your_keyReference
/api/v1/x402/forecastExplicit-model forecasts paid in USDC through x402 v2. No Ephemeris account or API key required; an unsigned request returns a payment quote.
/api/v1/modelsLists available models with their price and maximum billable context.
/api/v1/balanceReturns the credits you can spend now. Credits reserved by in-progress forecasts are excluded.
/api/v1/forecastRuns a forecast and returns the result with the models used and the cost.
/api/v1/usageReturns paginated forecast request history. Supports limit and offset query parameters.
Core operation
You pick the model. Use this when you already know which one fits your data.
Ephemeris picks the best model for your series. If that model fails, it falls back to a small ensemble.
Runs all compatible models and blends the results. Models that fail are left out and not charged.
| Field | Type | Requirement |
|---|---|---|
mode | string | Required: explicit, route, or ensemble. |
model | string | Required only for explicit mode. |
series | object[] | One or more entries containing numeric values. |
series[].values | number[] | number[][] | Flat for univariate; nested for multivariate. |
series[].freq | string | Optional per-series frequency; mixed batches are split safely upstream. |
series[].covariates | object | Optional aligned past and known-future named channels. |
context_len | integer | How many recent points to bill for. Defaults to 256. |
horizon | integer | Optional; defaults to 64. |
quantiles | number[] | Optional values strictly between 0 and 1. |
top_k | integer | Optional ensemble-only model limit from 1 to 16. |
combine | string | How ensemble results are blended. Mixture averages distributions; vincentize averages quantiles. Defaults to mixture. |
Safe retries
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.
Idempotency-Key: forecast-2026-08-26-001{
"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.
Model Context Protocol
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.
https://ephemeris-staging.cascade.industries/api/mcpCreate 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.
{
"mcpServers": {
"ephemeris": {
"url": "https://ephemeris-staging.cascade.industries/api/mcp",
"headers": {
"Authorization": "Bearer pc_live_your_key"
}
}
}
}| Client | Where |
|---|---|
| Cursor | .cursor/mcp.json |
| Claude Code | terminal, 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 Desktop | claude_desktop_config.json, through the mcp-remote bridge |
| OpenAI Responses API and Agents SDK | hosted MCP tool |
| Anthropic Messages API | MCP connector |
| Any other client or SDK | Streamable HTTP transport |
.cursor/mcp.json
{
"mcpServers": {
"ephemeris": {
"url": "https://ephemeris-staging.cascade.industries/api/mcp",
"headers": {
"Authorization": "Bearer pc_live_your_key"
}
}
}
}terminal, or .mcp.json with the generic config
claude mcp add --transport http ephemeris \
https://ephemeris-staging.cascade.industries/api/mcp \
--header "Authorization: Bearer pc_live_your_key".vscode/mcp.json
{
"servers": {
"ephemeris": {
"type": "http",
"url": "https://ephemeris-staging.cascade.industries/api/mcp",
"headers": {
"Authorization": "Bearer pc_live_your_key"
}
}
}
}~/.codex/config.toml, key read from an environment variable
[mcp_servers.ephemeris]
url = "https://ephemeris-staging.cascade.industries/api/mcp"
bearer_token_env_var = "EPHEMERIS_API_KEY"~/.gemini/settings.json
{
"mcpServers": {
"ephemeris": {
"httpUrl": "https://ephemeris-staging.cascade.industries/api/mcp",
"headers": {
"Authorization": "Bearer pc_live_your_key"
}
}
}
}claude_desktop_config.json, through the mcp-remote bridge
{
"mcpServers": {
"ephemeris": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://ephemeris-staging.cascade.industries/api/mcp",
"--header", "Authorization: Bearer pc_live_your_key"
]
}
}
}hosted MCP tool
"tools": [{
"type": "mcp",
"server_label": "ephemeris",
"server_url": "https://ephemeris-staging.cascade.industries/api/mcp",
"headers": { "Authorization": "Bearer pc_live_your_key" }
}]MCP connector
"mcp_servers": [{
"type": "url",
"url": "https://ephemeris-staging.cascade.industries/api/mcp",
"name": "ephemeris",
"authorization_token": "pc_live_your_key"
}]Streamable HTTP transport
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>"forecastRuns 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.
list_modelsThe live model panel with prices and context caps.
get_balanceSpendable credits, excluding holds from in-flight forecasts.
get_usageNewest-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.
Pay per request
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.
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.
curl https://ephemeris-staging.cascade.industries/api/v1/models \
--header "Authorization: Bearer $EPHEMERIS_API_KEY"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 --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]
}'accepts: check network, asset, payTo, and amount against your spending policy. USDC has six decimals: an amount of 1000 is 0.001 USDC.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.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.
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.
forecast without payment. The result has isError: true and the same payment challenge in structuredContent and content[0].text; no forecast runs.extra.ephemerisQuote.params._meta["x402/payment"]. The successful result contains the forecast and a settlement receipt at _meta["x402/payment-response"].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.
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.
Millicredits
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.
“mc” means millicredits.
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.
Read model prices and maximum billable context from GET /models.
Request guardrails
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.
Recovery
400The body, limits, mode, model, or pagination is invalid.
401The bearer API key is missing, invalid, or revoked.
402Top up using the returned topup_url, then retry.
409The key is in progress or was reused with a different body.
429Retry after the number of seconds in Retry-After.
503Pricing or the model service is unavailable.
Ready to forecast