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 -sS -X POST "https://gridforge-engine.fly.dev/v1/estimate" \
-H "Content-Type: application/json" \
-d '{"endpoint":"/v1/study"}'import { GridForgeClient } from "@timetopower/gridforge-sdk";
const client = new GridForgeClient();
const result = await client.estimate({
"endpoint": "/v1/study"
});
console.log(result);gridforge estimate /v1/studyRequest Contract & Input Schema
| Query Parameter | Required | Description |
|---|---|---|
| endpoint | yes | The engine route to price, e.g. /v1/study. Any route that has a unit rate. |
| hall_count | optional | Halls in a /v1/portfolio request (one unit each). A whole number from 1 to 100000. |
| Field | Type | Required | Description |
|---|---|---|---|
| endpoint | string | required | The engine route to price, e.g. /v1/study. |
| hall_count | integer | optional | 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 | object | optional | Optional: the request body you intend to send; the units are read from it exactly as the meter would. |
{
"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.
{
"type": "object"
}| Status | Condition |
|---|---|
| 400 | the body is not valid JSON or not a JSON object, or the Idempotency-Key is longer than the limit |
| 401 | a metered route was called without a key, or with one the engine does not accept |
| 402 | the key's monthly allowance or cap is spent; the call was refused and not charged. Buy more, do not retry |
| 409 | the requested action conflicts with current readiness or state (for example require_rfq_ready on an architecture that is not yet RFQ-ready) |
| 422 | the input is too thin or invalid, or an Idempotency-Key was reused with a different body; nothing was solved |
| 429 | the per-client request rate limit was exceeded; wait and retry (the limit is rate_limit_per_minute at /v1/version) |
| 503 | paid endpoints are not configured on that deployment, or a charge could not be recorded durably |
Worked Example (examples/intake/reference_hall.json)
SYNTHETIC REFERENCE DATASYNTHETIC 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.
{
"endpoint": "/v1/study"
}{
"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."
}{
"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."
}