from openai import OpenAI
# Point client to Talenttech AI Gateway
client = OpenAI(
base_url="https://ai.talenttech.net.in/api/v1",
api_key="sk-ttai-your_client_secret_key"
)
# 1. Query ChatGPT
response_gpt = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello from Python!"}]
)
print("GPT-4o:", response_gpt.choices[0].message.content)
# 2. Query Claude 3.5 Sonnet (Same SDK!)
response_claude = client.chat.completions.create(
model="claude-3-5-sonnet-20241022",
messages=[{"role": "user", "content": "Explain microservices architecture"}]
)
print("Claude:", response_claude.choices[0].message.content)
# 3. Query Gemini 1.5 Flash
response_gemini = client.chat.completions.create(
model="gemini-1.5-flash",
messages=[{"role": "user", "content": "Write a haiku about AI"}]
)
print("Gemini:", response_gemini.choices[0].message.content)
import OpenAI from 'openai';
// Initialize standard OpenAI SDK
const openai = new OpenAI({
baseURL: 'https://ai.talenttech.net.in/api/v1',
apiKey: 'sk-ttai-your_client_secret_key'
});
async function run() {
const completion = await openai.chat.completions.create({
model: 'claude-3-5-sonnet-20241022',
messages: [{ role: 'user', content: 'Write a clean TypeScript interface' }]
});
console.log(completion.choices[0].message.content);
}
run();
curl -X POST "https://ai.talenttech.net.in/api/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-ttai-your_client_secret_key" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7
}'
<?php
$apiKey = 'sk-ttai-your_client_secret_key';
$url = 'https://ai.talenttech.net.in/api/v1/chat/completions';
$payload = [
'model' => 'gemini-3.6-flash',
'messages' => [
['role' => 'user', 'content' => 'How do satellites stay in orbit?']
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo $data['choices'][0]['message']['content'];
from langchain_openai import ChatOpenAI
# LangChain connects with zero modifications!
llm = ChatOpenAI(
openai_api_base="https://ai.talenttech.net.in/api/v1",
openai_api_key="sk-ttai-your_client_secret_key",
model_name="claude-3-5-sonnet-20241022"
)
response = llm.invoke("Summarize the benefits of AI Gateways")
print(response.content)