Duty Desk: Ten-Minute JSON Output Readiness Check
Shift objective: turn one model response into a validated object before connecting it to a job runner, database, or customer workflow. Budget ten minutes. The important distinction is simple: valid JSON is not necessarily valid application data, and a shared API shape does not make every model’s output controls identical.
First two minutes: separate syntax from schema
JSON mode generally asks the service to return syntactically valid JSON. It does not, by itself, establish that a required field exists, an enum is respected, or an unexpected field is absent. Those are schema and application-validation concerns.
Schema-constrained structured output adds a stronger contract when the selected model and endpoint support it. Support can differ by model, route, schema feature, and API surface. Refusals, interrupted generations, and transport errors still require explicit handling; do not treat every response as a completed business object.
Use a small test contract: an object containing a status chosen from ready or blocked, plus a next_action string. Require both properties and disallow additional properties. Small contracts make unsupported features and malformed responses easier to diagnose.
Minutes two through four: confirm the route’s contract
Relay365 fits when you want a pay-as-you-go relay desk across multiple model families without maintaining separate client configurations for every provider. Its API base is https://api.api365relay.com; OpenAI clients use https://api.api365relay.com/v1. Compatibility with an SDK does not imply identical structured-output support across every routed model.
Before testing, check the current model listing and route documentation. For example, if you choose Gemini 2.5 Flash, use its exact advertised API identifier rather than assuming the display name is the request value. Confirm whether that route accepts json_schema, only json_object, or neither. Keep capability settings per route instead of applying one response_format globally.
Minutes four through six: send a schema probe
Set RELAY365_API_KEY in your environment, replace MODEL_ID below with the verified identifier, and run this request only on a route documented to accept this Chat Completions schema format. The strict flag requests schema adherence; it does not establish that an unverified route supports it.
curl https://api.api365relay.com/v1/chat/completions -H "Authorization: Bearer $RELAY365_API_KEY" -H "Content-Type: application/json" -d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Return a JSON object describing this check: the configuration is missing an API key. Mark it blocked and suggest a next action."}],"response_format":{"type":"json_schema","json_schema":{"name":"readiness_check","strict":true,"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready","blocked"]},"next_action":{"type":"string"}},"required":["status","next_action"],"additionalProperties":false}}}}'
If the route supports only JSON mode, substitute this response_format value and put the field requirements explicitly in the prompt: {"type":"json_object"}. Treat that as a weaker generation contract, not an equivalent replacement for schema enforcement. If neither option is supported, prompt-only JSON can be tested, but must remain an untrusted candidate.
Minutes six through eight: validate before acting
- Check the HTTP result and response envelope before extracting generated content, including any available refusal or completion-status indicators.
- Parse the extracted content with a JSON parser, never eval, and reject incomplete or non-JSON text.
- Validate the parsed value locally against the same schema, using a JSON Schema library configured for the schema dialect you use.
- Apply business rules separately, because a schema-valid next_action can still be unsafe, irrelevant, or factually wrong.
For this probe, expect blocked and a relevant remediation suggestion. Do not execute generated actions directly. If validation fails, record the failure category and use a bounded retry policy; do not silently accept missing fields or strip arbitrary text until something parses.
Final two minutes: record the handoff conditions
Test a normal input, an ambiguous input, and an input asking the model to ignore the format. Record the route identifier, schema version, response-format setting, and validation outcome. Redact secrets and sensitive payloads from logs. Repeat these checks whenever you change models or routing configuration.
If a shared endpoint suits your workflow, create a Relay365 account and run this small probe before migrating production traffic. The handoff criterion is repeatable validation with explicit failure handling—not one attractive JSON response.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-30 | Duty Log: Ten Minutes to Fence In Factual Answers | Field notes from the desk | EN |
| 2026-10-30 | Duty desk: first log triage in ten minutes | Field notes from the desk | EN |
| 2026-10-30 | Duty Log: Prompt Release Held Until These Checks Pass | Field notes from the desk | EN |
| 2026-10-30 | Shift Note: Referral Credits Against a $240 Relay Bill | Field notes from the desk | EN |
| 2026-10-30 | Shift Note: Environment Variables Set in Ten Minutes | Field notes from the desk | EN |
| 2026-10-29 | Relay Desk Shift Note: Ten Minutes to a Referral Ledger | Field notes from the desk | EN |
Curious how it runs on your own code? Sign up →