unjailed ai
← All setup guides

Node.js · OpenAI SDK with Unjailed AI

Create a free account, add wallet credit when ready, then create a key in the API tab. The human should create the account, fund it and enter their own key.

  1. 01Install the SDK

    Use Node.js 20+ in your project.

    npm install openai
  2. 02Set your key locally

    Set UNJAILED_API_KEY in your local shell or secret manager. Do not put the key in browser JavaScript or commit it to Git.

  3. 03Send a Chat Completions request

    Save this as example.mjs and run node example.mjs.

    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: "https://unjailedai.com/v1",
      apiKey: process.env.UNJAILED_API_KEY,
    });
    const response = await client.chat.completions.create({
      model: "deepseek-v4.1-flash",
      messages: [{ role: "user", content: "Say hello in one sentence." }],
      max_tokens: 512,
    });
    console.log(response.choices[0].message.content);

Official reference: Node.js · OpenAI SDK documentation ↗. Setup checked October 13, 2026.

Use an exact ID from the model directory. Check live status if a model is unavailable. Uncensored models work through compatible API clients and the CLI; web chat uses standard models. Requests spend wallet credit at the published rates.

One key. Your existing workflow.

Create a free account — no email

No KYC at signup · No card details stored here · Wallet credit never expires · Top-ups don’t renew