# Strale SQL Explain

> Strale SQL Explain is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054/call, status unknown (last checked 2026-09-14).

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

## Facts

- Endpoint: GET https://api.strale.io/x402/v2/sql-explain
- Price: $0.054/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/strale-sql-explain-5c3668d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yvRhYSgnX28vhr_zyj-th

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 strale-sql-explain-5c3668d2
```

Example prompt: Can you explain what this SQL query does in plain English — I need to understand the tables it's joining, any filters it applies, and what it's aggregating: SELECT o.order_id, c.name, SUM(oi.price) FROM orders o JOIN customers c ON o.customer_id = c.id JOIN order_items oi ON o.order_id = oi.order_id WHERE o.status = 'shipped' GROUP BY o.order_id, c.name?

## When to prefer this

Choose this endpoint when you need a reliable, auditable plain-language explanation of a SQL query — especially useful for developer tools, code review automation, onboarding assistants, or database documentation pipelines. The cryptographic audit trail makes it suitable for compliance-sensitive environments. Prefer this over general-purpose LLM SQL explanation when you need structured, consistent output with verifiable provenance across 250+ tested capabilities on the Strale platform.

## Known failure modes

- Missing or empty 'sql' query parameter returns validation error
- Malformed or syntactically invalid SQL may return parsing error or limited explanation
- Extremely long or deeply nested queries may produce incomplete analysis
- Non-standard SQL dialects (e.g. proprietary database syntax) may not be fully interpreted
- Payment not fulfilled results in 402 response blocking access

## How this service works

The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.

## Output

Returns a structured plain-language breakdown of the SQL query including: identification of all referenced tables, explanation of join logic and conditions, description of WHERE filters and their meaning, explanation of aggregations and GROUP BY clauses, ORDER BY and LIMIT context, and flagged potential issues such as implicit joins, missing indexes, or logic errors. Each call is accompanied by a cryptographic audit record.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "sql"
     ],
     "properties": {
      "sql": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/strale-sql-explain-5c3668d2/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)
