Works with Every AI Framework
Drop-in OpenAI-compatible API that works with LangChain, LlamaIndex, CrewAI, AutoGen, Vercel AI SDK, and 14+ other frameworks. Change two lines of code. Keep everything else.
Two-Line Migration
Forge exposes a fully OpenAI-compatible API at https://api.optima-forge.com/v1. Any SDK, framework, or tool that supports OpenAI works with Forge by changing the base URL and API key. Your prompts, tools, streaming logic, function calling, and structured output all work identically. Behind the scenes, Forge adds intelligent routing, persistent memory, security scanning, and full observability to every request.
Integration Examples
Integrating with Forge takes under a minute. Here are examples for the most popular SDKs and frameworks.
from openai import OpenAI
client = OpenAI(
base_url="https://api.optima-forge.com/v1",
api_key="forge_sk_..."
)
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
extra_body={"forge": {"cache": True}}
)import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
const { text } = await generateText({
model: openai("auto", {
baseURL: "https://api.optima-forge.com/v1",
apiKey: "forge_sk_..."
}),
prompt: "Explain quantum computing"
});from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://api.optima-forge.com/v1",
api_key="forge_sk_...",
model="auto"
)
response = llm.invoke("Summarize this document")14+ Supported Frameworks
Every framework that supports OpenAI-compatible APIs works with Forge. Here is a non-exhaustive list of frameworks we actively test against and support.
LangChain
OrchestrationUse ChatOpenAI with Forge's base URL. All chains, agents, and retrieval pipelines work without modification. Memory, tools, and callbacks pass through transparently.
LlamaIndex
Data FrameworkConfigure the OpenAI LLM class with Forge credentials. Query engines, chat engines, and data agents run against Forge's routing layer with full memory and security.
CrewAI
Multi-AgentSet Forge as the LLM provider for all crew agents. Role-based agent orchestration works natively, with Forge adding cross-provider routing and persistent memory.
AutoGen
Multi-AgentPoint AutoGen's model client at Forge. Multi-agent conversations, code execution, and group chats route through Forge with automatic failover and cost tracking.
Semantic Kernel
OrchestrationUse the OpenAI connector with Forge's endpoint. Planners, plugins, and memory connectors work out of the box. Microsoft Copilot-style applications benefit from Forge's security pipeline.
Vercel AI SDK
FrontendUse the OpenAI provider with a custom base URL. Streaming, tool calling, and structured output generation work identically through Forge's gateway.
OpenAI Agents SDK
Multi-AgentRoute OpenAI Agents through Forge for multi-provider failover, cost optimization, and security scanning. Agent handoffs and tool calls are fully supported.
Haystack
Data FrameworkConfigure the OpenAIChatGenerator with Forge's API URL. Pipelines, retrievers, and generators route through Forge with tracing and memory enabled.
LiteLLM
GatewayForge can serve as a backend for LiteLLM or replace it entirely. Both expose OpenAI-compatible APIs, so migration is a base URL change.
Instructor
Structured OutputStructured output extraction with Pydantic models works through Forge. The gateway preserves function calling and JSON mode for all supported providers.
DSPy
ProgrammingConfigure DSPy's language model to use Forge's endpoint. Signature-based programming, optimizers, and assertions run through Forge with cost tracking.
Mastra
OrchestrationUse Forge as the LLM backend for Mastra agents, workflows, and tool integrations. The OpenAI-compatible API ensures full compatibility.
Pydantic AI
Structured OutputConfigure the OpenAI model with Forge's base URL. Structured responses, tool calls, and streaming all work natively through the gateway.
Spring AI
EnterpriseJava and Kotlin applications use Spring AI's OpenAI auto-configuration with Forge's endpoint URL. Chat clients, embedding clients, and function calling are supported.
All Major LLM Providers
Forge routes to 14+ LLM providers through a unified interface. Add providers to your account via the dashboard, and Forge handles authentication, rate limiting, and failover automatically.
OpenAI
GPT-4o, GPT-4o-mini, o1, o3
Anthropic
Claude Opus 4, Sonnet 4, Haiku
Gemini 2.5 Pro, Flash, Ultra
Mistral
Large, Medium, Small, Codestral
Meta (via providers)
Llama 4 Scout, Maverick
Cohere
Command R+, Command R
Perplexity
Sonar Pro, Sonar
Groq
Llama, Mixtral (ultra-fast inference)
Together AI
Open-source models at scale
Fireworks AI
Optimized open-source serving
DeepSeek
DeepSeek V3, Coder
xAI
Grok 3, Grok 3 Mini
Amazon Bedrock
Claude, Llama, Titan
Azure OpenAI
GPT-4o, GPT-4o-mini (Azure-hosted)
Switch in under a minute
Replace your OpenAI base URL with Forge's endpoint. Your existing code, prompts, and integrations work immediately. Gain routing, memory, security, and observability with zero refactoring.