How to Switch from OpenAI's API to Smart AIPI (5-Minute Guide)
Step-by-step guide to switching from OpenAI's API to Smart AIPI. Change your base URL, keep your code. Works with Python, Node.js, cURL, LangChain, Cursor, and more.
TL;DR: Change your base URL to https://api.smartaipi.com/v1 and use your Smart AIPI API key. Everything else stays the same — prompts, streaming, function calling, structured outputs. Takes under 5 minutes. Save 75% on every API call.
To switch from OpenAI's API to Smart AIPI, change your base URL to https://api.smartaipi.com/v1 and use your Smart AIPI API key. Everything else — prompts, streaming, function calling, structured outputs — stays the same. The whole process takes under 5 minutes.
Step 1: Create a Free Account
Sign up at smartaipi.com/signup. You can use GitHub, Google, or Microsoft OAuth. Every account gets free credits — no credit card required.
Step 2: Generate an API Key
Go to your dashboard, click API Keys → Create API Key. Give it a name and copy the key. You'll only see it once.
Step 3: Change Your Base URL
This is the only change. Replace OpenAI's URL with Smart AIPI's:
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk-proj-your-smart-aipi-key",
base_url="https://api.smartaipi.com/v1"
)
# Everything else stays exactly the same
response = client.chat.completions.create(
model="gpt-5.3-codex",
messages=[{"role": "user", "content": "Hello!"}]
)
Node.js
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-proj-your-smart-aipi-key',
baseURL: 'https://api.smartaipi.com/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-5.3-codex',
messages: [{ role: 'user', content: 'Hello!' }],
});
cURL
curl https://api.smartaipi.com/v1/chat/completions \
-H "Authorization: Bearer sk-proj-your-smart-aipi-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.3-codex","messages":[{"role":"user","content":"Hello!"}]}'
Environment Variables (works with LangChain, Cursor, Continue, etc.)
export OPENAI_API_KEY=sk-proj-your-smart-aipi-key
export OPENAI_BASE_URL=https://api.smartaipi.com/v1
Most frameworks and tools — LangChain, LlamaIndex, Cursor, Continue, Codex CLI — read these environment variables automatically.
Step 4: Verify It Works
Make a test request and check your Smart AIPI dashboard. You should see the request in your usage stats within seconds.
Frequently Asked Questions
Does streaming work with Smart AIPI?
Yes. Set stream: true and handle Server-Sent Events exactly the same way. No changes needed.
Does function calling and tool use work?
Fully supported. Tools, function calling, JSON mode, structured outputs — the complete OpenAI API spec works through Smart AIPI.
What about tools that use the Anthropic API format?
Smart AIPI also supports the Anthropic API format (/v1/messages). Set ANTHROPIC_BASE_URL=https://api.smartaipi.com and tools built for the Anthropic SDK will use GPT-5.3 Codex on the backend.
How much will I save?
75% on every API call. GPT-5.3 Codex output costs $3.50/1M tokens through Smart AIPI vs $14.00/1M direct from OpenAI. For 10M tokens/month, that's over $100 saved.
Do I need to change my prompts or response handling?
No. Smart AIPI is fully OpenAI-compatible. The only change is the base URL. Your prompts, response parsing, error handling — everything stays the same.
OpenAI-compatible API gateway. Access frontier AI models at 75% less cost.
Start for free