OpenAI's API இலிருந்து Smart AIPI-க்கு எப்படி மாறுவது (5 நிமிட வழிகாட்டி)
OpenAI's API இலிருந்து Smart AIPI-க்கு மாறுவதற்கான படிப்படியான வழிகாட்டி. உங்கள் base URL-ஐ மாற்றுங்கள், உங்கள் code-ஐ அதேபடி வைத்திருக்கலாம். Python, Node.js, cURL, LangChain, Cursor மற்றும் பலவற்றுடன் வேலை செய்கிறது.
சுருக்கமாக: உங்கள் base URL-ஐ https://api.smartaipi.com/v1 ஆக மாற்றி, உங்கள் Smart AIPI API key-ஐ பயன்படுத்துங்கள். மற்ற எல்லாம் அதேபடி இருக்கும் — prompts, streaming, function calling, structured outputs. 5 நிமிடங்களுக்குள் முடியும். ஒவ்வொரு API call-இலும் 75% சேமிக்கலாம்.
OpenAI's API இலிருந்து Smart AIPI-க்கு மாற, உங்கள் base URL-ஐ https://api.smartaipi.com/v1 ஆக மாற்றி, உங்கள் Smart AIPI API key-ஐ பயன்படுத்துங்கள். மற்ற எல்லாம் — prompts, streaming, function calling, structured outputs — அதேபடி இருக்கும். முழு செயல்முறை 5 நிமிடங்களுக்குள் முடியும்.
படி 1: இலவச கணக்கை உருவாக்குங்கள்
smartaipi.com/signup இல் பதிவு செய்யுங்கள். GitHub, Google, அல்லது Microsoft OAuth-ஐ பயன்படுத்தலாம். ஒவ்வொரு கணக்கிற்கும் இலவச credits கிடைக்கும் — credit card தேவையில்லை.
படி 2: API key உருவாக்குங்கள்
உங்கள் dashboard-க்கு சென்று, API Keys → Create API Key என்பதைக் கிளிக் செய்யுங்கள். அதற்கு ஒரு பெயர் கொடுத்து key-ஐ நகலெடுக்கவும். அது ஒரே முறை மட்டுமே காட்டப்படும்.
படி 3: உங்கள் Base URL-ஐ மாற்றுங்கள்
இதுதான் ஒரே மாற்றம். OpenAI-ன் URL-ஐ Smart AIPI-ன் URL-ஆல் மாற்றுங்கள்:
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk-proj-your-smart-aipi-key",
base_url="https://api.smartaipi.com/v1"
)
# மற்ற எல்லாம் முற்றிலும் அதேபடி இருக்கும்
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 (LangChain, Cursor, Continue போன்றவற்றுடன் வேலை செய்கிறது)
export OPENAI_API_KEY=sk-proj-your-smart-aipi-key
export OPENAI_BASE_URL=https://api.smartaipi.com/v1
பெரும்பாலான frameworks மற்றும் tools — LangChain, LlamaIndex, Cursor, Continue, Codex CLI — இந்த environment variables-ஐ தானாகவே படிக்கும்.
படி 4: இது வேலை செய்கிறதா என்பதை சரிபார்க்கவும்
ஒரு test request அனுப்பி, உங்கள் Smart AIPI dashboard-ஐப் பார்க்கவும். சில விநாடிகளுக்குள் usage stats-இல் அந்த request தோன்ற வேண்டும்.
அடிக்கடி கேட்கப்படும் கேள்விகள்
Smart AIPI-இல் streaming வேலை செய்கிறதா?
ஆம். stream: true என்று அமைத்து, Server-Sent Events-ஐ முற்றிலும் அதே முறையில் handle செய்யுங்கள். எந்த மாற்றமும் தேவையில்லை.
function calling மற்றும் tool use வேலை செய்கிறதா?
முழுமையாக ஆதரிக்கப்படுகிறது. Tools, function calling, JSON mode, structured outputs — முழுமையான OpenAI API spec-ம் Smart AIPI வழியாக வேலை செய்கிறது.
Anthropic API format-ஐ பயன்படுத்தும் tools பற்றி என்ன?
Smart AIPI, Anthropic API format-ஐயும் ஆதரிக்கிறது (/v1/messages). ANTHROPIC_BASE_URL=https://api.smartaipi.com என்று அமைக்கவும்; Anthropic SDK-க்காக உருவாக்கப்பட்ட tools, backend-இல் GPT-5.3 Codex-ஐ பயன்படுத்தும்.
எவ்வளவு சேமிக்கலாம்?
ஒவ்வொரு API call-இலும் 75%. GPT-5.3 Codex output, Smart AIPI வழியாக $3.50/1M tokens ஆகும்; OpenAI-இலிருந்து நேரடியாக எடுத்தால் $14.00/1M. மாதத்திற்கு 10M tokens என்றால், $100-க்கும் அதிகம் சேமிக்கலாம்.
என் prompts அல்லது response handling-ஐ மாற்ற வேண்டுமா?
வேண்டாம். Smart AIPI முழுமையாக OpenAI-compatible. ஒரே மாற்றம் base URL மட்டுமே. உங்கள் prompts, response parsing, error handling — அனைத்தும் அதேபடி இருக்கும்.
OpenAI-compatible API gateway. Frontier AI models ஐ 75% குறைந்த செலவில் அணுகுங்கள்.
இலவசமாக தொடங்குங்கள்