/chat/completions endpoint. Point any
OpenAI SDK at NinjaChat by setting two things:
- Base URL:
https://www.ninjachat.ai/api/v1 - API key: your
nj_sk_...key
What works
- Any model — pass any model ID, or
autoto let NinjaChat pick. - Streaming — set
stream: truefor token-by-token server-sent events. - Tool calling — standard
tools/tool_choicewithfunction.parameters. - Sampling —
temperature,top_p,max_tokens(ormax_completion_tokens),stop,seed,frequency_penalty,presence_penalty.
Both
/api/v1/chat/completions (OpenAI-style) and /api/v1/chat (native)
accept the same request and return the same response. Use whichever your tooling expects.NinjaChat extras
The native/chat endpoint adds optional features OpenAI doesn’t have —
smart routing, fallback chains,
budget routing, sessions, and per-response cost
and balance. They’re ignored by the OpenAI SDK, so you can adopt them gradually.