# GEDX402 SQLCoder-7B-2 LLM Endpoint

> GEDX402 SQLCoder-7B-2 LLM Endpoint is a paid API for AI agents from llm.gedx402.com, paid per call via x402, $0.016/call, status unknown (last checked 2026-09-16).

Runs the SQLCoder-7B-2 text-to-SQL model via Cloudflare Workers AI, accepting chat-style messages and returning SQL-focused completions, paid per-call with USDC on-chain.

## Facts

- Endpoint: GET https://llm.gedx402.com/v1/llm/sqlcoder-7b-2
- Price: $0.016/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gedx402-sqlcoder-7b-2-llm-endpoint-664704e6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_q7sq5ZPl-fmj7W6hbaieG

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 gedx402-sqlcoder-7b-2-llm-endpoint-664704e6
```

Example prompt: Using the SQLCoder-7B-2 model, write me a SQL query that finds the top 10 customers by total order value from a table called orders with columns customer_id, amount, and created_at — allow up to 512 tokens in the response.

## When to prefer this

Choose this endpoint when you need a specialized SQL-generation model (SQLCoder-7B-2) without managing API keys, and you are comfortable paying per-call in USDC via the x402 protocol on Base, Polygon, Arbitrum, World, or Solana. Ideal for agents that need on-demand text-to-SQL conversion with crypto micropayments and no subscription overhead.

## Known failure modes

- Payment failure if USDC balance insufficient or unsupported chain used
- 402 Payment Required if x402 payment header is missing or malformed
- Invalid input if messages array is empty or missing required role/content fields
- max_tokens out of range (must be 1–4096) returns validation error
- Model unavailable on Cloudflare Workers AI backend returns 5xx
- Malformed JSON request body returns 400

## How this service works

x402 workers ai. pay with usdc on base, polygon, arbitrum, world, or solana. no api keys.

## Output

A JSON object containing the model name (@cf/defog/sqlcoder-7b-2) and the assistant's generated response, typically a SQL query or explanation, based on the input messages.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant"
      ],
      "type": "string",
      "description": "Speaker role for this turn."
     },
     "content": {
      "type": "string",
      "description": "Message text for this turn."
     }
    }
   },
   "description": "Conversation turns in order (system, user, assistant)."
  },
  "max_tokens": {
   "type": "integer",
   "maximum": 4096,
   "minimum": 1,
   "description": "Maximum tokens to generate in the assistant reply."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "@cf/defog/sqlcoder-7b-2",
  "response": "Hello!"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gedx402-sqlcoder-7b-2-llm-endpoint-664704e6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from llm.gedx402.com](https://www.zero.xyz/host/llm.gedx402.com/llms.txt)
