API Integration
Integrate gpt-4o-mini into your applications using the following code snippets.
from openai import OpenAI
client = OpenAI(
base_url="https://api.llm7.io/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: "https://api.llm7.io/v1",
apiKey: "YOUR_API_KEY",
});
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);
curl "https://api.llm7.io/v1/models/gpt-4o-mini:generateContent?key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Hello!"}]}]
}'