OpenAI-compatible SDKs
Connect Python and JavaScript clients to NaviGator AI Toolkit
NaviGator AI Toolkit provides OpenAI-compatible endpoints. Applications can use a client that supports a custom API base URL, bearer API key and model ID.
Software development kit (SDK) compatibility does not mean every OpenAI endpoint or option is available for every NaviGator AI Toolkit model. Review the relevant capability guide and model page before relying on a feature.
Configure your environment
Create a key and load it through the temporary hidden prompt or an approved secret-management process in Getting Started. Set only the nonsecret values directly:
export NAVIGATOR_API_BASE_URL="https://api.navigator.ai.ufl.edu/v1"
export NAVIGATOR_MODEL="gpt-oss-120b"Both commands set values only for the current terminal session. Neither contains a secret.
Do not put API keys in source code, recorded shell assignments or source control. Environment variables are inherited by child processes, so use a dedicated least-privilege key and remove the variable when the development process ends.
Python
Before continuing, complete Getting Started, configure the environment above and install a supported Python version with pip. Confirm that the selected model is assigned to your key.
Install the official OpenAI client:
python -m pip install openaiConfigure it to send requests to NaviGator AI Toolkit:
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.chat.completions.create(
model=os.environ.get("NAVIGATOR_MODEL", "gpt-oss-120b"),
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Why do alligators bask in the sun?"},
],
)
print(response.choices[0].message.content)List the model IDs available to the key:
for model in client.models.list().data:
print(model.id)A successful chat request prints a generated answer. The model-list request then prints the exact model IDs available to the key.
JavaScript
Before continuing, complete Getting Started, configure the environment above and install a supported Node.js version with npm. Confirm that the selected model is assigned to your key.
Install the OpenAI package:
npm install openaiUse the server-side client in a Node.js application:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.NAVIGATOR_TOOLKIT_API_KEY,
baseURL: process.env.NAVIGATOR_API_BASE_URL ?? 'https://api.navigator.ai.ufl.edu/v1',
});
const response = await client.chat.completions.create({
model: process.env.NAVIGATOR_MODEL ?? 'gpt-oss-120b',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Why do alligators bask in the sun?' },
],
});
console.log(response.choices[0].message.content);A successful request prints a generated answer from the selected model.
Never place a NaviGator AI Toolkit API key in client-side JavaScript or expose it in a browser bundle. Browser applications should call a server you control. That server should authenticate users, protect the key and enforce authorization and rate limits.
Other clients
For another OpenAI-compatible client, configure the same base URL, key and exact NaviGator AI Toolkit model ID. Client behavior and feature coverage can differ, so test the endpoint and model combination your application requires.