Skip to main content
This guide will help you make your first API call to Neosantara AI. Our API is designed to be fully compatible with the OpenAI SDK, making it easy to integrate into your existing workflows.
1

Create an Account

2

Generate an API Key

Go to your Dashboard and navigate to the API Keys section. Click “Create New Key” and save it securely.
Do not share your API key with anyone or commit it to public repositories.
3

Install Dependencies

Since Neosantara is OpenAI-compatible, you can use the official OpenAI SDKs.
npm install openai
Or use in the Claude Code see Anthropic compatible
4

Make Your First Request

Copy the code below to test your connection. Replace <YOUR_API_KEY> with the key you generated.
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.neosantara.xyz/v1",
  apiKey: "<YOUR_API_KEY>", // process.env.NAI_API_KEY
});

async function main() {
  const completion = await client.chat.completions.create({
    model: "nusantara-base",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Hello! Who are you?" },
    ],
  });

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

main();

Next Steps

Now that you’ve made your first request, explore what else you can build:
Last modified on December 7, 2025