# tiresapi.com SQL Sandbox Query

> tiresapi.com SQL Sandbox Query is a paid API for AI agents from tiresapi.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Executes SELECT-only SQL queries against guarded dbo.v_* views of tire inventory and pricing data, returning up to 500 rows per call.

## Facts

- Endpoint: POST https://tiresapi.com/api/v1/query
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tiresapi-com-a6149a3f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AKZmXRZMXGGWmABw8NG4N

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 tiresapi-com-a6149a3f -d '<json body>'
```

Example prompt: Can you query the tire inventory database with a custom SQL statement — something like SELECT tire_size, brand, price FROM dbo.v_inventory_by_day WHERE state = 'TX' AND tire_size = '225/65R17' ORDER BY price ASC — and return the top 50 cheapest options?

## When to prefer this

Use this endpoint when no curated answer or corpus tool covers the specific question — i.e. when you need a custom SQL query with complex filters, joins across views, or aggregations not supported by the specialized endpoints. Prefer the curated endpoints (cheapest listing, stores near ZIP, inventory snapshot) for standard lookups since they are cheaper ($0.001 vs $0.020) and faster. Use this as the flexible fallback for ad-hoc or exploratory analysis.

## Known failure modes

- Query references a non-existent view (e.g. dbo.v_inventory_history) — returns error; use dbo.v_inventory_by_day instead
- Query exceeds 500-row cap — results are truncated
- Query exceeds 90-second timeout — returns timeout error
- Non-SELECT statement attempted — blocked by sandbox guardrails
- Invalid SQL syntax — returns parse error
- Payment failure — call not executed

## How this service works

SQL sandbox over guarded dbo.v_* views (SELECT-only, capped 500 rows, 90s timeout). Flat $0.020 per call. There is no dbo.v_inventory_history — history rows are dbo.v_inventory_by_day or GET /api/v1/corpus/inventory/history. Use only when no curated answer/corpus tool fits the question.

## Output

A result set of up to 500 rows from the queried dbo.v_* view(s), returned as structured data matching the columns selected. Execution is capped at 90 seconds. Empty result sets are auto-credited.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sql": {
   "type": "string",
   "maxLength": 4000,
   "minLength": 10,
   "description": "Single SELECT statement; must reference at least one v_* sandbox view."
  },
  "reason": {
   "type": "string",
   "maxLength": 1000,
   "minLength": 10,
   "description": "Why you're running this query (logged for audit)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "rows": [
   {
    "tier": "Economy",
    "brand": "ACCELERA"
   },
   {
    "tier": "Economy",
    "brand": "ACHILLES"
   },
   {
    "tier": "Economy",
    "brand": "ADVANCE"
   }
  ],
  "count": 3,
  "row_cap": 500,
  "duration_ms": 5,
  "executed_sql": "SELECT TOP 3 brand, tier FROM dbo.v_brand_tiers ORDER BY brand\nOPTION (MAXDOP 2, RECOMPILE)"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tiresapi-com-a6149a3f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tiresapi.com](https://www.zero.xyz/host/tiresapi.com/llms.txt)
