SDKs & LanguagesOfficial SDK
TypeScript & Node.js Quickstart
Integrate API100 into modern Node.js, Next.js, and TypeScript codebases using standard OpenAI client libraries.
Install the official OpenAI package via npm or yarn:
npm install openai
Initialize the client with baseURL and start making asynchronous or streaming calls.
Installbash
npm install openai
Usagetypescript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.apihundred.com/v1",
apiKey: process.env.API100_API_KEY,
});
async function main() {
const completion = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Explain React Server Components." }],
});
console.log(completion.choices[0].message.content);
}
main();
