Skip to main content
Structured Outputs enables the model to generate responses that adhere to your supplied JSON Schema.

Supported Models

The following models support Structured Outputs:

Quick Start Guide

This guide demonstrates how to use Structured Outputs ability to generate the JSON response via json_schema response format. We will walk through a complete Python code example.

1. Initialize the Client

First, you need to initialize the client with your Novita API key.

2. Define the JSON schema

This example creates a schema for extracting expense information from the user’s input.

3. Request chat completion API

Now, make the chat completion request to the Novita endpoint. This request includes the response_format parameter, defining the JSON schema we defined in the previous step.
Output:

The Complete Code

Last modified on August 12, 2025