Skip to the main content
POSTGET supported0 units (free)No API key requiredMCP: gridforge_estimate

POST /v1/estimate

Free, no API key, never metered.

Server: https://gridforge-engine.fly.dev · Operation ID: gridforge_estimate · TS SDK: client.estimate()

Behaviour & Evidence Boundary

Free, no API key, never metered. What would a call cost? Name an endpoint (and, for the portfolio, how many halls) and get the units, the unit price and the cost in euro cents BEFORE spending anything. With an API key it also says whether the call fits what is left of the key's allowance or cap. Use it before any paid tool, especially in a loop. Returns: endpoint, units, unit_price_cents, estimated_cents, billable, free, the rule that produced the units, and (with a key) the remaining allowance and whether the call fits. Every numeric field in a response carries an evidence class (E0 assumed … E7 observed in operation) and a provenance digest. An agent consuming these must not present an E0 or E1 figure as a property of the physical asset. The calibration block states how far this engine has been reconciled against site data; where it says uncalibrated, it means uncalibrated.

Call via cURL, TypeScript SDK & Python CLI

cURL (HTTPS JSON)
bash
curl -sS -X POST "https://gridforge-engine.fly.dev/v1/estimate" \
  -H "Content-Type: application/json" \
  -d '{"endpoint":"/v1/study"}'
TypeScript SDK — client.estimate()
ts
import { GridForgeClient } from "@timetopower/gridforge-sdk";

const client = new GridForgeClient();
const result = await client.estimate({
  "endpoint": "/v1/study"
});
console.log(result);
Python stdlib CLI (gridforge)
bash
gridforge estimate /v1/study

Request Contract & Input Schema

Query parameters for POST /v1/estimate
Query ParameterRequiredDescription
endpointyesThe engine route to price, e.g. /v1/study. Any route that has a unit rate.
hall_countoptionalHalls in a /v1/portfolio request (one unit each). A whole number from 1 to 100000.
JSON body properties for POST /v1/estimate
FieldTypeRequiredDescription
endpointstringrequiredThe engine route to price, e.g. /v1/study.
hall_countintegeroptionalHalls in a /v1/portfolio request (one unit each). A portfolio request ranks at most 50 halls: a larger hall_count is refused with 422, as the request would be.
bodyobjectoptionalOptional: the request body you intend to send; the units are read from it exactly as the meter would.
OpenAPI 3.1 Request JSON Schema
json
{
  "type": "object",
  "required": [
    "endpoint"
  ],
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "The engine route to price, e.g. /v1/study."
    },
    "hall_count": {
      "type": "integer",
      "minimum": 1,
      "description": "Halls in a /v1/portfolio request (one unit each). A portfolio request ranks at most 50 halls: a larger hall_count is refused with 422, as the request would be."
    },
    "body": {
      "type": "object",
      "additionalProperties": true,
      "description": "Optional: the request body you intend to send; the units are read from it exactly as the meter would."
    }
  },
  "additionalProperties": false
}

Response Schema, Headers & Error Codes

Responses carry X-GridForge-Schema: gridforge/api/1, x-request-id, metering headers (X-GridForge-Units, X-GridForge-Units-Month, X-GridForge-Units-Remaining), rate-limit headers (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset), and RFC 9745/8594 Deprecation / Sunset headers when applicable. POST calls accept Idempotency-Key up to 150 characters.

OpenAPI 3.1 200 Response Schema
json
{
  "type": "object"
}
Error codes returned by POST /v1/estimate
StatusCondition
400the body is not valid JSON or not a JSON object, or the Idempotency-Key is longer than the limit
401a metered route was called without a key, or with one the engine does not accept
402the key's monthly allowance or cap is spent; the call was refused and not charged. Buy more, do not retry
409the requested action conflicts with current readiness or state (for example require_rfq_ready on an architecture that is not yet RFQ-ready)
422the input is too thin or invalid, or an Idempotency-Key was reused with a different body; nothing was solved
429the per-client request rate limit was exceeded; wait and retry (the limit is rate_limit_per_minute at /v1/version)
503paid endpoints are not configured on that deployment, or a charge could not be recorded durably

Worked Example (examples/intake/reference_hall.json)

SYNTHETIC REFERENCE DATA

SYNTHETIC REFERENCE DATA — every request and response in this file was generated deterministically by running the real GridForge Python engine against examples/intake/reference_hall.json. Not a measurement of any customer asset.

Synthetic Request — POST /v1/estimate
json
{
  "endpoint": "/v1/study"
}
Real Engine Output (Synthetic Hall) — POST /v1/estimate
json
{
  "schema_version": "gridforge/api/1",
  "endpoint": "/v1/study",
  "units": 5,
  "unit_price_cents": 200,
  "currency": "eur",
  "estimated_cents": 1000,
  "billable": true,
  "free": false,
  "basis": "fixed 5 units per call, whatever the size of the intake. Units are reserved when the call starts and refunded if it produces no answer.",
  "note": "estimated_cents is what pay-as-you-go would charge. A subscription's units come out of its monthly allowance; the free allowance is never invoiced."
}
Query Form Output — GET /v1/estimate?endpoint=/v1/study
json
{
  "schema_version": "gridforge/api/1",
  "endpoint": "/v1/study",
  "units": 5,
  "unit_price_cents": 200,
  "currency": "eur",
  "estimated_cents": 1000,
  "billable": true,
  "free": false,
  "basis": "fixed 5 units per call, whatever the size of the intake. Units are reserved when the call starts and refunded if it produces no answer.",
  "note": "estimated_cents is what pay-as-you-go would charge. A subscription's units come out of its monthly allowance; the free allowance is never invoiced."
}