Real-time streaming JSON validation with automatic repair cycles. Ensures any LLM output conforms to your JSON Schema before it reaches the user.
Provide your JSON Schema. Draft-07 and draft-2020-12 supported with full validation.
LLM tokens flow through our validator. Valid chunks stream to your app instantly.
On validation errors, repair context is sent back to the LLM. It self-corrects in real-time.
Paste a JSON Schema and see validation in action
import { SchemaGuard } from '@schema-guard/sdk';
const guard = new SchemaGuard({
apiKey: process.env.SG_API_KEY
});
for await (const chunk of guard.stream(
"Generate a user object",
{ schema: userSchema }
)) {
console.log(chunk); // Valid JSON
}
from schema_guard import SchemaGuard
guard = SchemaGuard(
api_key=os.getenv("SG_API_KEY")
)
async for chunk in guard.stream(
"Generate a user object",
schema=user_schema
):
print(chunk) # Valid JSON
Valid chunks stream instantly. No waiting for complete generation.
Automatic correction cycles with LLM context injection.
JSON Schema draft-07 and draft-2020-12.
OpenAI, Anthropic, Google AI — all supported.
Start free, scale as you grow