Integrate advanced SQL generations and RAG (retrieval-augmented generation) into your application. See how to get started.
To integrate with our public API you need:
Retrieve AI generation using POST fetch request. URL:
https://api.sqlai.ai/api/public/v1
Depending on your application setup it can make sense to add a local endpoint on your server that forwards fetch requests to SQLAI.ai and adds authorization header. That way you ensure that the authorization header remains secret from users. Here is an example of adding this in ExpressJS:
//
// Forward fetch calls to SQLAI.ai and append the secret authorization header (stored as an environmental variable `process.env.SQLAI_SECRET`)
//
export default async function handler(req, res) {
const response = await fetch('https://api.sqlai.ai/api/public/v1', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
authorization: `Bearer ${process.env.SQLAI_SECRET}`,
},
body: JSON.stringify(req.body),
});
const json = await response.json();
return res.status(response.status).json(json);
}
You can add this API to a URL within your application, e.g. /api/ai
, and then use that URL to call SQLAI.ai's API. Now you are set to pick a AI generator and integrate it in your application.
We currently provided public access to two of our AI-powered generators:
If you have any questions regarding technical implementation, want to use other generators than those currently available or subscriptions, please reach out.