What happens between the grid and the model.

The grid sends a sentence and a description of its columns. Gridsay checks who is asking, checks what they may spend, asks a model, checks the answer against the grid, and returns grid state. This page describes each step, so you can judge it before you send it a request.

01

Eleven steps, most of them before the model is called.

  1. Key. The x-api-key header identifies your organization, the key type and its quality tier. (refused, free)

  2. Origin. A publishable key accepts requests only from the origins you listed. A secret key can be locked to origins too. (refused, free)

  3. End user. A publishable key needs a verified user on every request. A secret key trusts your server, which may pass its own reference id for the user. (refused, free)

  4. Request. The body and the column definitions are checked. A request over 2 MB, or with column definitions over 1,000,000 characters, is refused before anything else happens. (refused, free)

  5. Spending cap. If your organization has used its credits and reached its cap, the question is refused here. (refused, free)

  6. Limits. For a publishable key, your limits for the key and for this user are counted. (refused, free)

  7. Model provider

    Model. The question, your columns and, if there is one, the conversation so far go to the model for the key’s tier. If that model does not answer, a second model from another vendor does. For a key set to auto, a small model first reads the question and picks the tier.

  8. Check. The answer is checked against your columns and the operators each one allows, and against what your grid allows when our browser helper reports it.

  9. Correct once. If part of the answer cannot be applied, the model sees its answer and the list of problems and gets one more try. If the second answer still cannot be applied, the request is refused with a sentence for your user. (refused, charged)

  10. Charge. An answered question uses credits. So does one the model declined (“I can’t do that with these columns”). Requests refused in steps 1 to 6, and failures on our side, are free and do not count against your limits.

  11. Respond and log. The grid gets its state, with how many questions are used and left this period. The request log and the conversation turn are written after the response is sent.

02

Through your server, or straight from the browser.

Secret keyPublishable key
Where it livesYour server onlyIn your web page
Path of a questionBrowser → your server route → GridsayBrowser → Gridsay
Who the user isYour server vouches; it may send a reference idVerified on every request: JWT or OIDC token, a session token from your server, or your identity webhook
OriginsOptional lockRequired: at least one
LimitsYour organization’s spending capThe cap, plus limits per key, per user and per rule
Grid codeMUI’s stock resolver, unchangedOur browser helper, because the stock resolver cannot send headers
PlansEvery planEvery plan

Start with a secret key if you are moving from MUI’s hosted service: your route already exists, and the change is two lines. Use a publishable key when you would rather not run a route, or when your grid faces your customers and you want each of them counted and limited separately.

03

The grid only receives answers it can apply.

The MUI X Data Grid throws an error when an answer filters on a column it does not have. Models also return answers that look right and are not: an operator the column does not allow, a sort on the checkbox column, two functions on one pivot field, a text value in a number filter. Gridsay checks every answer for these before it leaves.

Without our browser helper, the check uses what the grid sends: column names, types and allowed operators. With the helper, it also knows which features you switched off, which columns cannot be filtered, sorted, grouped, pivoted or aggregated, the stored values behind single-select labels, and what the user changed by hand since the last answer.

When something fails, the user reads a sentence such as:

  • “Sorting is switched off for this table.”
  • “The salary column can’t be grouped.”
  • “A pivot can show only one function per column. Ask for one of them, or use two separate columns.”
  • “I couldn’t apply that request to this table. Try rephrasing it.”
Model answer
{  "filters": [    { "column": "country",      "operator": "isAnyOf",      "value": ["Germany", "France"] },    { "column": "salary",      "operator": "contains",      "value": "100k" }  ],  "sorting": [    { "column": "salary",      "direction": "desc" }  ]}
  • Erroran operator the column does not allow
  • Errora text value in a number filter
Assistant

people in Germany or France earning over 100k, highest paid first

I couldn’t apply that request to this table. Try rephrasing it.

04

An optional helper for the grid’s onPrompt.

MUI’s stock resolver sends the request and shows the reply. Our helper replaces it in one line and adds what the stock resolver cannot do:

  • It tells the server what your grid allows and shows now, so answers respect switched-off features and follow-ups build on changes the user made by hand.
  • It checks the response before the grid touches it. A malformed answer leaves the grid as it was.
  • It makes “top 5” work when fewer rows exist than were asked for, keeps group order when a grouped column is sorted, and leaves pivot mode cleanly.
  • It sends one prompt at a time, so a follow-up always builds on the previous answer.
  • It sends your publishable key and your user’s token, for calling Gridsay from the browser.

It has no runtime dependencies. It reads some of the grid’s settings from internal props that are tested with version 9.18; if a later version moves them, the helper treats every feature as switched on.

The helper is not published yet. This page will show how to install it when it is.

url

Required. Where the prompt is posted: your own server route, or your Gridsay gateway address.

apiRef

The grid’s apiRef. With it, the helper describes the grid to the server and adapts answers to it.

publishableKey

A publishable key, sent as x-api-key, for calling Gridsay straight from the browser.

getToken

Returns your user’s token for each request, sent as Authorization: Bearer ….

headers

An object, or a function returning one, added to each request.

additionalContext

Sent as the stock resolver sends it.

privateMode

Sent as the stock resolver sends it.

referenceId

Sent as the stock resolver sends it.

05

Every browser request carries a verified user.

A publishable key is visible to anyone who opens your page, so the key alone proves nothing. Each request must also carry your user’s identity, checked by one of three methods:

JWT or OIDC.

Use this whenYour users already sign in with a provider that issues tokens.

Give us your provider’s issuer (we find its signing keys) or a JWKS URL, the audience your tokens are issued for, and the claim that holds the user id. The dashboard has notes for Clerk, Auth0, Supabase, Firebase, Cognito, Microsoft Entra ID, Okta, WorkOS and Better Auth. Tokens signed with a shared HS256 secret also work; the secret is stored encrypted and never shown again.

Session tokens.

Use this whenYour app has no JWTs, and your server knows who is signed in.

For apps without JWTs. Your server asks Gridsay for a short-lived token for a user, with a secret key, and hands it to the browser.

Identity webhook.

Use this whenYou would rather your own endpoint say who each user is.

We forward a header your page sets to your endpoint, which answers with the user’s id and attributes. Answers can be cached for up to an hour. Requests to your endpoint are signed.

The claims in the token, or the attributes your webhook returns, are what your limit rules match on. Custom methods, built with you, are available on Enterprise.

06

Limits per key, per user and per kind of user.

A publishable key can carry limits for the key as a whole and an ordered list of rules for its users. The first rule whose condition matches a user applies. A condition tests one claim: equal to, one of, starts with, ends with, at least, at most, or present. Each rule sets limits per minute, hour, day or calendar month (UTC), or reads the monthly limit from a claim in your token, so your own system can carry each customer’s quota.

For example:

RuleUsersLimitWhat they see at the limit
1whose plan is enterprise60 a minute, 5,000 a monththe default message, with when to try again
2whose email ends with @yourcompany.com120 a minutethe default message
Catch-alleveryone else10 a minute, 50 a day, 300 a month“You have used this month’s AI questions. Upgrade to continue.”

The message is shown in the grid’s assistant panel as you wrote it, so a rule can point a user to your upgrade page. A question refused by a limit uses no credits.

07

Messages for your users. Details for your developers.

The grid shows our message in the assistant panel exactly as we send it, so every message is written for the person using your product. Each error also carries a code and, where it helps, a detail for your developers that the grid does not show.

WhenThe user reads
The key is missing or wrongThe assistant is not available right now.
The page’s origin is not on the key’s listThe assistant is not available on this site.
No signed-in user, or the token is invalidSign in to use the assistant.
The user reached one of your limitsYour rule’s message, or when to try again
Too many requests on the keyThe assistant is busy. Try again in 20 seconds.
Your organization reached its spending capThe assistant has reached this month’s limit.
The table’s description is too largeThis table is too large for the assistant.
The model cannot do what was askedThe model’s own sentence, for example “There is no column for region in this table.”
The model provider is downThe assistant is temporarily unavailable. Try again.
Assistant

revenue by region

Refused

There is no column for region in this table.

08

Three tiers, chosen per key or per question.

TierModel todayIf it does not answerCredits per questionUse it for
fast defaultClaude Haiku 5.5, low reasoningGPT-6 Luna1Most grids
accurateClaude Sonnet 5.5, low reasoningGPT-6.2 Sol10Screens where a wrong filter is costly
maxClaude Opus 5.5, low reasoningGPT-6.2 Astra25Teams that want the largest model we run
autoDeepSeek V4 Flash, no reasoning, picks fast or accurate, or max if the key allows itfast answers1 or 10; 25 if the key allows maxKeys where you would rather not choose a tier

Models reach us through OpenRouter. We change the model behind a tier when a newer one scores better on our benchmark; the tier’s name and price stay. Accuracy for each tier is on the accuracy page.

A key set to auto sends the text of each question, and nothing else from the request, to a small model that picks fast or accurate, or max if the key allows it. That tier answers, and the question costs what it costs. The small model starts together with the fast answer, so a question it leaves on fast is not delayed; if it is slow or fails, fast answers. The response’s meta.tier says which tier answered, for every key. On our requests, auto sent about one question in a hundred to a higher tier and cost 1.12 credits a question on average; it did not measurably improve accuracy. New keys start on fast.

See the benchmark 

09

Follow-ups remember. Private mode forgets.

Each answer carries a conversation id. When the grid sends it back with the next question, the model sees the earlier turns, so “only remote ones” narrows the previous answer. With a publishable key, a conversation belongs to the user who started it; another user of the same key cannot continue it.

Set privateMode and Gridsay stores neither the question nor the answer, and keeps no conversation: each question starts fresh. The request log keeps only counts, tokens, cost, timing and the outcome.

Follow-ups remember
  1. people in Germany or France earning over 100k

    • filter country is any of Germany, France
    • filter salary > 100,000
  2. only remote ones

    • filter country is any of Germany, France
    • filter salary > 100,000
    • filter remote is Yes
Private mode forgets
  1. people in Germany or France earning over 100k

    • filter country is any of Germany, France
    • filter salary > 100,000
  2. only remote ones

    • filter remote is Yes

Send your first question.

Create a key, point your route at Gridsay, and ask your grid something.