NaviGator AI

Responses API

Use NaviGator AI Toolkit's limited support for the OpenAI Responses API

NaviGator AI Toolkit provides limited support for the OpenAI Responses API. Feature coverage varies by model and deployment.

Documented NaviGator AI Toolkit support includes text input and output, structured output and image analysis subject to the limitations below.

Before you begin

Complete Getting Started, install the Python openai package and make sure your key can use the example model. See OpenAI-compatible SDKs for installation and environment configuration.

Create a text response

This example uses the active cloud model gpt-5-nano:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NAVIGATOR_TOOLKIT_API_KEY"],
    base_url=os.environ.get(
        "NAVIGATOR_API_BASE_URL",
        "https://api.navigator.ai.ufl.edu/v1",
    ),
)

response = client.responses.create(
    model="gpt-5-nano",
    input="Tell me a short story about a pirate lost at sea.",
)

print(response.output_text)

A successful request prints a generated story. Its wording varies between requests.

Manage a stored response

For supported cloud model workflows, retrieve a response by its ID:

retrieved = client.responses.retrieve(response.id)
print(retrieved.output_text)

Delete it when the application no longer needs the stored response:

client.responses.delete(response.id)

Deletion removes that stored response from later retrieval. Do not use these lifecycle operations with local model response IDs.

Use a local model

Local-model responses are returned inline, but currently cannot be retrieved using their generated response IDs:

response = client.responses.create(
    model="gpt-oss-20b",
    input="Tell me a short story about a pirate lost at sea.",
)

print(response.output_text)

A successful request prints the generated local model response immediately. Do not call client.responses.retrieve() or client.responses.delete() for this local model workflow.

Request structured output

Install Pydantic with the OpenAI client:

python -m pip install openai pydantic

This example uses the active cloud model gpt-5-mini:

import os

from openai import OpenAI
from pydantic import BaseModel


class CalendarEvent(BaseModel):
    name: str
    date: str
    participants: list[str]


client = OpenAI(
    api_key=os.environ["NAVIGATOR_TOOLKIT_API_KEY"],
    base_url=os.environ.get(
        "NAVIGATOR_API_BASE_URL",
        "https://api.navigator.ai.ufl.edu/v1",
    ),
)

response = client.responses.parse(
    model="gpt-5-mini",
    input=[
        {"role": "system", "content": "Extract the event information."},
        {
            "role": "user",
            "content": "Alice and Bob are going to a science fair on Friday.",
        },
    ],
    text_format=CalendarEvent,
)

event = response.output_parsed
if event is None:
    raise RuntimeError("The response did not contain a parsed event.")

print(event)

A successful request prints a validated CalendarEvent object containing the extracted name, date and participants. Structured-output support is model-dependent. Test the exact model and schema used by your application.

Limitations

  • Not every model supports the complete Responses API.
  • Local models currently do not support image analysis through Responses. Use Image understanding through Chat Completions instead.
  • NaviGator AI Toolkit's Files API support is partial and currently limited to OpenAI models.
  • Request parameters and response lifecycle operations can differ by model provider.

Use Chat Completions when you need the broadest compatibility across NaviGator AI Toolkit models.

On this page