Pomerai / Documentation

JavaScript

Configure the official OpenAI JavaScript client for Pomerai.

Install

npm install openai

Environment variables

POMERAI_API_KEY=YOUR_POMERAI_API_KEY
POMERAI_BASE_URL=YOUR_POMERAI_BASE_URL

Replace the placeholders only when Pomerai has issued your key and published its operational base URL.

Client configuration

The example reads both values from environment variables and configures the client only. It intentionally does not call an endpoint or name an unconfirmed model.

import OpenAI from "openai";

const apiKey = process.env.POMERAI_API_KEY;
const baseURL = process.env.POMERAI_BASE_URL;
if (!apiKey || !baseURL) {
  throw new Error("Set POMERAI_API_KEY and POMERAI_BASE_URL");
}

const client = new OpenAI({ apiKey, baseURL });

Run this code on your server. Never expose your API key in a browser.

These configuration examples follow the official SDK documentation.

Official SDK reference