Account setup

To get started, create a Neosantara account here:

Create Free Account

You get 10,000 free Token Credits every day & 30,000 Token Credits every month. No credit card required.
After that, go to the “API keys” page and make a new API key by clicking “Generate new key”. Make sure to copy the API key, save it safely, and do not share it with anyone.

Your First API Call

The Neosantara API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the Neosantara API.
Neosantara AI doesn’t have the sdk yet. You can either use fetch or via openai!
PARAMVALUE
baseURLhttps://api.neosantara.xyz/v1
apiKey<Your Neosantara Apikey>

Invoke The Chat API Calls

This is a non-stream example, you can set the stream parameter to true to get stream response.
// Please install OpenAI SDK first: `npm install openai`

const OpenAI = require("openai"); // or import statement

const Nai = new OpenAI({
        baseURL: 'https://api.neosantara.xyz/v1',
        apiKey: '<NEOSANTARA API Key>'
});

async function main() {
  const completion = await Nai.chat.completions.create({
    messages: [{ role: "user", content: "what is neosantara ai?" }],
    model: "nusantara-base",
  });

  console.log(completion.choices[0].message.content);
}

main();