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. Telling failures apart
  2. Exports
  3. GridsayError
  4. Codes of the packages' own failures
  5. Request options
  6. Types
  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

@gridsay/core

On this page

  1. Telling failures apart
  2. Exports
  3. GridsayError
  4. Codes of the packages' own failures
  5. Request options
  6. Types
  7. Next

@gridsay/core holds what the table packages share: the error they reject with, the codes and messages of their own failures, the options they take, and the types of what the API accepts and returns. Every table package depends on it and installs it with itself. It is MIT-licensed and has no dependencies.

To use its types or constants directly, add it to your project:

Shell
npm install @gridsay/core

Telling failures apart#

Every failure a table package handles is a GridsayError. Show message; branch on code; log detail.

TypeScript
import { CONNECTION_FAILED_CODE, GridsayError } from '@gridsay/core'; export function describeFailure(error: unknown): string {  if (!(error instanceof GridsayError)) throw error;  if (error.code === 'rate_limited' && error.retryAfter !== undefined)    return `${error.message} (wait ${error.retryAfter} s)`;  if (error.code === CONNECTION_FAILED_CODE) return error.message;  // detail is for you: log it, never show it.  console.warn(error.code, error.status, error.detail);  return error.message;}

Exports#

ExportKindWhat it is
GridsayErrorKindclassWhat it isThe error every table package rejects with. See GridsayError.
CONNECTION_FAILED, NOT_JSON, INVALID_ANSWER, UNAUTHENTICATED_USERKindstring constantsWhat it isThe sentences of the packages' own failures. See Codes.
CONNECTION_FAILED_CODE, NOT_JSON_CODE, INVALID_ANSWER_CODE, UNAUTHENTICATED_USER_CODE, UNEXPECTED_ERROR_CODE, CANNOT_APPLY_CODEKindstring constantsWhat it isThe codes of the packages' own failures.
RequestOptions, RequestHeadersKindtypesWhat it isThe options every table package takes. See Request options.
ColumnContext, PromptOptions, PromptRequest, PromptData, GridState, GridSnapshot, GridColumnLimits, GridFeature, ColumnFilter, FilterValue, ColumnSort, Aggregation, AggregationFunction, Pivoting, ChartKindtypesWhat it isThe wire format. See Types.

Do not import @gridsay/core/internal: it is for the table packages and can change in any release.

GridsayError#

TypeScript
declare class GridsayError extends Error {  readonly name: 'GridsayError';  readonly code?: string;  readonly status?: number;  readonly retryAfter?: number;  readonly detail?: string;   constructor(message: string, details?: {    code?: string;    status?: number;    retryAfter?: number;    detail?: string;    cause?: unknown;  });}
FieldTypeMeaning
nameType'GridsayError'MeaningIdentifies the class.
messageTypestringMeaningA sentence your user can read. A sentence from the API is kept as sent.
codeTypestring or undefinedMeaningAn API error code or one of the codes below. Undefined when your own server answered with a message and no code.
statusTypenumber or undefinedMeaningThe HTTP status, when a response arrived.
retryAfterTypenumber or undefinedMeaningSeconds to wait: the body's retryAfter, else the Retry-After header.
detailTypestring or undefinedMeaningThe API's sentence for you. Never show it to users.
causeTypeunknownMeaningThe original failure, when there was one.

A 401 that names no code becomes unauthenticated_user; a 401 naming invalid_api_key keeps it.

Codes of the packages' own failures#

These come from the browser, not from the API. Compare with the exported constants.

CodeConstantMessageWhen
connection_failedConstantCONNECTION_FAILED_CODEMessageCONNECTION_FAILED: "The connection was interrupted. Try again."WhenThe request failed, or reading the response was cut off. The question may still have been answered and charged.
not_jsonConstantNOT_JSON_CODEMessageNOT_JSON: "The assistant couldn't respond. Try again."WhenThe response is not JSON: often a wrong path, with status 404.
invalid_answerConstantINVALID_ANSWER_CODEMessageINVALID_ANSWER: "The assistant couldn't complete your request. Try again."WhenThe response is not a usable answer, or an error came with neither a sentence nor a code.
unauthenticated_userConstantUNAUTHENTICATED_USER_CODEMessageUNAUTHENTICATED_USER: "Sign in to use the assistant."WhengetToken gave no token or threw, so nothing was sent; or a 401 named no code. Also the API's own code for a missing user token.
unexpected_errorConstantUNEXPECTED_ERROR_CODEMessageINVALID_ANSWERWhenYour headers function threw, so nothing was sent. On TanStack Table, also your table's own setup threw. cause holds what was thrown.
cannot_applyConstantCANNOT_APPLY_CODEMessageThe table package's ownWhenA table package that applies answers itself could not apply one. The answer was already charged.

Request options#

Every table package takes these, beside its own options.

TypeScript
type RequestHeaders = Record<string, string>; type RequestOptions = {  headers?: RequestHeaders | (() => RequestHeaders | Promise<RequestHeaders>);  publishableKey?: string;  getToken?: () => string | null | undefined | Promise<string | null | undefined>;  additionalContext?: string;  privateMode?: boolean;  referenceId?: string;};
OptionSent asMeaning
headersSent asRequest headersMeaningExtra headers, or a function called for each question. If it throws, nothing is sent: unexpected_error.
publishableKeySent asx-api-keyMeaningA publishable key, for calls from the browser. Never a secret key.
getTokenSent asAuthorization: Bearer …MeaningCalled for each question. No token, or a throw, sends nothing: unauthenticated_user.
additionalContextSent asoptions.additionalContextMeaningNotes for the assistant.
privateModeSent asoptions.privateModeMeaningSee Private mode.
referenceIdSent asoptions.metadata.referenceIdMeaningYour id for the user, for usage reports. Not sign-in.

publishableKey and getToken replace x-api-key and authorization set in headers only when those are written in lower case; written any other way, such as Authorization, both values are sent and the credentials fail, so leave those two headers out of headers. No option chooses a tier: the key does.

Types#

Types only: importing one gives no validation. They describe the data of an answer, not the whole response; the response envelope and the API's error codes are in Data Grid endpoint and Errors.

TypeDescribes
PromptRequestDescribesA request to /api/v1/datagrid/prompt: query, context, optional conversationId, options and grid.
ColumnContextDescribesOne column inside context: field, and optional description, examples, type, allowedOperators, derivedFrom. Other properties are allowed.
PromptOptionsDescribesoptions: privateMode, additionalContext, metadata.referenceId.
GridSnapshotDescribesgrid: table, disabled, columns, state.
GridFeatureDescribesA name in grid.disabled: filtering, sorting, grouping, aggregation, pivoting, selection, charts.
GridColumnLimitsDescribesOne column's restrictions in grid.columns.
PromptDataDescribesAn answer's data: GridState and conversationId.
GridStateDescribesThe whole state: select, filters, filterOperator, aggregation, sorting, grouping, pivoting, chart.
ColumnFilter, FilterValueDescribesOne filter, and its value: text, number, boolean, or a list of text or of numbers.
ColumnSortDescribesA column and asc or desc.
Aggregation, AggregationFunctionDescribesColumn id to avg, sum, min, max or size.
PivotingDescribes{}, or rows, columns and values.
ChartDescribesdimensions and values.

Each field's rules and limits are on Data Grid endpoint.

Next#

  • Errors
  • Data Grid endpoint
  • MUI X Data Grid reference