export OPENAI_API_KEY=msp_live_your_key_here export OPENAI_BASE_URL=https://api.modelspend.best/proxy/v1
python your_app.py
import openai
client = openai.OpenAI(
api_key="msp_live_your_key_here",
base_url="https://api.modelspend.best/proxy/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What is 2+2?"}]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'msp_live_your_key_here',
baseURL: 'https://api.modelspend.best/proxy/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'What is 2+2?' }],
});
console.log(response.choices[0].message.content);
curl -X POST https://api.modelspend.best/proxy/v1/chat/completions \
-H "Authorization: Bearer msp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Reply with: READY"}]
}'