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. Show the error
  2. Declined questions
  3. Every error code
  4. When an answer cannot be applied
  5. What is charged
  6. 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

Refusals and errors

On this page

  1. Show the error
  2. Declined questions
  3. Every error code
  4. When an answer cannot be applied
  5. What is charged
  6. Next

When a question cannot be answered, ask resolves false, the table stays as it was, and the hook's error is a GridsayError. Show error.message to your user; read code to decide what to do next.

Ask

Sort the tickets by priority, most urgent first

ChangesNo change
Refused

The Priority column can't be sorted in this grid.

Your user reads this sentence. The table stays as it was.
Ask

make a chart of orders by country

ChangesNo change
Refused

Charts are turned off for this grid, so I can't create one.

Your user reads this sentence. The table stays as it was.

Show the error#

TSX
import type { GridsayError } from '@gridsay/tanstack-table/react'; type Props = { error: GridsayError | null; signInUrl: string };export function AssistantError({ error, signInUrl }: Props) {  if (!error) return null;  const code = error.code;  if (code === 'reset') return null;  let next = 'Try again later. Contact the app owner if this continues.';  switch (code) {    case 'unauthenticated_user':      return <p role="alert">{error.message} <a href={signInUrl}>Sign in</a></p>;    case 'query_not_understood':      next = 'Try asking for a filter, a sort, a group or the first rows selected.';      break;    case 'rate_limited':      next = error.retryAfter === undefined        ? 'Wait before asking again.'        : `Wait ${error.retryAfter} seconds before asking again.`;      break;    case 'invalid_request':      next = 'Check the question and its length.';      break;    case 'context_too_large':      next = 'This table needs a smaller description. Contact the app owner.';      break;    case 'quota_exceeded':    case 'billing_limit_exceeded':    case 'invalid_api_key':    case 'origin_not_allowed':    case 'forbidden':    case 'cannot_apply':    case 'unexpected_error':    case 'invalid_answer':    case 'not_json':    case 'not_found':      next = 'The app owner needs to check this assistant.';      break;    case 'connection_failed':      next = 'Check your connection before submitting again.';      break;    case 'upstream_unavailable':    case 'internal_error':      break;  }  return <div role="alert"><p>{error.message}</p><p>{next}</p></div>;}

Put <AssistantError error={error} signInUrl="/sign-in" /> under your question box, with your app's sign-in address. Keep the question in the box when ask returns false, so the user can reword it. Compare codes, never messages: the messages may change.

Declined questions#

A declined question comes back as status 422, code query_not_understood. Its message is one short sentence from the assistant, in the user's language, saying what it cannot do. The sentence varies with the question, so do not match it in code.

When the model's answer uses something the table has switched off, Gridsay first asks the model to correct it, and a refusal then comes in the model's own words. Only if the corrected answer still uses it, or the correction call fails, does the user see a fixed sentence:

The answer needsThe user sees
TotalsThe user sees"Totals are switched off for this table."
A pivotThe user sees"Pivoting is switched off for this table."
A chartThe user sees"This table has no chart."
Filtering, on a table without itThe user sees"Filtering is switched off for this table."
Sorting, on a table without itThe user sees"Sorting is switched off for this table."
Grouping, on a table without itThe user sees"Grouping is switched off for this table."
Selection, on a table without itThe user sees"Selection is switched off for this table."
A column that cannot be used that wayThe user sees"The `status` column can't be sorted.", with the column's id, and "filtered" or "grouped"

The plugin reports totals, pivots and charts as switched off on every TanStack Table. If none of these applies and the answer still cannot be used, the user sees "I couldn't apply that request to this table. Try rephrasing it."

What your route receives from Gridsay for a declined question:

JSON
{  "ok": false,  "code": "query_not_understood",  "statusCode": 422,  "message": "Cannot delete rows.",  "detail": "The question could not be applied to this table. Check the columns and enabled features sent by your resolver. Request example-request-id; find it at /app/usage."}

detail is for you, never for your users. Its request id finds the question on the dashboard's Usage page. The whole envelope is in the HTTP API reference.

Every error code#

From Gridsay, through your route:

StatuscodeCauseCharged
400codeinvalid_requestCauseThe request could not be read: an empty or overlong question, or a bad option. detail names the field.ChargedNo
401codeinvalid_api_keyCauseThe key is missing, disabled, expired or not recognised.ChargedNo
401codeunauthenticated_userCauseYour route turned the caller away, or Gridsay did not accept the end user's token.ChargedNo
402codequota_exceededCauseNo plan in force, a trial that has ended or cannot cover the question, a blocked account or an overdue payment.ChargedNo
402codebilling_limit_exceededCauseThe month's credits and extra-usage cap cannot cover the question.ChargedNo
403codeorigin_not_allowedCauseThe page's origin is not on the publishable key's list.ChargedNo
403codeforbiddenCauseThe publishable key has no way to identify end users set up.ChargedNo
404codenot_foundCauseWrong address.ChargedNo
413codecontext_too_largeCauseThe question, columns, options and state are over a size limit.ChargedNo
422codequery_not_understoodCauseThe assistant declined the question.ChargedYes
429coderate_limitedCauseA limit on your key or your user was reached, too many questions are in progress, or too many recent questions failed. Wait retryAfter seconds.ChargedNo
502codeupstream_unavailableCauseThe model failed or its answer was unusable.ChargedNo
503codeupstream_unavailableCauseThe service could not take the question.ChargedNo
500codeinternal_errorCauseSomething failed on our side. Check Usage before sending again. If it repeats, contact us with the time.ChargedMaybe. The question may already have been charged.

From the plugin itself:

codeCauseCharged
unauthenticated_userCausegetToken returned nothing or threw. No request was sent, and there is no status.ChargedNo
unexpected_errorCauseYour headers function, or the table while it was read, threw. cause holds it. Nothing was sent.ChargedNo
connection_failedCauseThe request did not complete. Gridsay may or may not have answered.ChargedUnknown
not_jsonCauseYour route answered with something that is not JSON, often a missing route or a sign-in page. status says which.ChargedDepends on what your route did
invalid_answerCauseThe response was not an answer the plugin can read. Return Gridsay's body and status unchanged.ChargedDepends on what your route did
cannot_applyCauseGridsay answered, but the table could not take the answer. detail names what, such as sorting: no column "total".ChargedYes
resetCausereset() was called while the question waited. The hook does not set error for it.ChargedThe request may already be charged

A route can also fail with its own message and no code, as the quickstart's route does when its environment is not set. Then error.code is undefined: show the message.

When an answer cannot be applied#

cannot_apply means the table did not match what it told Gridsay: a column id changed, a feature is missing, or a controlled state handler did not take the answer within one second. Nothing stays applied, or the earlier state is put back. The question was answered, so it is charged: fix the table before asking again, and do not retry in a loop. See Controlled state.

What is charged#

  • An answer, and a declined question (422), are charged.
  • An answer the plugin cannot apply (cannot_apply) is charged, because Gridsay answered.
  • A question refused before the model is not charged: a wrong key, origin or token, a plan or limit, a size limit, or a busy service.
  • A model failure or unusable answer (502) is not charged.
  • reset() does not cancel or refund a request already sent.

What a question costs by tier: Tiers and credits. Every code across Gridsay's endpoints: Errors.

Next#

  • API reference
  • Undo and reset
  • Browser keys