EnglishAPI PlatformOpenAI-compatible

Nulu API documentation

Integrate your applications with OpenAI-compatible endpoints using Nulu models.

This whole documentation as a single prompt. Paste it into your coding agent and it will know how to use Nulu API. View as text

Start
Base URL and core concepts.
Base URL
https://api.nuluai.com/v1
Auth
Bearer sk_wat_...
Model
nulu-5-ultra
Nulu Code (CLI)
The Nulu AI coding agent for your terminal. Install it step by step: eight short steps, about ten minutes, no coding knowledge needed.

What you need

  • A computer with Windows, macOS or Linux and an internet connection.
  • Node.js 18 or later. If you do not have it, step 3 installs it.
  • A Nulu AI account with balance: the same account as on this platform.

Step-by-step installation

Copy each command, paste it into the terminal and press Enter.

  1. 1. Open the terminal

    The terminal is the window where commands are typed. Windows: press the Windows key, type PowerShell and press Enter. macOS: press Cmd + Space, type Terminal and press Enter. Linux: press Ctrl + Alt + T.

  2. 2. Check whether you already have Node.js

    Paste this command and press Enter:

    node --version

    If it answers v18 or a higher number (for example v22.11.0), jump to step 4. If it answers with an error or a lower number, continue with step 3.

  3. 3. Install Node.js

    Node.js comes with npm, the program that installs Nulu Code. Use the command for your system; when it finishes, close the terminal and open it again. If you prefer an installer with windows, download the LTS version from nodejs.org.

    Windows (PowerShell)
    winget install OpenJS.NodeJS.LTS
    macOS and Linux (terminal)
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
    # close the terminal, open it again and paste:
    nvm install --lts
    Check: both must answer with a number
    node --version
    npm --version
  4. 4. Install Nulu Code

    Paste the first line; it takes about a minute. The second one checks that it is installed: it must answer with a version number.

    npm install -g nulu-code
    nulu --version

    Lines that start with “npm warn” or “npm notice” are notices, not errors. If the second line answers with a version number, the installation worked and you can continue.

  5. 5. Have your Nulu AI account ready

    It is the same account as on this platform. If you do not have one, sign up, confirm your email and add balance: Nulu Code works with that balance.

  6. 6. Open Nulu Code in your project folder

    Nulu Code works inside the folder where you open it. To start a new project, paste these three commands, one at a time:

    mkdir my-project
    cd my-project
    nulu

    Already have a project? Type cd followed by the path of its folder, then nulu.

  7. 7. Sign in

    The first time, Nulu Code shows a link. Open it in your browser, sign in to this platform and press Authorize. The page shows a one-time code that works for 10 minutes: copy it, paste it into the terminal and press Enter. You do not need to create or copy an API key. Do not share that code with anyone; Nulu AI will never ask you for it.

  8. 8. Ask for your first task

    Type what you want in your own words and press Enter. For example:

    Create a simple website for my business with a contact form

    Before changing files or running commands, Nulu Code asks for your permission. Read each action and accept it if you agree.

Done. Next time you only need to open the terminal, go to your project folder and type nulu. Usage is charged to your Nulu AI balance; there is no separate account or subscription. You can see and revoke connected terminals in the dashboard, under Connected devices.

All the commands

In the terminal
nulu              # opens Nulu Code in the current folder
nulu --continue   # continues your last conversation
nulu run "..."    # sends a single instruction and prints the answer
nulu login        # signs in or switches account
nulu logout       # signs out on this computer
nulu models       # models available in your account
nulu usage        # usage and estimated cost
nulu doctor       # checks everything and says what to fix
nulu update       # installs the latest version
nulu --version    # installed version
nulu --help       # help with every option
npm uninstall -g nulu-code   # uninstalls Nulu Code
Inside Nulu Code (typed in the message box; with the interface in Spanish they also have Spanish names)
/help          # lists every command and key
/models        # switches model
/new           # starts a new conversation
/resume        # goes back to an earlier conversation
/undo          # undoes your last message
/copy          # copies the last answer or the whole conversation
/usage         # balance, money spent and tokens used
/permissions   # approve each action, or let the agent work on its own
/language      # switches between Spanish and English
/update        # installs the latest version without leaving

If something fails

Find the message you got and follow the fix.

“node” or “npm” is not recognized as a command

Node.js is not installed, or the terminal was opened before installing it. Close the terminal, open it again and try this command. If it still fails, repeat step 3.

node --version
Windows: “winget” is not recognized as a command

Your Windows does not include winget. Download the Node.js installer (LTS version) from nodejs.org, install it with the default options and open PowerShell again.

Windows: “running scripts is disabled on this system”

PowerShell is blocking npm. Paste this command, answer Y (yes) and repeat the command that failed.

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
macOS or Linux: permission error (EACCES) while installing

It happens when Node.js was installed for the whole system. The best fix is to install Node.js as step 3 says and repeat step 4. The quick alternative is this command.

sudo npm install -g nulu-code
“nulu” is not recognized as a command after installing

Close the terminal and open it again. If nothing changes, install again and check that it does not end with an error.

npm install -g nulu-code
While installing you see “npm warn install-scripts … not yet covered by allowScripts”

It is a notice, not an error: recent npm versions do not run the last step of the installation and report it this way. Nulu Code finishes that step by itself the first time you open it. Paste the first line: if it answers with a version number, everything is fine and you can continue with step 5. Only if it answers “install script did not run” (it happens on Windows), install again with the second line.

nulu --version
npm install -g --allow-scripts=nulu-code nulu-code
While installing you see other “npm warn” or “npm notice” lines

They are notices from npm (for example, that a new npm version exists) and they do not stop the installation. A real error starts with “npm error”. Check that Nulu Code is installed with this command: it must answer with a version number.

nulu --version
nulu answers “install script did not run”

Your npm version blocked one step of the installation (npm 12 and later do so by default). Install with this command.

npm install -g --allow-scripts=nulu-code nulu-code
The Node.js version is lower than 18

Install the current version: on macOS and Linux with the first line, on Windows with the second.

nvm install --lts
winget install OpenJS.NodeJS.LTS
The sign-in code is refused or expired

The code works for 10 minutes and only once. Ask for a new one and paste it into the same terminal that showed the link.

nulu login
The sign-in link does not open by itself

Select the whole link in the terminal, copy it and paste it into your browser's address bar.

It says you have no balance

Add balance in this platform's dashboard and try again. Inside Nulu Code, /usage shows your balance.

Something else does not work

The first line checks everything and tells you what to fix. To start from scratch, uninstall with the second one and repeat step 4. If you write to support, include your operating system and what nulu --version answers; never send your sign-in code or your API key.

nulu doctor
npm uninstall -g nulu-code

More about Nulu Code

OpenAI compatibility
Endpoints designed for OpenAI-compatible clients.
The gateway exposes OpenAI-compatible endpoints for model listing and chat completions. You can use it as a custom provider in SDKs and tools like opencode with `baseURL: https://api.nuluai.com/v1`.
Public model IDs are lowercase and case-sensitive. Use exactly `nulu-5-pro`, `nulu-5-ultra`, `nulu-image-1.5`, `nulu-image-3` in OpenAI-compatible clients, opencode, and external apps.
EndpointStatusNotes
GET /v1/modelsSupportedReturns the IDs of the available models.
POST /v1/chat/completionsSupportedOpenAI chat completions compatible format.
POST /v1/images/generationsSupportedImage generation with `nulu-image-3` (JSON).
POST /v1/images/editsSupportedEditing/variations via `multipart/form-data` with image + prompt.
stream: trueSupportedReturns the response as SSE events.
Authentication
Every request requires a Nulu API key.
Authorization: Bearer sk_wat_your_key
Create keys in the `API Key` dashboard section. Full secrets are shown once and then stored hashed.
Models
List of public models available to your users.
curl https://api.nuluai.com/v1/models \
  -H "Authorization: Bearer sk_wat_your_key"
Copy IDs exactly as shown here.
Public IDNameCapabilitiesThinking
nulu-5-proNulu 5 ProChat, toolsOptional
nulu-5-ultraNulu 5 UltraChat, tools, vision, advanced reasoningOptional
nulu-image-1.5Nulu Image 1.5 (Legacy)Image generation and editingUnavailable
nulu-image-3Nulu Image 3Image generation and editingUnavailable
Chat completions
Send messages and receive model responses.
cURL
curl https://api.nuluai.com/v1/chat/completions \
  -H "Authorization: Bearer sk_wat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nulu-5-ultra",
    "messages": [
      {"role": "system", "content": "Answer helpfully and concisely."},
      {"role": "user", "content": "Explain what a managed AI API is."}
    ],
    "temperature": 0.7,
    "max_tokens": 500
  }'
OpenAI SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk_wat_your_key",
  baseURL: "https://api.nuluai.com/v1"
});

const response = await client.chat.completions.create({
  model: "nulu-5-ultra",
  messages: [{ role: "user", content: "Say hello in English" }]
});
The `model` field must be a Nulu model ID.
Vision: Nulu 5 Ultra accepts images (JPEG, PNG, GIF, WebP; billed as input tokens). It also supports tools and configurable reasoning with `low`, `medium`, `high`, and `max`.
Images
Generate and edit images with Nulu Image 3.
Use the public ID `nulu-image-3`. Do not send other model names.
Generation: `POST /v1/images/generations` with JSON (`model`, `prompt`, `size`, `quality`, `n`). Editing: `POST /v1/images/edits` with `multipart/form-data` (`image`, `prompt`, optional `mask`). Responses follow the OpenAI format: `data[].url` or `data[].b64_json`.
Nulu Image 3 per-image price (generate or edit): $0.035294–$0.066178. A flat per-image price, independent of size and quality.
Nulu Image 1.5 (legacy) is billed from measured tokens, roughly $0.012291–$0.05865 per image depending on size and quality.
Nulu Image 1.5 token rates
SizeQualityGenerateEdit
1024×1024Medium$0.012371$0.012371
1024×1024Low$0.040562$0.040562
1024×1024High$0.04065$0.04065
1536×1024Low$0.058536$0.058536
1536×1024Medium$0.05865$0.05865
1536×1024High$0.012291$0.012291
2048×2048Low$0.04065$0.04065
2048×2048Medium$0.04065$0.04065
2048×2048High$0.04065$0.04065
Generate image
curl https://api.nuluai.com/v1/images/generations \
  -H "Authorization: Bearer sk_wat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nulu-image-3",
    "prompt": "Modern wooden chair in a bright studio",
    "size": "1024x1024",
    "quality": "medium",
    "n": 1
  }'
Edit image
curl https://api.nuluai.com/v1/images/edits \
  -H "Authorization: Bearer sk_wat_your_key" \
  -F "model=nulu-image-3" \
  -F "prompt=Same chair in vivid red" \
  -F "[email protected]" \
  -F "size=1024x1024"
OpenAI SDK
import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({
  apiKey: "sk_wat_your_key",
  baseURL: "https://api.nuluai.com/v1"
});

// Generate
const generated = await client.images.generate({
  model: "nulu-image-3",
  prompt: "Minimal kitchen product on a white background",
  size: "1024x1024"
});

// Edit (multipart)
const edited = await client.images.edit({
  model: "nulu-image-3",
  image: fs.createReadStream("product-photo.png"),
  prompt: "Same scene with a red finish"
});
FieldGenerationEditing
modelYes — `nulu-image-3`Yes — `nulu-image-3`
promptYesYes
imageNoYes — PNG/JPEG/WebP file
maskNoOptional — transparent PNG
sizeOptionalOptional
qualityOptional (`low`, `medium`, `high`)Optional
nOptional (1–10)Optional (1–10)
Thinking
Thinking is an option the user enables per request.
By default Nulu API sends `thinking: { type: "disabled" }` so users control when they pay for reasoning. To enable it, send `reasoning_effort: "low"`, `"medium"`, `"high"`, or `"max"`; the level also turns thinking on automatically. You can also send `thinking: { type: "enabled" }` without a level to use the provider default.
Thinking uses the same per-token rates as the model. There is no separate multiplier, but it can cost more because `reasoning_content` increases billed output tokens.
Enable thinking
const response = await client.chat.completions.create({
  model: "nulu-5-ultra",
  messages: [{ role: "user", content: "Solve this problem step by step" }],
  reasoning_effort: "high", // "low" | "medium" | "high" | "max"
  extra_body: {
    thinking: { type: "enabled" }
  }
});
Disable thinking
const response = await client.chat.completions.create({
  model: "nulu-5-ultra",
  messages: [{ role: "user", content: "Answer directly" }],
  extra_body: {
    thinking: { type: "disabled" }
  }
});
JSON mode
Structured output as valid JSON.
Send `response_format: { type: "json_object" }`, include the word JSON in the prompt, and provide an example of the expected format. Set enough `max_tokens` to avoid truncation.
const response = await client.chat.completions.create({
  model: "nulu-5-ultra",
  response_format: { type: "json_object" },
  messages: [
    { role: "system", content: "Return valid JSON only." },
    { role: "user", content: "Return a json object with question and answer." }
  ]
});
Tool calls
Allows the model to request external functions defined by your app.
The model does not execute functions. It returns `tool_calls`; your app runs the function, appends a `role: "tool"` message with `tool_call_id`, then calls the model again.
In thinking mode with tool calls, preserve and send back the assistant message `reasoning_content` in later turns to avoid errors.
const response = await client.chat.completions.create({
  model: "nulu-5-ultra",
  messages: [{ role: "user", content: "What is the weather in Caracas?" }],
  tools: [{
    type: "function",
    function: {
      name: "get_weather",
      description: "Get weather for a location",
      parameters: {
        type: "object",
        properties: { location: { type: "string" } },
        required: ["location"]
      }
    }
  }]
});
Multi-round chat
The API is stateless: send the full conversation history each time.
Append the previous assistant response to `messages`, then append the new user message and make another call.
const messages = [
  { role: "user", content: "What is the highest mountain?" }
];

const first = await client.chat.completions.create({ model: "nulu-5-ultra", messages });
messages.push(first.choices[0].message);
messages.push({ role: "user", content: "What is the second?" });

const second = await client.chat.completions.create({ model: "nulu-5-ultra", messages });
Context cache
Context caching is enabled by default.
No code changes are required. If a request reuses a persisted prefix, part of the input can count as a cache hit and is charged at the cached-input rate.
The `usage` response includes `prompt_tokens_details.cached_tokens`; Nulu API uses those tokens to apply cached-input pricing.
Supported parameters
Fields compatible with the chat completions API.
FieldRequiredDescription
modelYesPublic model ID.
messagesYesMessages with `role` and `content`.
temperatureNoControls randomness. Typical range: 0 to 2.
top_pNoNucleus sampling. Use this or temperature for simple control.
max_tokensNoMaximum generated token limit.
streamNoIf `true`, returns OpenAI-compatible SSE events.
thinkingNoUse `{ type: "enabled" }` to enable reasoning per request; disabled by default.
reasoning_effortNoAccepts `low`, `medium`, `high`, or `max`. Sending it turns thinking on automatically.
response_formatNoUse `{ type: "json_object" }` for JSON mode.
tools/tool_choiceNoTool calling when the model supports it.
Usage, tokens, and storage
How usage is measured and what is stored.
Nulu API reports the tokens used in every response.
Billing
Prepaid balance, pricing, and deductions.
Chat models deduct balance by tokens (input, cached input, and output). Nulu Image 1.5 deducts per image based on size and quality; generation and editing use the same rate.
Nulu 5 Ultra pricing (per 1M tokens)
TypeOff-peakPeak
Input — cache miss$0.45$0.90
Input — cache hit$0.009$0.018
Output$1.80$3.60
Nulu 5 Pro pricing (per 1M tokens)
TypeOff-peakPeak
Input — cache miss$1.98$3.96
Input — cache hit$0.066$0.132
Output$5.94$11.88
Peak hours are Monday–Friday, 01:00–04:00 and 06:00–10:00 UTC. Weekends, Chinese public holidays and all other hours are off-peak. During peak hours the per-token rate doubles (2×). Applies to Nulu 5 Ultra and Nulu 5 Pro.
Billing example (Nulu 5 Ultra)

A request with 1M uncached input tokens + 1M output tokens costs $0.45 + $1.80 = $2.25 off-peak, and $0.90 + $3.60 = $4.50 during peak.

If those 1M input tokens were already cached: $0.009 + $1.80 = $1.809 off-peak, and $0.018 + $3.60 = $3.618 during peak.

Errors
Main status codes the API can return.
CodeMeaning
400Invalid JSON, unsupported streaming, or invalid parameters.
401Invalid or revoked API key.
402Insufficient balance. A minimum of $0.50 is required to use the API.
404Public model unavailable.
502The model request failed.
opencode custom provider
Example configuration as an OpenAI-compatible provider.
{
  "provider": {
    "world-app-technologies-api": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Nulu API",
      "options": {
        "baseURL": "https://api.nuluai.com/v1",
        "apiKey": "sk_wat_your_key"
      },
      "models": {
        "nulu-5-pro": {
          "name": "Nulu 5 Pro",
          "reasoning": true,
          "tool_call": true,
          "interleaved": { "field": "reasoning_content" },
          "limit": { "context": 1000000, "output": 384000 },
          "variants": {
            "low": { "reasoningEffort": "low" },
            "medium": { "reasoningEffort": "medium" },
            "high": { "reasoningEffort": "high" },
            "max": { "reasoningEffort": "max" }
          }
        },
        "nulu-5-ultra": {
          "name": "Nulu 5 Ultra",
          "reasoning": true,
          "tool_call": true,
          "interleaved": { "field": "reasoning_content" },
          "limit": { "context": 1000000, "output": 384000 },
          "variants": {
            "low": { "reasoningEffort": "low" },
            "medium": { "reasoningEffort": "medium" },
            "high": { "reasoningEffort": "high" },
            "max": { "reasoningEffort": "max" }
          }
        },
        "nulu-image-1.5": {
          "name": "Nulu Image 1.5 (Legacy)"
        },
        "nulu-image-3": {
          "name": "Nulu Image 3"
        }
      }
    }
  }
}
After creating a key, point `baseURL` to `https://api.nuluai.com/v1`. The model must be one of the public IDs listed above. Reasoning models include `low`, `medium`, `high`, and `max` variants: pick them in the model selector or cycle through them with the `variant_cycle` keybind.