---
title: "Schematron API: HTML-to-JSON Extraction | Inference.net"
description: "Run Schematron V2 Turbo and V2 Small for HTML-to-JSON extraction on one API. From $0.03/1M input, 128K context, strict JSON Schema, US residency, ZDR."
url: "https://inference.net/models/schematron/"
---

SCHEMATRON API

# Schematron API

Extract typed, schema-validated JSON directly from raw HTML using Inference.net's hosted Schematron V2 models over /v1/chat/completions, /v1/responses, and /v1/messages. Compare live pricing and throughput tiers across Schematron V2 Turbo and Schematron V2 Small with 128K context windows, default Zero Data Retention, and US data residency. Pair with our structured data extraction solution (/solutions/structured-data-extraction/) and Crawl4AI guide (/content/crawl4ai-complete-guide/).

- Purpose-built HTML-to-JSON extraction with strict JSON Schema adherence
- Ultra-low flat pricing starting at $0.03/1M input and $0.15/1M output tokens
- Hosted on Inference.net with default Zero Data Retention (SOC 2 Type II)
- 128K context window and US data residency via us.api.inference.net

[Get Schematron API key](https://inference.net/register/?model=schematron-v2-turbo) [Estimate monthly cost](https://inference.net/tools/llm-pricing-calculator/) [Full model catalog](https://inference.net/models/)

LIVE CATALOG & PRICING

## All live Schematron models on Inference.net

Every rate, context limit, and capability below is pulled directly from the live public catalog. Select any model for full specs, live latency benchmarks, and prompt-caching guidance.

| Model | Context | Max output | Input / 1M | Cached / 1M | Output / 1M | Capabilities | Start |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Schematron V2 Turbo](https://inference.net/models/schematron-v2-turbo/) `inference-net/schematron-v2-turbo` | 128K | 8K | $0.03 | $0.03 | $0.15 | Text | [Use API](https://inference.net/register/?model=schematron-v2-turbo) |
| [Schematron V2 Small](https://inference.net/models/schematron-v2-small/) `inference-net/schematron-v2-small` | 128K | 4K | $0.05 | $0.05 | $0.23 | Text | [Use API](https://inference.net/register/?model=schematron-v2-small) |

QUICKSTART

## Call Schematron over OpenAI or Anthropic SDKs

Use the top live model ID (`inference-net/schematron-v2-turbo`) with the standard OpenAI SDK, curl, or Claude Code over native `/v1/messages`.

QUICKSTART [Get API key](https://inference.net/register/?model=schematron-v2-turbo)

```typescript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.inference.net/v1',
  apiKey: process.env.INFERENCE_API_KEY,
})

const completion = await client.chat.completions.create({
  model: 'inference-net/schematron-v2-turbo',
  messages: [{ role: 'user', content: 'Hello' }],
})
```

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inference.net/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
)

completion = client.chat.completions.create(
    model="inference-net/schematron-v2-turbo",
    messages=[{"role": "user", "content": "Hello"}],
)
```

```curl
curl https://api.inference.net/v1/chat/completions \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "inference-net/schematron-v2-turbo",
    "messages": [
      { "role": "user", "content": "Hello" }
    ]
  }'
```

CLAUDE CODE & ANTHROPIC /V1/MESSAGES

Point Claude Code or any Anthropic SDK client at Inference.net with zero proxy setup and full prompt-cache support.

```bash
export ANTHROPIC_BASE_URL="https://api.inference.net"
export ANTHROPIC_AUTH_TOKEN="$INFERENCE_API_KEY"
export ANTHROPIC_MODEL='inference-net/schematron-v2-turbo'
export ANTHROPIC_DEFAULT_OPUS_MODEL='inference-net/schematron-v2-turbo'
export ANTHROPIC_DEFAULT_SONNET_MODEL='inference-net/schematron-v2-turbo'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='inference-net/schematron-v2-turbo'
export CLAUDE_CODE_SUBAGENT_MODEL='inference-net/schematron-v2-turbo'
export CLAUDE_CODE_MAX_CONTEXT_TOKENS="128000"
claude
```

[Claude Code setup guide](https://inference.net/docs/integrations/claude-code/) [Anthropic SDK docs](https://inference.net/docs/api/anthropic-sdk/)

COMPARISONS, GUIDES & TOOLS

## Benchmark, compare, and model Schematron costs

Verify unit economics across prompt-cache hit rates, compare providers, and explore engineering guides for Schematron.

[COMPARISON Inference.net vs OpenAI API Compare low-cost structured HTML-to-JSON extraction on Schematron V2 against general frontier APIs. Read comparison](https://inference.net/compare/inference-net-vs-openai-api/) [COMPARISON Inference.net vs OpenRouter Compare direct Inference.net GPU hosting with default ZDR against marketplace routers. Read comparison](https://inference.net/compare/inference-net-vs-openrouter/) [COMPARISON Inference.net vs Fireworks AI Compare serverless structured output pricing, US residency, and Batch or Async APIs. Read comparison](https://inference.net/compare/inference-net-vs-fireworks-ai/) [GUIDE Cheapest LLM API Guide Verified per-1M token rates including ultra-low-cost Schematron V2 extraction tiers. Read guide](https://inference.net/guides/cheapest-llm-api/) [GUIDE Inference Economics Guide Understand per-token cost structure, batch throughput, and total pipeline economics. Read guide](https://inference.net/guides/inference-economics/) [GUIDE Best Open-Source LLMs Guide Workload-by-workload model selection for extraction, coding, and production pipelines. Read guide](https://inference.net/guides/best-open-source-llms/) [CALCULATOR LLM Pricing Calculator Estimate monthly token spend across live Schematron models and sibling open-weight tiers. Open calculator](https://inference.net/tools/llm-pricing-calculator/) [CALCULATOR Prompt Cache Calculator Model 50%, 75%, and 90% cache hit-rate savings for multi-turn coding agents and RAG workflows. Calculate savings](https://inference.net/tools/prompt-cache-calculator/) [INTEGRATION Claude Code Integration Connect Claude Code directly to Schematron models on Inference.net using native /v1/messages. Read docs](https://inference.net/docs/integrations/claude-code/)

MODEL FAMILIES

## Explore other open-weight model families

Switch across DeepSeek, Kimi, GLM, and the full catalog with one API key and one OpenAI-compatible client.

[DEEPSEEK API DeepSeek API DeepSeek V4.1 Flash, V4 Pro, and V3.2 with up to 1M context and automatic prompt caching on supported V4.1 and V4 Pro routes, plus default ZDR on hosted routes. Explore DeepSeek models](https://inference.net/models/deepseek/) [KIMI API Kimi API Kimi K3.1 Pro, K3, K3 Fast, and K2.6 for agentic coding, multimodal reasoning, and up to 1M context on K3 models. Explore Kimi models](https://inference.net/models/kimi/) [GLM API GLM API GLM-5.3, GLM-5.3 Flash, and GLM-5.2 for low-cost coding agents, tool calling, and up to 1M context. Explore GLM models](https://inference.net/models/glm/) [QWEN API Qwen API Qwen 3.7 Plus, Qwen 3 30B A3B, and Qwen 3 14B with up to 1M context, multimodal input, and implicit caching on Qwen 3.7 Plus. Explore Qwen models](https://inference.net/models/qwen/) [GROK API Grok API Grok 4.6 and Grok 4.5 with 500K context, vision, configurable reasoning, and x-grok-conv-id prompt caching over one API key. Explore Grok models](https://inference.net/models/grok/) [FULL CATALOG All Models & Pricing Search, sort, and compare every live open-weight and frontier model on Inference.net. Browse all models](https://inference.net/models/)

FAQ

## Frequently asked questions.

Quick answers to help you get started

### How much does the Schematron API cost on Inference.net?

Inference.net currently serves 2 live Schematron models with transparent pay-as-you-go per-token billing. Input rates start at $0.03 per 1M input tokens ($0.15 per 1M output tokens) on Schematron V2 Turbo. Every rate in the comparison table above pulls directly from the live public catalog.

### Does Inference.net support prompt caching for Schematron models?

Schematron V2 models use flat low-cost per-token pricing rather than a separate prompt-cache discount, with cached input reads billed at the standard input rate ($0.03 per 1M tokens on Schematron V2 Turbo). Because HTML-to-JSON extraction runs as single-pass schema inference over distinct pages, pre-clean raw HTML with lxml and review /solutions/structured-data-extraction/ and /content/crawl4ai-complete-guide/ for batch and crawler workflows.

### Can I call Schematron models with the OpenAI SDK, Anthropic SDK, or Claude Code?

Yes. Point the official OpenAI TypeScript or Python SDK to https://api.inference.net/v1 with your INFERENCE_API_KEY, set model to "inference-net/schematron-v2-turbo", pass your JSON Schema via response_format with temperature 0, and call /v1/chat/completions, /v1/responses, or /v1/messages. See /docs/api/models/schematron/ and /solutions/structured-data-extraction/ for full preprocessing and Batch API examples.

### Does Inference.net offer Zero Data Retention for the Schematron API?

Yes. Schematron V2 Turbo and Schematron V2 Small are hosted directly on Inference.net infrastructure, so Zero Data Retention (ZDR) is enabled by default for new accounts under SOC 2 Type II controls and prompts or extracted JSON outputs are not stored after processing or used for model training. Review our [ZDR policy](https://inference.net/zero-data-retention/) for full details. Both models also support US data residency via https://us.api.inference.net/v1 alongside https://api.inference.net/v1.

### What context windows and capabilities do Schematron models support?

Live Schematron models on Inference.net scale up to a 128K-token context window (128,000 tokens) and up to 8K output tokens on Schematron V2 Turbo. Context limits and caching vary by checkpoint, so check each model row above for exact specs and multimodal capabilities. Both Schematron V2 models focus on text-only HTML-to-JSON structured outputs; see /solutions/structured-data-extraction/ and /content/crawl4ai-vs-firecrawl-vs-schematron/ for pipeline comparisons.

GET STARTED

## Start calling Schematron in minutes

Create a project API key with Zero Data Retention enabled by default on eligible Inference.net-hosted routes and route requests to `inference-net/schematron-v2-turbo` with pay-as-you-go billing.

[Create free API key](https://inference.net/register/?model=schematron-v2-turbo) [API quickstart docs](https://inference.net/docs/api/quickstart/)
