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. 1. Create a secret key
  3. 2. Add the route
  4. 3. Add the plugin to your table
  5. 4. Ask the first question
  6. Where the reference went
  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

Quickstart

On this page

  1. What you need
  2. 1. Create a secret key
  3. 2. Add the route
  4. 3. Add the plugin to your table
  5. 4. Ask the first question
  6. Where the reference went
  7. Next
Public alpha

Your users type a question, and your table filters, sorts, groups or selects its top rows. You add one route to your server and one hook to your table. Gridsay's plugin is compatible with TanStack Table, tested with version 9.3.1. TanStack Table is MIT-licensed open source by its own maintainers; the plugin is MIT licensed too.

The plugin's API may change before 1.0. Before 1.0, a breaking change raises the minor version.

Ask

Orders over 500 from Germany, newest first

Changes3 changes
  1. 1filter Total is greater than 500
  2. 2filter Country is Germany
  3. 3sort Placed, newest first
Ask

only the ones over 1000

Changes3 changes
  1. 1filter Total is greater than 1000
  2. 2filter Country is Germany
  3. 3sort Placed, newest first

The second question follows the first: it keeps the country and the order, and replaces the amount.

What you need#

  • A React app with @tanstack/react-table v9, 9.3.1 or later. Version 8 is not supported, and neither are tables built on it, such as Material React Table and Mantine React Table.
  • React 18 or later for the hook.
  • A server that can forward a POST. The example is a Next.js route handler.
  • A Gridsay account. No table licence is needed: TanStack Table is free.

1. Create a secret key#

  1. Sign in to Gridsay. In the dashboard, open API keys and choose Create key.
  2. Choose the type Secret and a tier. fast is the default and suits most tables.
  3. Copy the key: it is shown only once. The same screen shows your Gridsay URL. Keys explains secret and publishable keys.

Put both in your server's environment:

.env.local
# Save at your app root, beside package.json. Restart your dev server after saving.GRIDSAY_URL=<your Gridsay URL, from the dashboard>GRIDSAY_SECRET_KEY=<your secret key>

Keep the secret key on your server. Anyone who has it can spend your credits. To call Gridsay from the browser instead, read Browser keys.

2. Add the route#

The route adds your secret key, forwards the table's request to Gridsay, and returns the response and its status unchanged. It never follows a redirect.

app/api/tanstack-table/route.ts
// If your app uses src/, create src/app/api/tanstack-table/route.ts instead. export async function POST(request: Request) {  // Each question spends your credits, so only your signed-in users may ask.  if (!(await isSignedIn(request))) {    return Response.json({ ok: false, code: 'unauthenticated_user', message: 'Sign in to use the assistant.' }, { status: 401 });  }   const key = process.env.GRIDSAY_SECRET_KEY;  const gateway = process.env.GRIDSAY_URL;  if (!key || !gateway) {    console.error('[Gridsay] Set GRIDSAY_SECRET_KEY and GRIDSAY_URL in .env.local at your app root. Restart your dev server.');    return Response.json({ ok: false, message: 'The assistant is not configured. Please contact the app owner.' }, { status: 500 });  }   const body = await request.text();  let response: Response;  try {    response = await fetch(`${gateway}/api/v1/datagrid/prompt`, {      method: 'POST',      headers: {        'content-type': 'application/json',        'x-api-key': key,        origin: request.headers.get('origin') ?? '',      },      body,      // Never follow a redirect: it would send your key to another address.      redirect: 'error',    });  } catch {    console.error('[Gridsay] Could not reach the gateway. Check GRIDSAY_URL and your server’s network connection.');    return Response.json({ ok: false, message: 'The assistant cannot connect right now. Try again later.' }, { status: 503 });  }  if (!response.ok) console.error('[Gridsay] Request failed:', response.status, await response.clone().text());  const headers = new Headers({ 'content-type': 'application/json' });  const retryAfter = response.headers.get('Retry-After');  if (retryAfter !== null) headers.set('Retry-After', retryAfter);  return new Response(response.body, { status: response.status, headers });} async function isSignedIn(request: Request) {  // Your sign-in check goes here, e.g. return Boolean(await getSignedInUser(request));  if (process.env.NODE_ENV === 'development') return true;  console.error('[Gridsay] Refused: add your sign-in check to isSignedIn before you deploy.');  return false;}

Before you deploy, put your own sign-in check in isSignedIn. As written, the route answers only on your dev server. A caller it turns away gets status 401, code unauthenticated_user and "Sign in to use the assistant."

3. Add the plugin to your table#

Install the plugin, with TanStack Table v9:

Shell
npm install @gridsay/tanstack-table @tanstack/react-table@^9.3.1

Then add three things to your table: the features the assistant may change, assistantColumn as the default column, and the useTableAssistant hook. The question box is yours; this one is a form with a text box.

app/orders.tsx
'use client'; import {  assistantColumn,  assistantGroupedRowModel,  useTableAssistant,} from '@gridsay/tanstack-table/react';import {  columnFilteringFeature,  columnGroupingFeature,  createColumnHelper,  createExpandedRowModel,  createFilteredRowModel,  createSortedRowModel,  rowExpandingFeature,  rowSelectionFeature,  rowSortingFeature,  tableFeatures,  useTable,} from '@tanstack/react-table';import { useState } from 'react'; // The assistant changes only what you register here.const features = tableFeatures({  columnFilteringFeature,  filteredRowModel: createFilteredRowModel(),  rowSortingFeature,  sortedRowModel: createSortedRowModel(),  columnGroupingFeature,  groupedRowModel: assistantGroupedRowModel(), // in place of createGroupedRowModel()  rowExpandingFeature,  expandedRowModel: createExpandedRowModel(),  rowSelectionFeature,}); type Order = { customer: string; country: string; status: string; total: number; placedAt: Date }; const columnHelper = createColumnHelper<typeof features, Order>();const columns = columnHelper.columns([  columnHelper.accessor('customer', { header: 'Customer' }),  columnHelper.accessor('country', { header: 'Country' }),  columnHelper.accessor('status', {    header: 'Status',    meta: { assistant: { type: 'singleSelect', options: ['open', 'paid', 'refunded'] } },  }),  columnHelper.accessor('total', {    header: 'Total',    meta: { assistant: { description: 'Order total in euros' } },  }),  columnHelper.accessor('placedAt', { header: 'Placed' }),]); export function Orders({ data }: { data: Order[] }) {  const table = useTable({    features,    columns,    data,    defaultColumn: assistantColumn, // the line that lets the assistant filter and sort    initialState: { expanded: true }, // groups the assistant makes show their rows...    autoResetExpanded: false, // ...and stay open after the next answer  });  const { ask, undo, canUndo, pending, error } = useTableAssistant(table, { url: '/api/tanstack-table' });  const [question, setQuestion] = useState('');   return (    <>      <form        onSubmit={async (event) => {          event.preventDefault();          if (await ask(question)) setQuestion('');        }}      >        <input          aria-label="Ask about the orders"          value={question}          onChange={(event) => setQuestion(event.target.value)}          readOnly={pending}          placeholder="Orders over 500 from Germany, newest first"        />        <button type="submit" disabled={pending || !question.trim()}>          Ask        </button>        <button type="button" disabled={pending || !canUndo} onClick={() => undo()}>          Undo        </button>      </form>      {error ? <p role="alert">{error.message}</p> : null}      <table>        <thead>          {table.getHeaderGroups().map((headerGroup) => (            <tr key={headerGroup.id}>              {headerGroup.headers.map((header) => (                <th key={header.id}>                  <table.FlexRender header={header} />                </th>              ))}            </tr>          ))}        </thead>        <tbody>          {table.getRowModel().rows.map((row) =>            row.getIsGrouped() ? (              <tr key={row.id}>                <th colSpan={columns.length}>                  {String(row.groupingValue)} ({row.getLeafRows().length})                </th>              </tr>            ) : (              <tr key={row.id} className={row.getIsSelected() ? 'selected' : undefined}>                {row.getAllCells().map((cell) => (                  <td key={cell.id}>                    <table.FlexRender cell={cell} />                  </td>                ))}              </tr>            ),          )}        </tbody>      </table>    </>  );}

Render <Orders data={orders} /> from your page with your own orders. Keep total a number and placedAt a date, and format them when you render cells.

  • The features decide what can change. A feature you do not register is reported to Gridsay as switched off, and a question that needs it is declined.
  • assistantColumn puts the plugin's filter and sort functions on each column. See Describing columns for types, descriptions and option lists.
  • assistantGroupedRowModel() lets the assistant group. With TanStack's own grouped row model, it does not group. See Grouping.

4. Ask the first question#

Type Orders over 500 from Germany, newest first. The table filters and sorts, and ask resolves true. Then ask a follow-up, such as only the ones over 1000: the conversation and the table's current view go with the next question.

  • ask resolves true once the answer is on the table. When the assistant cannot answer, it resolves false, the table stays as it was, and error.message is a sentence to show your user.
  • Undo puts back what the last answer changed. It undoes one answer.

Now ask make a chart of orders by country. TanStack Table has no chart, so the assistant declines: ask resolves false and error has status 422 and code query_not_understood. A declined question is charged, like an answer. Read Refusals and errors before you add retries.

Both questions appear under Requests on the dashboard's Usage page.

Where the reference went#

The reference and the guides that were on this page now have pages of their own.

Options: Options for both APIs.

Reading GridsayError: GridsayError's fields.

reset(): Undo and reset.

Follow-ups and undo: Undo and reset.

Describe your columns: Describing columns.

Controlled state: Controlled state.

Sorting and grouping on your server: Server-side data.

The size ceiling: Limits.

Limits: Limits.

Troubleshooting: Refusals and errors.

What is charged: What is charged.

Next#

  • Describing columns: what each column tells the assistant, and what leaves your app.
  • Filtering: what users can ask, by column type.
  • API reference: every export, option and field.