
Use the OpenPond AI Gateway with the OpenAI JavaScript SDK
The OpenPond AI Gateway is OpenAI-compatible, so existing server-side code can
use the standard openai package. The important change is the base URL and an
OpenPond API key; the key stays on the server.

Install the client
npm install openaiSet OPENPOND_API_KEY in your server environment. Do not place it in browser
code, a public environment variable, or a client bundle.
Point the client at OpenPond
import OpenAI from "openai";
const apiKey = process.env.OPENPOND_API_KEY?.trim();
if (!apiKey) throw new Error("OPENPOND_API_KEY is required");
const openai = new OpenAI({
apiKey,
baseURL: "https://api.openpond.ai/opchat/v1",
});
const models = await openai.models.list();
const model = models.data[0]?.id;
if (!model) throw new Error("No hosted OpenPond models are available");
const completion = await openai.chat.completions.create({
model,
messages: [{ role: "user", content: "Write one sentence about clean APIs." }],
});
console.log(completion.choices[0]?.message.content);Listing the catalog first prevents a hard-coded model identifier from drifting away from the hosted options available to your account.

The gateway is an inference surface. It does not grant broader Workspace, Project, Sandbox, or connected-app authority. Treat it as a server-side API integration: scope the key correctly, never log it, and pass only the data necessary for the request.
For the complete walkthrough, see the OpenAI JavaScript quickstart.