Installation
Install the Forge SDK in your project.
Installation
Optima Forge provides official SDKs for JavaScript/TypeScript and Python. Because Forge implements the OpenAI-compatible API spec, you can also use any OpenAI client by simply changing the base URL.
JavaScript / TypeScript
# npm
npm install @optima-forge/sdk
# yarn
yarn add @optima-forge/sdk
# pnpm
pnpm add @optima-forge/sdk
Python
# pip
pip install optima-forge
# poetry
poetry add optima-forge
Using the OpenAI SDK Directly
If you already use the OpenAI SDK, you can point it at Forge without installing anything new:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FORGE_API_KEY,
baseURL: "https://api.optima-forge.com/v1",
});
Python equivalent:
from openai import OpenAI
client = OpenAI(
api_key="forge_sk_your_key_here",
base_url="https://api.optima-forge.com/v1",
)
Requirements
- Node.js 18+ for the JavaScript SDK
- Python 3.9+ for the Python SDK
- A valid Forge API key (get one at Dashboard → API Keys)
Environment Configuration
We recommend storing your API key in environment variables rather than hardcoding it:
# .env
FORGE_API_KEY=forge_sk_your_key_here
FORGE_BASE_URL=https://api.optima-forge.com/v1
The SDK automatically reads FORGE_API_KEY from the environment if no key is passed to the constructor.