Change one line. Keep your code.
The Maitre API speaks the OpenAI format, so the OpenAI SDK, LangChain and most AI tools work after you change the base URL. Streaming, tool calling and a usage page that shows every request.
- OpenAI-compatible chat completions
- Streaming, tool calls and images
- Keys and usage in the developer console
from openai import OpenAI
client = OpenAI(
base_url="https://api.menthiq.com/v1",
api_key="YOUR_MAITRE_KEY",
)
reply = client.chat.completions.create(
model="maitre-coder",
messages=[{"role": "user", "content": "Write a SQL query for monthly sales"}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.menthiq.com/v1",
apiKey: process.env.MAITRE_KEY,
});
const reply = await client.chat.completions.create({
model: "maitre-coder",
messages: [{ role: "user", content: "Write a SQL query for monthly sales" }],
});
console.log(reply.choices[0].message.content);curl https://api.menthiq.com/v1/chat/completions \
-H "Authorization: Bearer $MAITRE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "maitre-coder",
"messages": [{"role": "user", "content": "Write a SQL query for monthly sales"}]
}'