# SQL Query Explainer

> SQL Query Explainer is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-10).

Explains a SQL query in plain English, identifying tables, joins, filters, aggregations, and potential performance issues

## Facts

- Endpoint: GET https://api.strale.io/x402/sql-explain?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-08cbff2a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MRDX2-kakR-yAxeLKJEqP

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-strale-io-08cbff2a
```

Example prompt: Can you explain what this SQL query does in plain English, including any joins, filters, aggregations, and whether there are any performance concerns? SELECT o.id, c.name, SUM(oi.quantity * oi.price) as total FROM orders o JOIN customers c ON o.customer_id = c.id JOIN order_items oi ON o.id = oi.order_id WHERE o.created_at > '2024-01-01' GROUP BY o.id, c.name HAVING total > 500

## When to prefer this

Use this endpoint when you need to explain or document a SQL query for non-technical stakeholders, review an unfamiliar query, or quickly audit a query for performance red flags — especially useful for data analysts, developers onboarding to a new codebase, or automated code review pipelines

## Known failure modes

- Missing or empty 'sql' query parameter returns an error
- Malformed or syntactically invalid SQL may produce incomplete or inaccurate analysis
- Very long or deeply nested queries may not be fully analyzed
- Payment failure (402) if USDC balance is insufficient

## How this service works

Explain a SQL query in plain language. Identifies tables, joins, filters, aggregations, and potential performance issues.

## Output

A plain-language breakdown of the SQL query, including identified tables, join relationships, filter conditions, aggregation logic, and flagged performance concerns such as missing indexes or expensive operations

## Example request

```json
{
 "sql": "SELECT u.id, u.name, COUNT(o.id) as order_count, SUM(o.amount) as total_spent FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.created_at > '2024-01-01' GROUP BY u.id, u.name HAVING COUNT(o.id) > 0 ORDER BY total_spent DESC LIMIT 10"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "sql"
 ],
 "properties": {
  "sql": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "tables": {
  "type": "array"
 },
 "operations": {
  "type": "array"
 },
 "plain_english": {
  "type": "string"
 },
 "potential_issues": {
  "type": "array"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-08cbff2a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
