Skip to content
MUI’s hosted AI Assistant backend shuts down at the end of 2026.Switch in two lines →
  • Products
    • AG Grid AI Toolkit Early accessThe model and the server behind the toolkit.
    • MUI X Data Grid StableThe backend for the Premium AI Assistant.
    • TanStack Table Public alphaA plugin that applies each answer to your table.
    • AG Studio Early accessA hosted backend for its assistant, not built yet.
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
Sign inStart a 7-day trial
Menu
  • Products
    • AG Grid AI Toolkit Early access
    • MUI X Data Grid Stable
    • TanStack Table Public alpha
    • AG Studio Early access
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
  • Sign in

Product

  • How it works
  • Accuracy
  • Pricing
  • Data and security

Grids

  • AG Grid AI ToolkitEarly access
  • MUI X Data Grid PremiumStable
  • TanStack TablePublic alpha
  • AG StudioEarly access

Docs

  • Quickstart: server route
  • Browser keys
  • Guide: when MUI’s service retires

Company

  • Contact
  • Terms
  • Privacy

Not affiliated with or endorsed by MUI or AG Grid. MUI and AG Grid are trademarks of their respective owners.

© 2026 Gridsay

Docs pages
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core
On this page

On this page

  1. Ask a question
  2. What is sent to the model
  3. Request body
  4. options
  5. Columns inside context
  6. grid
  7. grid.columns, per column
  8. grid.state
  9. Response body
  10. What the answer is checked against
  11. Refusal
  12. Status codes
  13. Size limits
  14. Next
Skip to the article
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core

Data Grid endpoint

On this page

  1. Ask a question
  2. What is sent to the model
  3. Request body
  4. options
  5. Columns inside context
  6. grid
  7. grid.columns, per column
  8. grid.state
  9. Response body
  10. What the answer is checked against
  11. Refusal
  12. Status codes
  13. Size limits
  14. Next

POST https://api.gridsay.com/api/v1/datagrid/prompt answers questions from MUI X Data Grid and TanStack Table. You send the question and your columns; the answer is the complete state for the table to apply: filters, sorting, grouping, totals, pivot, chart and selection. It never contains rows or computed values.

Ask a question#

Ask

people in Germany or France earning over 100k

Changes2 changes
  1. 1filter country is any of Germany, France
  2. 2filter salary is greater than 100000

The same question over HTTP:

Shell
curl https://api.gridsay.com/api/v1/datagrid/prompt \  --header 'Content-Type: application/json' \  --header 'x-api-key: sk_gs_FAKE_EXAMPLE_DO_NOT_USE' \  --data-binary @- <<'JSON'{  "query": "people in Germany or France earning over 100k",  "context": "[{\"field\":\"country\",\"type\":\"string\",\"allowedOperators\":[\"equals\",\"isAnyOf\"]},{\"field\":\"salary\",\"type\":\"number\",\"allowedOperators\":[\"=\",\">\",\"<\"]}]"}JSON
JavaScript
// On your server: the secret key never reaches the browser.const key = process.env.GRIDSAY_SECRET_KEY;if (!key || !(key.startsWith('sk_gs_') || key.startsWith('sk_ayt_'))) throw new Error('Set GRIDSAY_SECRET_KEY to a secret key.'); const columns = [  { field: 'country', type: 'string', allowedOperators: ['equals', 'isAnyOf'] },  { field: 'salary', type: 'number', allowedOperators: ['=', '>', '<'] },];const response = await fetch('https://api.gridsay.com/api/v1/datagrid/prompt', {  method: 'POST',  headers: { 'Content-Type': 'application/json', 'x-api-key': key },  body: JSON.stringify({    query: 'people in Germany or France earning over 100k',    context: JSON.stringify(columns),  }),  // A redirect would send your key to another address.  redirect: 'error',});const answer = await response.json();if (!answer.ok) throw new Error(answer.message);console.log(answer.data.filters);

HTTP 201. The filters are the recorded answer; conversationId and the meta values are examples, since they depend on your key and your organization's usage:

JSON
{  "ok": true,  "data": {    "select": -1,    "filters": [      { "column": "country", "operator": "isAnyOf", "value": ["Germany", "France"] },      { "column": "salary", "operator": ">", "value": 100000 }    ],    "aggregation": {},    "sorting": [],    "grouping": [],    "pivoting": {},    "chart": null,    "conversationId": "00000000-0000-4000-8000-000000000001"  },  "meta": {    "tier": "fast",    "usedQueries": 12,    "remainingQueries": 7988,    "resetAt": "2027-01-01T00:00:00.000Z"  }}

Authenticate as in Authentication. The examples use a secret key, so they run on your server. If that key has allowed origins, add one of them as an Origin header, or the call is refused with 403.

What is sent to the model#

Gridsay uses grid.table and referenceId for usage records. The model receives:

  • the question, and your notes;
  • context: every property of every column, examples included, and any other property you add;
  • grid.disabled: the features your table has switched off;
  • grid.columns: restrictions, and each select column's options, values and labels;
  • grid.state: the current filters with their values, the sorting, grouping, totals and pivot;
  • the earlier questions and answers of the conversation, unless the question is in private mode.

No rows are sent otherwise. The table packages decide what goes in: the TanStack Table plugin and the MUI X helper send the columns, option lists and current view (the MUI X helper only when you give it apiRef), with example values only when you turn them on; MUI's own resolver sends the question and the column definitions.

Request body#

A JSON object. Fields the endpoint does not know are dropped, so a field such as tier or rows changes nothing.

FieldTypeMeaning and limits
queryTypestring, requiredMeaning and limits1 to 8,000 characters. The user's question.
contextTypestring, requiredMeaning and limitsAt most 1,000,000 characters. Your columns, below, as one JSON string: JSON.stringify(columns).
conversationIdTypestring or null, optionalMeaning and limitsAt most 255 characters. The last answer's id, to ask a follow-up. See Follow-up questions.
optionsTypeobject or null, optionalMeaning and limitsThe settings below.
additionalContextTypestring, optionalMeaning and limitsAt most 20,000 characters. The older place for notes; options.additionalContext wins when both are sent.
gridTypeobject, optionalMeaning and limitsWhat the table can do and shows now. See grid.

options#

FieldTypeMeaning and limits
privateModeTypeboolean, optionalMeaning and limitsLeft out means false. Keeps no question, answer or conversation. See Private mode.
additionalContextTypestring, optionalMeaning and limitsAt most 20,000 characters. Notes for the assistant: units, the words your users use.
metadataTypeobject, optionalMeaning and limitsHolds referenceId.
metadata.referenceIdTypestring, optionalMeaning and limitsAt most 127 characters. Your id for the user, for usage reports. On a publishable key, the signed-in user's id takes its place.

Columns inside context#

Describe each column once.

JavaScript
const columns = [  { field: 'name', type: 'string', description: null, examples: [], allowedOperators: ['contains'] },  { field: 'salary', type: 'number', description: 'Annual base salary in USD' },];const body = { query: 'highest salary first', context: JSON.stringify(columns) };
FieldTypeMeaning
fieldTypestring, requiredMeaningThe column's id. Answers name columns by it.
descriptionTypestring or null, optionalMeaningWhat the column means, with its unit.
examplesTypearray, optionalMeaningSample values you choose to share. They go to the model.
typeTypestring, optionalMeaningThe column type, such as string, number, date, dateTime, boolean or singleSelect.
allowedOperatorsTypearray of strings, optionalMeaningThe filter operators the column accepts. Left out, any; empty, none.
derivedFromTypestring, optionalMeaningMarks a pivot-only column made from another, such as the year of a date.

Other properties of a column are kept and go to the model with it. Use distinct, real column ids.

grid#

grid tells the assistant what your table allows and what it shows. The MUI X helper (with apiRef) and the TanStack Table plugin send it for you.

JSON
{  "query": "Only the paid ones",  "context": "[{\"field\":\"status\",\"type\":\"singleSelect\",\"allowedOperators\":[\"is\",\"not\",\"isAnyOf\"]}]",  "conversationId": null,  "options": {    "privateMode": false,    "additionalContext": "Invoices are in EUR.",    "metadata": { "referenceId": "example-user-123" }  },  "grid": {    "table": "tanstack-table",    "disabled": ["aggregation", "pivoting", "charts"],    "columns": {      "status": {        "sortable": false,        "options": [{ "value": "paid", "label": "Paid" }, { "value": "pending", "label": "Pending" }]      }    },    "state": { "filters": [], "sorting": [] }  }}
FieldTypeMeaning and limits
tableTypestring, optionalMeaning and limitsmui-x or tanstack-table. Labels your usage only; left out means mui-x.
disabledTypearray of strings, optionalMeaning and limitsFeatures switched off: filtering, sorting, grouping, aggregation, pivoting, selection, charts. See What the answer is checked against.
columnsTypeobject, optionalMeaning and limitsRestrictions per column, keyed by column id (at most 255 characters). List only columns with a restriction or options.
stateTypeobject, optionalMeaning and limitsThe current view, below. When sent, it wins over the conversation, and a part left out counts as empty.

grid.columns, per column#

FieldTypeMeaning and limits
filterableTypeboolean, optionalMeaning and limitsfalse: the column cannot be filtered.
sortableTypeboolean, optionalMeaning and limitsfalse: the column cannot be sorted.
groupableTypeboolean, optionalMeaning and limitsfalse: the column cannot be grouped.
pivotableTypeboolean, optionalMeaning and limitsfalse: the column cannot be used in a pivot.
aggregableTypeboolean, optionalMeaning and limitsfalse: the column gets no total.
aggregationFunctionsTypearray of strings, optionalMeaning and limitsThe only functions the column accepts. At most 32, each at most 64 characters.
optionsTypearray, optionalMeaning and limitsA select column's choices, at most 500. Helps match what users type to the stored value; a value outside the list is not always refused.
options[].valueTypestring or number, requiredMeaning and limitsThe stored value. Text at most 255 characters.
options[].labelTypestring, requiredMeaning and limitsWhat the user sees. At most 255 characters.

grid.state#

The current view, in the answer's shape, without select and chart. It is checked for shape, not against your columns: send what the table really shows.

FieldTypeMeaning
filtersTypearray, optionalMeaningCurrent filters.
filters[].columnTypestring, requiredMeaningA column id.
filters[].operatorTypestring, requiredMeaningThe filter operator.
filters[].valueTypestring, number, boolean or array, requiredMeaningThe value. A list is all text or all numbers.
filterOperatorTypestring, optionalMeaningand or or. Left out, the filters combine with and.
sortingTypearray, optionalMeaningCurrent sort keys, most important first.
sorting[].columnTypestring, requiredMeaningA column id.
sorting[].directionTypestring, requiredMeaningasc or desc.
groupingTypearray, optionalMeaningCurrent group columns, outermost first.
grouping[].columnTypestring, requiredMeaningA column id.
aggregationTypeobject, optionalMeaningCurrent totals: column id to avg, sum, min, max or size.
pivotingTypeobject, optionalMeaningThe current pivot, or {}.
pivoting.rowsTypearray of strings, requiredMeaningColumns down the side.
pivoting.columnsTypearray, requiredMeaningColumns across the top.
pivoting.columns[].columnTypestring, requiredMeaningA column id.
pivoting.columns[].directionTypestring, requiredMeaningasc or desc.
pivoting.valuesTypearray, requiredMeaningThe measures: column id to avg, sum, min, max or size.

The three pivoting fields are required in a pivot; {} means no pivot.

Response body#

HTTP 201. The answer is the whole state, never a patch: every part is there except filterOperator. The table below says how each part is applied.

FieldTypeMeaning
okTypeboolean, requiredMeaningAlways true on an answer.
dataTypeobject, requiredMeaningThe state to apply, and the conversation id.
data.selectTypeinteger, requiredMeaning-1 means no rows are requested. The TanStack Table plugin leaves the existing selection alone. With a positive N, the plugin selects the first N loaded data rows in sorted order, including rows on later pages or in collapsed groups. The MUI X Data Grid helper with apiRef selects the first N sorted leaf rows that pass the filters. Selection does not hide rows.
data.filtersTypearray, requiredMeaningThe filters. Empty clears filtering.
filters[].columnTypestring, requiredMeaningA column id from context.
filters[].operatorTypestring, requiredMeaningOne of the column's allowedOperators, when you sent them.
filters[].valueTypestring, number, boolean or array, requiredMeaningThe value to compare with. A list is all text or all numbers.
data.filterOperatorTypestring, optionalMeaningOnly or, and only to combine two or more filters with or; absent means and. Values are and or or.
data.sortingTypearray, requiredMeaningSort keys, most important first. Empty clears sorting.
sorting[].columnTypestring, requiredMeaningA sortable column.
sorting[].directionTypestring, requiredMeaningasc or desc.
data.groupingTypearray, requiredMeaningGroup columns, outermost first. Empty clears grouping.
grouping[].columnTypestring, requiredMeaningA groupable column.
data.aggregationTypeobject, requiredMeaningTotals: column id to avg, sum, min, max or size (a row count). Empty clears totals.
data.pivotingTypeobject, requiredMeaning{} for no pivot, or a pivot with the three fields below. Never null.
pivoting.rowsTypearray of strings, requiredMeaningColumns down the side.
pivoting.columnsTypearray, requiredMeaningColumns across the top.
pivoting.columns[].columnTypestring, requiredMeaningA column id.
pivoting.columns[].directionTypestring, requiredMeaningasc or desc.
pivoting.valuesTypearray, requiredMeaningThe measures, one per entry: column id to avg, sum, min, max or size.
data.chartTypeobject or null, requiredMeaningnull, or what the table's chart shows. It does not choose a chart type.
chart.dimensionsTypearray of strings, requiredMeaningCategory or time columns.
chart.valuesTypearray of strings, requiredMeaningMeasured columns.
data.conversationIdTypestring, requiredMeaningSend it with the next question to ask a follow-up.
metaTypeobject, requiredMeaningThe tier and the period's usage.
meta.tierTypestring, requiredMeaningThe tier that answered and was charged: fast, standard or max, never auto.
meta.usedQueriesTypeinteger, requiredMeaningCharged questions in your organization this period, all keys together.
meta.remainingQueriesTypeinteger or null, requiredMeaningQuestions the remaining credits cover at this answer's tier. null during a trial or with no ceiling.
meta.resetAtTypestring, requiredMeaningWhen the period ends, as an ISO time in UTC.

TanStack Table applies filters, sorting, grouping and selection. Its plugin switches off totals, pivots and charts in grid.disabled.

What the answer is checked against#

Before it is returned, the answer is checked against your columns and grid:

  • An unknown column in a filter, sort, group, total or pivot, an operator outside a column's allowedOperators, or a switched-off feature such as charts or sorting: the model gets one chance to correct it. If the answer is still wrong, your user gets a refusal (422, charged) with the reason, such as "Sorting is switched off for this table."
  • With selection switched off, select comes back as -1 without an error. The TanStack Table plugin keeps the existing selection.
  • With charts on, an unknown chart column is dropped and valid chart columns stay.
  • A filter value outside a select column's options is not always refused.

Refusal#

When the assistant cannot do what was asked with your table, it answers HTTP 422 with a sentence for your user. Nothing changes in the table.

Ask

people who earn more than their manager

ChangesNo change
Refused

I can't compare a person's salary with their manager's, because the grid has no manager column and cannot compare two columns.

Your user reads this sentence. The table stays as it was.
JSON
{  "ok": false,  "statusCode": 422,  "code": "query_not_understood",  "message": "I can't compare a person's salary with their manager's, because the grid has no manager column and cannot compare two columns.",  "detail": "The question could not be applied to this table. Check the columns and enabled features sent by your resolver. Request 00000000-0000-4000-8000-000000000002; find it at /app/usage."}

Show message. A refusal is charged, like an answer; it has no data or meta, so keep the conversation id you had. See What is charged.

Status codes#

StatusCodeChargedSend again unchanged?
201CodeChargedYesSend again unchanged?It is a new question, charged again.
400Codeinvalid_requestChargedNoSend again unchanged?No: fix the field detail names.
401Codeinvalid_api_key, unauthenticated_userChargedNoSend again unchanged?No: fix the key or the user's token.
402Codequota_exceeded, billing_limit_exceededChargedNoSend again unchanged?Not until the plan or credits change.
403Codeorigin_not_allowed, forbiddenChargedNoSend again unchanged?No: fix the origin or the key's sign-in.
404Codenot_foundChargedNoSend again unchanged?No: fix the path.
413Codecontext_too_largeChargedNoSend again unchanged?No: send less.
422Codequery_not_understoodChargedYesSend again unchanged?It is charged again; let the user ask differently.
429Coderate_limitedChargedNoSend again unchanged?Yes, after retryAfter seconds.
502Codeupstream_unavailableChargedNoSend again unchanged?Yes, once, after a short wait.
503Codeupstream_unavailableChargedNoSend again unchanged?Yes, later.
500Codeinternal_errorChargedMaybeSend again unchanged?Check Usage first: a 500 can come after the question was charged.

What each code means: Errors.

Size limits#

WhatLimitOver it
The whole bodyLimit2 MB (2,097,152 bytes)Over it413 context_too_large
contextLimit1,000,000 charactersOver it413 context_too_large
What the first model call for the question is sent: our instructions, your columns, notes, current view, the question and the history that fitsLimit73,728 bytesOver it413 context_too_large, with the size in detail
queryLimit8,000 charactersOver it400 invalid_request

All limits: Limits.

Next#

  • Follow-up questions
  • Errors
  • Limits