DOCUMENTATION · v1

Ship in an afternoon.

Gridlock is OpenAI-compatible. Point your client at https://api.grid-lock.tech/v1, then set gridlock.sla on each request to pick your speed tier — realtime, standard, batch, or confidential. Fund credits in the dashboard (or pay per request via x402), and receive automatic rebates when workers miss their tier.

API BASE URL
https://api.grid-lock.tech/v1
QUICK START

Change one URL

Point your OpenAI-compatible client at the API base URL below. Existing SDKs, prompts, and streaming all work unchanged.

typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.grid-lock.tech/v1",
  apiKey: process.env.GRIDLOCK_API_KEY,
});
ADD ONE FIELD

Attach an SLA tier

Add a gridlock object to your request body. gridlock.sla picks the latency guarantee — realtime (< 300ms TTFT), standard (< 800ms), batch (< 5s), or confidential (TEE + 800ms). If the worker misses the tier, penalty credits are added to your billing balance automatically.

typescript
const res = await client.chat.completions.create({
  model: "llama-3.1-8b",
  messages: [{ role: "user", content: "hi" }],
  // @ts-expect-error gridlock extension
  gridlock: {
    sla: "realtime", // "realtime" | "standard" | "batch" | "confidential"
    privacy: false,
  },
});

const meta = (res as { gridlock?: { ttft_ms: number; sla_met: boolean; penalty_due_lock?: number } }).gridlock;
if (meta && !meta.sla_met) {
  console.log(`Penalty: ${meta.penalty_due_lock} credits added to balance`);
}
API KEY

Authenticate

Create a wallet-backed API key in Dashboard → API Keys (connect EVM wallet on Robinhood Chain). Send it as Authorization: Bearer gk_…. Jobs bill against your credit balance; deposit ETH from the Billing tab to top up.

BILLING

Credits or x402

Gridlock supports two payment paths. Credits (recommended): deposit ETH once in Dashboard → Billing, then each job deducts from your balance automatically. x402 (fallback): pay per request with an X-Payment header when credits run out or for integrations without pre-funding. SLA penalty rebates only apply to wallet-backed credit balances.

http
// Insufficient credits (no X-Payment header) → HTTP 402
{
  "error": "Insufficient credits balance (0.1200 available, 0.0800 required)",
  "code": "insufficient_credits",
  "balance_lock": 0.12,
  "fee_lock": 0.08
}

// x402 challenge (no key, or credits exhausted + retry with payment)
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "robinhood-mainnet",
    "maxAmountRequired": "80000000000000",
    "resource": "/v1/chat/completions",
    "payTo": "0x…",
    "asset": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
  }]
}

// Retry with signed ETH receipt (base64) in X-Payment header
fetch("https://api.grid-lock.tech/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: "Bearer gk_prod_…",
    "Content-Type": "application/json",
    "X-Payment": paymentHeaderBase64,
  },
  body: JSON.stringify({ model: "llama-3.1-8b", messages: [...], gridlock: { sla: "standard" } }),
});
PAYOUTS

Refunds settle instantly

Every request returns SLA metadata in the gridlock field. If the tier is missed, penalty credits land in your balance immediately—no support ticket, no dashboard bargaining.