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. What you need
  2. Connect the grid
  3. The user's token
  4. What the gateway checks
  5. What leaves the browser
  6. Try it
  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

From the browser

On this page

  1. What you need
  2. Connect the grid
  3. The user's token
  4. What the gateway checks
  5. What leaves the browser
  6. Try it
  7. Next

With a publishable key, the grid's page calls Gridsay directly. Each question carries your user's sign-in, so Gridsay verifies every user and counts each against the limits you set. There is no route on your server to forward questions.

Every plan includes publishable keys, the trial too.

What you need#

  • A publishable key from API keys, with every origin your grid runs on, including your development origin such as http://localhost:3000. A publishable key has no exception for localhost.
  • A way for Gridsay to verify your users, chosen for the key under Auth and limits: JWT or OIDC, session tokens or an identity webhook.
  • Your Gridsay URL, shown beside the key. The prompt path is /api/v1/datagrid/prompt.

The key refuses every question until it has origins and a sign-in method. A publishable key can sit in your page; a secret key never can.

Connect the grid#

MUI's stock resolver cannot call Gridsay from the browser: it has no way to send a key. Use one of these as the grid's onPrompt instead.

The dashboard shows this when you choose a publishable key.

Shell
npm install @gridsay/mui-x-data-grid
TSX
import { createPromptResolver } from '@gridsay/mui-x-data-grid';import {  DataGridPremium,  type DataGridPremiumProps,  GridAiAssistantPanel,  useGridApiRef,} from '@mui/x-data-grid-premium';import { useMemo } from 'react'; export function OrdersGrid({ rows, columns }: Pick<DataGridPremiumProps, 'rows' | 'columns'>) {  const apiRef = useGridApiRef();  const onPrompt = useMemo(    () =>      createPromptResolver({        url: `${process.env.NEXT_PUBLIC_GRIDSAY_URL}/api/v1/datagrid/prompt`,        publishableKey: process.env.NEXT_PUBLIC_GRIDSAY_PUBLISHABLE_KEY!,        getToken: getUserToken, // your sign-in's token, or a session token from your route        apiRef,      }),    [apiRef],  );   return (    <DataGridPremium      apiRef={apiRef}      rows={rows}      columns={columns}      aiAssistant      onPrompt={onPrompt}      slots={{ aiAssistantPanel: GridAiAssistantPanel }}      showToolbar    />  );}

url is your Gridsay URL followed by the prompt path; publishableKey is your key. With apiRef, the helper also tells Gridsay which features your grid has switched off and checks every answer before the grid applies it: see Using the helper.

For a page that would rather not add a package. The dashboard offers it under "Rather not add a package?". It sends the key and the sign-in as the helper does, without the helper's checks.

TSX
'use client'; import { DataGridPremium, GridAiAssistantPanel } from '@mui/x-data-grid-premium'; // Sends each question straight to Gridsay with your key and your user's sign-in.// The grid shows each thrown message in its assistant panel.async function onPrompt(query: string, context: string, conversationId?: string) {  let token;  try {    token = await getToken();  } catch {    token = null;  }  // No signed-in user: ask nothing.  if (!token) throw new Error('Sign in to use the assistant.');  const response = await fetch('https://api.gridsay.com/api/v1/datagrid/prompt', {    method: 'POST',    headers: {      'content-type': 'application/json',      'x-api-key': 'pk_gs_example_not_a_real_key',      authorization: `Bearer ${token}`,    },    body: JSON.stringify({ query, context, conversationId }),  }).catch(() => null);  // No answer, or not JSON (an error page from a proxy): one plain sentence.  const result = await response?.json().catch(() => null);  if (!result?.ok) throw new Error(result?.message ?? 'The assistant couldn’t respond. Try again.');  return result.data;} // Keep your rows and columns; put this in your client component's return value.<DataGridPremium  rows={rows}  columns={columns}  aiAssistant  onPrompt={onPrompt}  slots={{ aiAssistantPanel: GridAiAssistantPanel }}  showToolbar/>

Replace getToken() with your sign-in's token. With no token it sends nothing and the panel shows "Sign in to use the assistant." Every failure becomes a sentence the panel shows.

The user's token#

Gridsay needs a credential from your app's sign-in with every question, not your Gridsay console sign-in.

  • JWT or OIDC. getToken returns the token your sign-in provider issued. The helper sends it as Authorization: Bearer …. Refresh it through your provider when it expires.
  • Session tokens. Your server asks Gridsay for a short-lived token for the signed-in user, with a secret key, and the page sends that token. Keep it until its expiresAt rather than minting one per question.
  • Identity webhook. Gridsay forwards a credential header to your endpoint, which answers with the user's id. If the header is not authorization, leave out getToken and send the header with headers:
TypeScript
createPromptResolver({  url: 'https://api.gridsay.com/api/v1/datagrid/prompt',  publishableKey: 'pk_gs_example_not_a_real_key',  apiRef,  headers: async () => ({ 'x-user-token': await getCredential() }),});

With getToken, a missing token stops the question in the browser. A headers function has no such check: an empty header reaches the gateway and is refused there. If headers throws, the helper reports unexpected_error and keeps what was thrown in the error's cause.

How to set up each method: JWT or OIDC, session tokens, identity webhook.

What the gateway checks#

Each question passes these checks before any model reads it. A question refused here is free. If Gridsay recognises the key, the refusal can appear on the Usage page under Refusals. That list shows the last seven days.

CheckWhen it failsStatus and codeYour user sees
The keyWhen it failsMissing, mistyped, disabled or revokedStatus and code401 invalid_api_keyYour user seesThe assistant is not available right now.
The originWhen it failsThe page's origin is not on the key's list, or the list is emptyStatus and code403 origin_not_allowedYour user seesThe assistant is not available on this site.
A sign-in methodWhen it failsThe key has noneStatus and code403 forbiddenYour user seesThe assistant is not available right now.
The credentialWhen it failsMissing, expired, or not verified by the method you choseStatus and code401 unauthenticated_userYour user seesSign in to use the assistant.
Failed sign-insWhen it failsToo many failed checks from one addressStatus and code429 rate_limitedYour user seesToo many attempts. Try again in N seconds.
Your limitsWhen it failsThe user or the key reached a limit you setStatus and code429 rate_limitedYour user seesYour rule's message, or a default with when to try again
Your planWhen it failsNo plan, the trial's allowance, or your spending capStatus and code402 quota_exceeded or billing_limit_exceededYour user seesThe assistant is not available right now, or has reached its limit

Limits are set per key and per user under Auth and limits. A rule can show its own message at the limit, for example a link to your upgrade page.

What leaves the browser#

  • With the short function: the question and your column definitions, as MUI's stock resolver sends them.
  • With the helper and apiRef: also the features your grid has switched off, each column's limits, option lists and the current filters, sorting, grouping, totals and pivot.

No whole rows are sent. Example values from your rows go only if you turn on allowAiAssistantDataSampling or write them into your columns.

Try it#

  1. Signed in to your app on a listed origin, ask a question, then a follow-up.
  2. Signed out, check that the panel says "Sign in to use the assistant." and nothing is sent.
  3. From an origin not on the list, check for "The assistant is not available on this site."
  4. Past a limit, check that your rule's message shows.

Each answered question appears under Requests on the Usage page, with the user it was counted against.

Next#

  • Using the helper
  • Refusals and errors
  • Quickstart: server route