Explain selected rows with tagged cell references
Select one or more rows by primary-key values (or let the system sample) and receive a natural-language explanation. The explanation text contains `{{ref:N}}` markers that correspond to entries in the `references` array, allowing the UI to render clickable badges that link back to the source cells and rows. Particularly useful for pharma / scientific data where a row represents a compound, trial result, or patient record and users need a readable narrative with traceable evidence. **Required scopes:** `tables:read` + `ai:query`
Authorization
BearerAuth Security scheme for OpenAPI endpoints. Validates both JWT tokens and API keys.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request body for the Explain Rows AI action.
Select specific rows by primary key values, then the LLM generates a natural-language explanation with tagged cell references that the UI can render as clickable badges.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/tables/string/string/string/explain-rows" \ -H "Content-Type: application/json" \ -d '{ "provider": "claude", "model": "claude-sonnet-4-6", "row_pks": [ "COMP-001", "COMP-002" ], "pk_column": "compound_id", "max_tokens": 4096, "sample_size": null }'{ "model": "string", "explanation": "string", "references": [ { "id": 0, "column": "string", "row_index": 0, "value": "string", "display": "string" } ], "usage": { "input_tokens": 0, "output_tokens": 0 }}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}{ "code": "string", "message": "string", "request_id": "string", "details": [ { "field": "string", "message": "string" } ]}Execute LLM-powered analysis actions on your table data.
# Arguments * `action` - The analysis operation to perform * `model` - The LLM to use for processing # Actions | Action | Description | |--------|-------------| | `summary` | Generate a natural language summary of the table contents | | `detect_anomalies` | Identify inconsistencies, outliers, and data quality issues | | `find_duplicates` | Detect potential duplicate or near-duplicate records | | `fix_nulls` | Detect null values and suggest replacements | | `explain_rows` | Explain selected rows with tagged cell references (see dedicated endpoint) | # Supported Models **Claude (Anthropic)** | Model | Best For | |-------|----------| | `claude-opus-4-8` | Most capable; complex reasoning tasks | | `claude-sonnet-4-6` | Balanced performance and quality (default) | | `claude-opus-4-6` | Previous-generation complex reasoning | | `claude-haiku-4-5` | Fast, cost-effective analysis | | `claude-sonnet-4-5` | Previous generation balanced | | `claude-opus-4-5` | Previous generation complex reasoning | **GPT (OpenAI)** | Model | Best For | |-------|----------| | `gpt-5.2` | General-purpose analysis | | `gpt-5.2-chat-latest` | Latest optimizations | | `gpt-5.2-pro` | Advanced reasoning tasks | **Gemini** | Model | Best For | |-------|----------| | `gemini-3.1-pro-preview` | Latest model for complex tasks | | `gemini-3-pro-preview` | State-of-the-art reasoning | | `gemini-3-flash-preview` | Frontier balanced model for speed and scale | | `gemini-2.5-pro` | Powerful reasoning model for complex tasks | | `gemini-2.5-flash` | Balanced model with a 1 million context window | | `gemini-2.5-flash-lite` | Fastest and most cost-efficient model |
Scan for domain value mismatches
Checks all domain-constrained columns (or a subset) for values that don't match their allowed domain values. Returns mismatched values with similarity suggestions. **Required scope:** `tables:read`