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. Exports
  2. createPromptResolver
  3. What it sends
  4. What it does with an answer
  5. Errors
  6. Limits
  7. 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

Reference

On this page

  1. Exports
  2. createPromptResolver
  3. What it sends
  4. What it does with an answer
  5. Errors
  6. Limits
  7. Next

@gridsay/mui-x-data-grid is the Gridsay helper for MUI X Data Grid Premium. It is ESM only, MIT licensed, and depends on @gridsay/core. Its peer dependency is @mui/x-data-grid-premium ^9.18.0.

Shell
npm install @gridsay/mui-x-data-grid

How to use it: Using the helper.

Exports#

ExportKindWhat it is
createPromptResolverKindFunctionWhat it isTakes PromptResolverOptions; returns a PromptResolver to pass as the grid's onPrompt
PromptResolverOptionsKindTypeWhat it isThe options below
PromptResolverKindTypeWhat it isNonNullable<DataGridPremiumProps['onPrompt']>: takes the question, MUI's column context and the conversation id; resolves with the answer for the grid
GridsayErrorKindClassWhat it isWhat the resolver rejects with. See Errors
UNAUTHENTICATED_USER_CODE and UNAUTHENTICATED_USERKindConstantsWhat it is'unauthenticated_user', "Sign in to use the assistant."
CONNECTION_FAILED_CODE and CONNECTION_FAILEDKindConstantsWhat it is'connection_failed', "The connection was interrupted. Try again."
NOT_JSON_CODE and NOT_JSONKindConstantsWhat it is'not_json', "The assistant couldn't respond. Try again."
INVALID_ANSWER_CODE and INVALID_ANSWERKindConstantsWhat it is'invalid_answer', "The assistant couldn't complete your request. Try again."
UNEXPECTED_ERROR_CODEKindConstantWhat it is'unexpected_error'; its sentence is INVALID_ANSWER

There is no other entry point. The types of the request and the answer are exported by @gridsay/core.

createPromptResolver#

TypeScript
type PromptResolverOptions = {  url: string;  apiRef?: { readonly current: GridApi | null };  headers?: RequestHeaders | (() => RequestHeaders | Promise<RequestHeaders>);  publishableKey?: string;  getToken?: () => string | null | undefined | Promise<string | null | undefined>;  additionalContext?: string;  privateMode?: boolean;  referenceId?: string;}; type PromptResolver = NonNullable<DataGridPremiumProps['onPrompt']>;declare function createPromptResolver(options: PromptResolverOptions): PromptResolver;
OptionTypeDefaultMeaning
urlTypestringDefaultRequiredMeaningWhere each question is posted: your own route, or the gateway's full prompt URL, https://api.gridsay.com/api/v1/datagrid/prompt. Nothing is appended
apiRefType{ readonly current: GridApi | null }DefaultNoneMeaningThe grid's apiRef, from useGridApiRef(). With it, each question carries the grid's switches, column limits and current view, and answers are adapted to the grid
headersTypeRequestHeaders or a function returning them, sync or asyncDefaultNoneMeaningAdded to every request. A function is called for each question
publishableKeyTypestringDefaultNoneMeaningSent as x-api-key. Only for calling the gateway from the browser
getTokenType() => string | null | undefined, or a promise of oneDefaultNoneMeaningCalled for each question; the token is sent as Authorization: Bearer …. Nothing returned, or a throw, stops the question with unauthenticated_user
additionalContextTypestringDefaultNoneMeaningNotes about your data, sent as options.additionalContext. Up to 20,000 characters
privateModeTypebooleanDefaultNone; the gateway treats it as falseMeaningSent as options.privateMode. See private mode
referenceIdTypestringDefaultNoneMeaningYour id for the user, sent as options.metadata.referenceId. Up to 127 characters. It labels usage; it does not sign anyone in

RequestHeaders is Record<string, string>, from @gridsay/core. GridApi is the part of MUI's API the helper reads; pass the grid's own apiRef.

additionalContext, privateMode and referenceId are read once, when the resolver is created: create a new resolver to change them. headers and getToken run for every question.

Each request carries content-type: application/json, then your headers, then x-api-key and authorization when you set publishableKey and getToken. A later one replaces an earlier one spelled the same way.

What it sends#

A POST with the JSON body MUI's stock resolver sends (query, context, conversationId, options) and, with apiRef, a grid field:

Field of gridWhat it holds
disabledWhat it holdsFeatures switched off: filtering, sorting, grouping, aggregation, pivoting, selection, and charts when no chart is open
columnsWhat it holdsBy field, only for columns with a limit: filterable, sortable, groupable, pivotable or aggregable set to false, aggregationFunctions, and a singleSelect's options with their values and labels (up to 500)
stateWhat it holdsThe filters, filter join, sorting, grouping, totals and pivot the grid shows now. Always sent, even when empty

What it does with an answer#

  • Checks it before the grid sees it. A malformed answer rejects with invalid_answer and the grid stays as it was.
  • Selects "top N" rows itself, from all filtered and sorted leaf rows; with a dataSource, from the loaded page once it arrives.
  • Moves a sort on a grouped column to the grouping column, so the groups reorder.
  • Leaves pivot mode before applying an answer without a pivot.
  • Keeps the aggregation a chart answer asked for.
  • Sends one question at a time per resolver.

Errors#

The resolver rejects with a GridsayError. The grid shows its message in the assistant panel.

PropertyTypeMeaning
messageTypestringMeaningA sentence for your user
codeTypestring, optionalMeaningThe gateway's code, or one of the helper's below
statusTypenumber, optionalMeaningThe HTTP status, when a response arrived
retryAfterTypenumber, optionalMeaningSeconds to wait, for a limit
detailTypestring, optionalMeaningThe gateway's explanation for you. Never show it to your user
causeTypeunknown, optionalMeaningWhat was thrown, when the failure started with a throw: your headers or getToken, fetch, or reading the response

The helper's own codes:

codeSentenceWhen
unauthenticated_userSentenceUNAUTHENTICATED_USER, or your route's own sentenceWhengetToken threw or returned nothing, and nothing was sent; or a 401 whose body names no other code
unexpected_errorSentenceINVALID_ANSWERWhenYour headers function threw; nothing was sent
connection_failedSentenceCONNECTION_FAILEDWhenNo response arrived, or reading it was cut off
not_jsonSentenceNOT_JSONWhenThe response was not JSON. status 404 usually means url is wrong
invalid_answerSentenceINVALID_ANSWERWhenThe response was not an answer the helper can read, or an error with no sentence of its own

Any other code comes from the gateway, with its own status, sentence, retryAfter and detail: every one is in Refusals and errors. Compare codes, never messages: the sentences may change. The helper does not retry.

Limits#

  • Grid-wide switches are read from the grid's internal props, tested with 9.18. If a later version moves them, the helper treats every feature as on.
  • There is no option for credentials, a custom fetch, a timeout, retries or cancelling a question.
  • The current view leaves out the quick filter, filter values that are not text, numbers, booleans or dates, custom aggregation functions, and option lists computed from a row.

Next#

  • Using the helper
  • Refusals and errors
  • From the browser