The request pattern
Your server gathers relevant state, declares narrow questions, calls the current official endpoint and uses returned decisions within explicit code. Keep policy, thresholds and irreversible actions outside the model.
Protect the API key
Never include a private key in public HTML, browser JavaScript or a Git repository. Send requests through a trusted backend or edge function, use environment secrets, apply rate limits and log only the data your privacy policy permits.
Make questions atomic
When a judgment mixes several independent concerns, split it into smaller questions. Combine the returned signals with code so each condition can be evaluated, monitored and changed explicitly.
Production checklist
- Verify endpoint, SDK and model name against current official documentation.
- Evaluate on a labeled dataset drawn from your real workload.
- Choose thresholds from measured costs of false positives and false negatives.
- Add a review path for low-confidence and high-impact cases.
- Pin versions when stability matters and retest before upgrading.
- Monitor latency, errors, calibration and decision drift.
Use official documentation
API fields, authentication and availability change. TypeSafe AI is the source of truth.
Go to TypeSafe AI ↗