SureJSON

For developers

JSON Guarantee API

Cheap models advertise JSON mode — then ship empty bodies, truncated strings, and markdown fences. SureJSON is the drop-in layer that only returns parseable JSON (or an honest failure).

Real pain

Why production parsers keep breaking

Solution

Two ways to ship sure JSON

Quickstart

Swap the base URL. Keep your code.

Claim a free key from the operator workspace, then call the API.

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_SUREJSON_KEY",
    base_url="https://surejson.com/v1",
)

res = client.chat.completions.create(
    model="surejson-fast",
    messages=[
        {"role": "system", "content": "Return ONLY valid JSON."},
        {"role": "user", "content": "Extract name and company from: Sam Ortiz at RiverCo"},
    ],
    response_format={"type": "json_object"},
)

print(res.choices[0].message.content)  # always parseable when ok

Or use the Sure Envelope — no parse dance:

curl -s https://surejson.com/v1/sure \
  -H "Authorization: Bearer YOUR_SUREJSON_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Extract name and company from: Sam Ortiz at RiverCo",
    "schema_hint": "{\"name\": string, \"company\": string}"
  }'

# → { "ok": true, "guarantee": "parseable_json", "data": { ... } }

Live JSON lab

Prove the guarantee in your browser.

Free. Uses the same key as the everyday workspace.

Get free key

Endpoints

What you call

POST /v1/sure
Sure Envelope. Returns { ok, guarantee, data } or structured failure. Best DX when you never want to catch parse errors.
POST /v1/chat/completions
OpenAI-compatible drop-in. Use any OpenAI SDK with base_url=https://surejson.com/v1.
POST /v1/credits/claim
Free start key (also created from the operator workspace).
GET /v1/credits · GET /v1/models
Balance + model list.