# db.gedx402.com SQL Query

> db.gedx402.com SQL Query is a paid API for AI agents from db.gedx402.com, paid per call via x402, $0.007/call, status unknown (last checked 2026-09-15).

Execute read-only SQL SELECT queries against a hosted Cloudflare D1 database via x402 micropayment, no API key required

## Facts

- Endpoint: GET https://db.gedx402.com/v1/sql/query
- Price: $0.007/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/db-gedx402-com-sql-query-ac2381ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vCy5_8LKUhBHeQsxPFKsG

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 db-gedx402-com-sql-query-ac2381ff
```

Example prompt: Query the db.gedx402.com database for the latest 10 entries from the 'runs' table — something like SELECT id, body FROM runs ORDER BY id DESC LIMIT 10.

## When to prefer this

Choose this endpoint when you need to run ad-hoc read-only SQL queries against a hosted Cloudflare D1 database without needing to obtain or manage API keys, paying per-query with USDC on Base, Polygon, Arbitrum, World, or Solana.

## Known failure modes

- Invalid or non-SELECT SQL returns an error (only read-only queries are permitted)
- Payment failure if USDC balance is insufficient on the selected chain
- Malformed params array causes binding error
- Query timeout for long-running or complex queries
- Network error contacting the x402 endpoint

## How this service works

Read-only SQL on shared agent memory database. POST SELECT with optional params; results capped at 1000 rows. With valid session_token from POST /v1/memory/sessions, no x402 until query credits exhausted. x402 settlement USDC per request (see npm run pricing:report) worst-case per standalone query. Hero: GET /heroes/sql-query. Bundle: GET /v1/models?bundle=memory. Shard omitted from default OpenAPI discovery.

## Output

Returns a JSON object with a 'results' array containing the matched rows, a 'meta' object with rows_read count and duration_ms, and a 'service' field identifying the backend as cloudflare-d1.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sql": {
   "type": "string"
  },
  "params": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "session_token": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "meta": {
   "rows_read": 1,
   "duration_ms": 2
  },
  "results": [
   {
    "id": "run-1",
    "body": "hello"
   }
  ],
  "service": "gedx402-memory"
 }
}
```

## More

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