import json
import os
from parable_types_web_api import ImmediatePlotQueryInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = ImmediatePlotQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.parables.estimate_immediate_plot_query(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.ImmediatePlotQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParablesNamespace.EstimateImmediatePlotQuery(ctx, input){
"data": {
"aiCallSites": [
{
"functionNames": [
"<string>"
],
"maxCalls": 1
}
],
"computeCost": {
"byBytesRead": 123,
"centsPerCpuHour": 123,
"centsPerGibRead": 123,
"byCpuTime": {
"high": 123,
"low": 123,
"modelVersion": "<string>"
}
},
"input": {
"inputBytes": 0,
"inputFileCount": 0,
"unmeasuredLeaves": 0,
"inputRows": 1
},
"aiCallLimits": {
"maxCalls": 4503599627370495,
"maxCostCents": 4503599627370495
},
"elapsedMs": {
"high": 123,
"low": 123,
"modelVersion": "<string>"
}
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Gateway TimeoutEstimate a Plot query before running it
Plans the SQL exactly as a Plot preview would run it and runs nothing. inputBytes counts the files the plan reads after partition pruning and before file-statistics pruning, so it is an upper bound on what the query reads; unmeasuredLeaves above 0 means the counts are a lower bound for some sources. computeCost prices the bytes at the platform rate; its CPU-time price is null. elapsedMs is a bound from above on the engine time, once planned: high is the milliseconds the query most likely finishes within, and low is 0. It is null for SQL that calls an AI function, reads a source that reports no size, or reads more than the model was fitted on. Each aiCallSites entry is one AI-call node with maxCalls, an upper bound on its paid calls: ad-hoc SQL reads no inference log, so each row that reaches the node is one call. The counts include rows that Policies hide from the caller.
import json
import os
from parable_types_web_api import ImmediatePlotQueryInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = ImmediatePlotQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.parables.estimate_immediate_plot_query(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.ImmediatePlotQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParablesNamespace.EstimateImmediatePlotQuery(ctx, input){
"data": {
"aiCallSites": [
{
"functionNames": [
"<string>"
],
"maxCalls": 1
}
],
"computeCost": {
"byBytesRead": 123,
"centsPerCpuHour": 123,
"centsPerGibRead": 123,
"byCpuTime": {
"high": 123,
"low": 123,
"modelVersion": "<string>"
}
},
"input": {
"inputBytes": 0,
"inputFileCount": 0,
"unmeasuredLeaves": 0,
"inputRows": 1
},
"aiCallLimits": {
"maxCalls": 4503599627370495,
"maxCostCents": 4503599627370495
},
"elapsedMs": {
"high": 123,
"low": 123,
"modelVersion": "<string>"
}
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Gateway TimeoutAccess
An MCP token or a Parable token can call this operation. See Authentication for the kinds of token. Your roles must grant one oftenant.view, tenant.data.query.providers.
Errors
HTTP 400: The SQL, query parameters, or reading is not valid, or Parable cannot plan the SQL. The message gives the reason, and the code is a QL code. Correct the query using the stated reason.HTTP 403: The caller may not run this SQL, under the same rules as a Plot preview (PA-AU-019). Use an identity that may run the SQL, or estimate only what you may read.HTTP 404: The requested Parable ref or published pin is not available in this Workspace. Check the ref or commit ID and Workspace context.
Authorizations
Headers
Body
One SQL statement to run once against the Workspace's data. The operation caps no rows. The result is every row the statement returns, up to the query row limit, which fails the query rather than truncating it (QL-SQ-005). To read fewer rows, write a LIMIT in the SQL. A reader may also stop reading early: the Parable app stops at its display limit and an MCP tool call at 3 MiB of Arrow.
Positional values for $1, $2, ... placeholders, sent through Flight SQL prepared-statement binding. Values are never interpolated into SQL. Each value is a JSON scalar (string, finite number, boolean, or null). Omitted/null/empty uses the ordinary unparameterized query path.
Any valid JSON value: object, array, primitive, or null
Where the Plot runs. At most one of the two: refId is the ref being
viewed (a Proposal draft, or a Personal-mode root), commitId is a
published line's pin. Parable uses them to choose the Parable-scope rows
that workspace.preferences serves. Both absent means the Plot reads no
Preferences.
^([0-9A-Za-z]{1,22}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$