client sdks/Official SDKsPrimary
TypeScript & Node.js SDK
Full type safety with the standard openai npm package.
Installation
npm install openaiClient Configuration
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://unlockedai.net/v1",
apiKey: process.env.UNLOCKED_API_KEY,
});
async function run() {
const completion = await client.chat.completions.create({
model: "claude-sonnet-5.5",
messages: [
{ role: "system", content: "You are an expert full-stack TypeScript engineer." },
{ role: "user", content: "Write a high-performance LRU cache implementation." }
],
});
console.log(completion.choices[0].message.content);
}
run();Need an Unlocked AI Key or Credits?
Generate secret API keys backed by non-expiring pay-as-you-go credits starting at $5. No monthly minimums.