Introduction
Developers need quick ways to integrate large language models into apps. This tutorial shows how to connect to the GPT-5 API using Wisdom Gate with working Python and Node.js examples.
Why Wisdom Gate for GPT-5
Cheaper Pricing
Wisdom Gate pricing for GPT-5 is about 20% lower than OpenRouter:
- GPT-5: $1.00 / $8.00 per 1M input/output tokens vs $1.25 / $10.00
- Claude Sonnet 4: $2.40 / $12.00 vs $3.00 / $15.00
Easy Plug-and-Play
Just an API key and a single POST request get you started.
Core Setup
Get Your API Key
- Sign up at Wisdom Gate AI Studio
- Generate & copy your API key.
Base URL & Endpoints
Base URL: https://wisdom-gate.juheapi.com/v1
Key endpoint: /chat/completions
Sample curl:
curl --location --request POST 'https://wisdom-gate.juheapi.com/v1/chat/completions' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model":"wisdom-ai-gpt-5",
"messages": [
{
"role": "user",
"content": "Hello, how can you help me today?"
}
]
}'
Python Integration Steps
Install Requests
pip install requests
Example Code
import requests
url = "https://wisdom-gate.juheapi.com/v1/chat/completions"
headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "wisdom-ai-gpt-5",
"messages": [
{"role": "user", "content": "Hello, GPT-5!"}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Node.js Integration Steps
Install Axios
npm install axios
Example Code
const axios = require('axios');
const url = 'https://wisdom-gate.juheapi.com/v1/chat/completions';
const headers = {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
};
const payload = {
model: 'wisdom-ai-gpt-5',
messages: [
{ role: 'user', content: 'Hello, GPT-5!' }
]
};
axios.post(url, payload, { headers })
.then(res => console.log(res.data))
.catch(err => console.error(err));
Testing Your Calls
- Run Python script:
python main.py
- Run Node.js script:
node main.js
- Check JSON output from the API response.
Switching Models
You can swap "model": "wisdom-ai-gpt-5"
for "wisdom-ai-claude-sonnet-4"
to use Claude Sonnet 4.
Error Handling Tips
- Check HTTP status codes.
- Handle timeouts.
- Validate API key before making calls.
Performance & Cost Optimization
- Batch messages when possible.
- Monitor token usage.
- Choose cheaper models for non-critical tasks.
Next Steps
- Explore streaming endpoints for real-time output.
- Integrate into web services or chatbots.
- Keep API key secure and rotate periodically.