Skip to content
// DEVELOPER DOCS · NEUROCORTEX v3

NeuroCortex API.
Drop-in OpenAI compatible.

REST API. Bearer auth. Same INR wallet as the Lab — every call debits credits at 2× Lab pricing (Hobby), 1.5× (Builder), 1.2× (Scale), 1.0× (Sovereign). Point your OpenAI SDK at our baseURL and ship.

// 01 · BASE URL & AUTH

One Bearer token. Three valid key formats.

Base URL: https://bharatneurotech.com/api/public/v1. Mint a key in /billing → API Keys. New tokens are issued as neurocortex_v3_live_…. Existing neurocortex_v2_live_… and nck_live_… keys continue to work. The full token is shown once; only its SHA-256 hash is stored.

Authorization: Bearer neurocortex_v3_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
// 02 · DROP-IN OPENAI SDK

Swap the baseURL — keep your code.

// Node — OpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({
  apiKey: process.env.NEUROCORTEX_KEY,
  baseURL: "https://bharatneurotech.com/api/public/v1",
});

const out = await client.chat.completions.create({
  model: "neurocortex-v3",
  messages: [{ role: "user", content: "Audit this AI policy clause: ..." }],
  max_tokens: 16384,                 // see §5 — model-card maximum
});
# Python — openai
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["NEUROCORTEX_KEY"],
    base_url="https://bharatneurotech.com/api/public/v1",
)
out = client.chat.completions.create(
    model="neurocortex-v3",
    messages=[{"role": "user", "content": "..."}],
    max_tokens=16384,
)
# curl — non-stream
curl -sS https://bharatneurotech.com/api/public/v1/chat/completions \
  -H "Authorization: Bearer $NEUROCORTEX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "neurocortex-v3",
    "messages": [{"role":"user","content":"One-line summary of ISO 42001."}],
    "max_tokens": 1024
  }'

# curl — streaming (SSE)
curl -N https://bharatneurotech.com/api/public/v1/chat/completions \
  -H "Authorization: Bearer $NEUROCORTEX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"neurocortex-v3","stream":true,"messages":[{"role":"user","content":"hi"}]}'

# curl — EQCortex (~580B, purpose-built for emotional intelligence)
# Accepts native `system` role. Upstream defaults: temperature=0.6, top_p=0.95, max_tokens up to 32768.
curl -sS https://bharatneurotech.com/api/public/v1/chat/completions \
  -H "Authorization: Bearer $NEUROCORTEX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "eqcortex",
    "messages": [
      {"role":"system","content":"You are a warm, empathetic writing partner."},
      {"role":"user","content":"Draft a gentle nudge email to a lapsed customer."}
    ]
  }'

# curl — health probe (no auth)
curl -sS https://bharatneurotech.com/api/public/v1/health
// 02b · MODELS

Two model aliases. Same OpenAI-compatible endpoint.

Model idBest forContextDefault max_tokens
neurocortexDefault. ~220B sparse Mixture-of-Experts (~15B active per token). Multimodal chat, decoding, vision, voice, docs. Best for real-time interaction and everyday audit chat.Infinite Context Window · up to 100 billion tokens/request (NeuroMemory — proprietary; 100B on paid API sync path, higher via async)16384
eqcortex~580B emotionally intelligent flagship. A model purpose-built for emotional intelligence — unprecedented emotional intelligence: empathy, tone, affect, human context. 800K-token native window.800K tokens (native) · Infinite via NeuroMemory (async, up to 100B tokens/request)32768
neurocortex-codemasterCode-tuned alias of NeuroCortex. Refactor, review, multi-file MVP scaffolds. India's rival to GPT Codex / Claude Code / Qwen Code / Jules.Infinite Context Window · up to 100 billion tokens/request (NeuroMemory — proprietary; 100B on paid API sync path, higher via async)16384
neurocortex-vision-physicalNeuroVision — physical-world reasoner for images and short mp4 clips. Space, time, causality, physics, next-step planning; returns 2D/3D points + bounding boxes.256K tokens (per request — frames must fit in-context)4096
neurocortex-v3Legacy alias for `neurocortex`. Retained for backwards compatibility.same as neurocortex16384

neurocortex-codemaster is the code-tuned alias of NeuroCortex — Bharat NeuroTech's rival to GPT Codex, Claude Code, Qwen Code and Google Jules. The server auto-injects a code-only system prompt (refactor / review / scaffold runnable multi-file MVPs), defaults max_tokens to the model-card maximum of 16384, and emits OpenAI-shape responses with model: "neurocortex-codemaster". Try it interactively at /codemaster.

// CodeMaster — scaffold a runnable MVP
const out = await client.chat.completions.create({
  model: "neurocortex-codemaster",
  messages: [{ role: "user", content: "Scaffold a Node + Express RAG chat that calls NeuroCortex." }],
  max_tokens: 16384, // CodeMaster default — model-card maximum output
});
// 03 · ENDPOINTS

All endpoints under /api/public/v1

MethodPathDescriptionCost
GET/v1/healthUnauthenticated liveness probe. Returns { ok, engine, version, ts }. Safe for uptime monitors.free
POST/v1/chat/completionsOpenAI-compatible Chat Completions. Streaming + non-streaming. Accepts model (neurocortex | eqcortex | neurocortex-codemaster | neurocortex-vision-physical | neurocortex-v3 [legacy]), messages, temperature, top_p, max_tokens, stream, stop, plus the NeuroCortex modes block. Vision-physical accepts image_url parts (https URL or data: base64).₹0.50 base (chat) · ₹2/image (vision-physical) · ×tier multiplier
GET/v1/modelsOpenAI-compatible model list. Returns neurocortex (default), eqcortex (~580B emotionally intelligent), neurocortex-codemaster, neurocortex-vision-physical, and the neurocortex-v3 legacy alias.free
GET/v1/neurocortex/modelsExtended model list with capability tags and default_max_tokens.free
POST/v1/neurocortex/scanVision · image understanding (URL or base64). Non-OpenAI; multimodal extension.₹3 · ×multiplier
POST/v1/neurocortex/listenAudio/video transcription + analysis per minute.₹3–4/min · ×multiplier
GET/v1/neurocortex/accountWallet balance + daily usage on this key.free
GET/v1/neurocortex/planTier + multiplier + daily cap on this key.free
POST/v1/neurocortex/chatDEPRECATED — alias of /v1/chat/completions with the legacy { engine, message } envelope. Sends a Deprecation header.same as /v1/chat/completions
// 04 · MODES (opt-in, default OFF for speed)

Three explicit toggles. Off by default.

Reasoning, agent tools and web search add latency. They are explicitly disabled on every API call unless you opt in. Set them via the OpenAI-safe extension field neurocortex on the chat body (OpenAI SDKs forward unknown JSON fields untouched):

{
  "model": "neurocortex-v3",
  "messages": [...],
  "max_tokens": 16384,
  "neurocortex": {
    "deep_thinking": false,   // engine called with thinking:false  (≈ 1.5–4× faster)
    "agent_mode":   false,    // tool_choice forced to "none"
    "web_access":   false     // web tool stripped from tool list
  }
}
deep_thinking:true → enables internal reasoning. +₹2/call. Latency +2–10s. Reasoning tokens are stripped server-side before delivery (streaming and non-streaming) — you only pay for what you see.
agent_mode:truepreview. Reserves tool-call capability. Currently accepted without error; full tool registry over the public API is rolling out to Builder+ tiers. +₹1/call when tools fire.
web_access:truepreview. Reserves the web-search tool. Same rollout status as agent_mode. +₹1/call.
// 05 · max_tokens — READ THIS

Default is the model-card maximum: 16384.

NeuroCortex is a reasoning-class engine. Setting max_tokens below 1024 is the number-one cause of empty responses — the engine spends its budget on internal reasoning and runs out before emitting the visible answer. The API now defaults to the engine's maximum supported output length so this is no longer a footgun.

  • Default if omitted: 16384 (model-card max).
  • Minimum accepted: 256 (anything lower → 400 invalid_request).
  • Maximum accepted: 16384 (engine cap; requests above are clamped).
  • If the engine returns empty content with finish_reason:"length" the API auto-refunds and returns 502 empty_response_increase_max_tokens.
// 06 · STREAMING

OpenAI-shape SSE with reasoning stripped.

Set stream: true. Response is text/event-stream with data: {…} chunks of object:"chat.completion.chunk" and a terminating data: [DONE]. Cost is debited up-front. If the stream ends with zero visible content deltas, the debit is auto-refunded (upstream failures, empty completions). Reasoning-only frames are suppressed; you never see reasoning_content or <think>…</think> blocks in the output.

// 06b · CODEMASTER OVER THE API

Multi-file MVP scaffolds via the standard endpoint.

Send model: "neurocortex-codemaster" to /v1/chat/completions. The server auto-injects the CodeMaster system prompt (refactor / review / scaffold runnable multi-file MVPs) and defaults max_tokens to 16384. Every API response is a single OpenAI-shape chat completion — the interactive multi-file Artifact Build Loop (planner + per-file executor + workspace preview) is currently exposed at /codemaster only. Public-API build-loop support ships next; it will bill each planner and per-file call at ₹0.50 (before tier multiplier) alongside the base completion.

// 06c · finish_reason & headers

What terminates a response, and how to trace it.

  • stop — model reached a natural stop or a stop sequence.
  • length — hit max_tokens. Increase max_tokens and retry.
  • tool_calls — model emitted a tool call (only when agent_mode is on and tools are attached).
  • content_filter — output was blocked by safety filters.

Every response carries an X-Request-Id header. Include it in support requests to trace a specific call. Legacy /v1/neurocortex/chat additionally returns a Deprecation header — migrate to /v1/chat/completions.

// 07 · PRICING & WALLET

Same wallet as the Lab. Tier multipliers apply.

  • Hobby — 2× Lab price, ₹5,000/day cap (default).
  • Builder — 1.5×, ₹50,000/day cap.
  • Scale — 1.2×, ₹2,50,000/day cap.
  • Sovereign — 1.0× (no markup), ₹10,00,000/day cap.

Wallet balance is checked before the upstream call. Low balance returns 402 instantly — no time wasted on a doomed model round-trip. Failed handlers auto-refund. Hard daily caps are atomic at the database.

// 08 · ERRORS

Standard JSON envelope.

{ "error": { "code": "insufficient_credits", "message": "Wallet has insufficient credits" },
  "engine": "neurocortex" }
400 invalid_request — bad body, e.g. max_tokens < 256
401 missing_authorization · invalid_api_key · api_key_revoked · invalid_key_format
402 insufficient_credits — top up at /billing
403 ip_not_allowed
429 daily_cap_exceeded — resets at 00:00 UTC
502 empty_response_increase_max_tokens · empty_response
503 engine_unavailable
500 internal_error · debit_failed
// 09 · WEBHOOKS

Real-time usage + 402 events.

Set webhook_url on a key (Builder+ tier) to receive usage.debit and 402.insufficient_credits events. Payloads are HMAC-signed; verify the X-NeuroCortex-Signature header.