Skip to main content
Applies to:
  • Plan -
  • Deployment -

Summary

Goal: Configure JSON schema response formats in TypeScript SDK prompts. Features: prompts.create(), params object, response_format, json_schema

Configuration Steps

Step 1: Wrap response_format in params object

Model parameters must be placed inside the params object, not at the top level.

Step 2: Verify output format in UI

Push prompts with bt functions push prompts.ts and confirm JSON output renders correctly in the Braintrust UI.

Common Mistakes

Placing response_format at the top level causes silent failure—the parameter is ignored and output returns as plain text.

Additional Notes

This structure applies to all model-specific parameters (temperature, max_tokens, etc.), not just response_format.