N1NA API · Docs

Build with N1NA.

One key, one endpoint, the OpenAI format your code already speaks. Chat, streaming, tools, pictures, voice, hearing and private web search.

Get your API keyQuickstartAsk her live

Quickstart

Already using an OpenAI SDK? Change the base URL and the key. That's the whole migration.

// npm i openai
import OpenAI from "openai";

const n1na = new OpenAI({
  apiKey: process.env.N1NA_KEY,
  baseURL: "https://api.n1na.ai/v1",
});

const reply = await n1na.chat.completions.create({
  model: "n1na-chat",
  messages: [{ role: "user", content: "Plan my week around three client meetings." }],
});
console.log(reply.choices[0].message.content);

Keys and the endpoint

Base URL: https://api.n1na.ai/v1

Key: send it as Authorization: Bearer n1na_…. Get yours in a minute in the N1NA Console: sign in with your email, and your first key and $1 of N1NA are there right away. You can make more keys, see your usage and add funds there too.

Keep your key on your server. Never put it in a website's code or a phone app, where anyone could read it. Call N1NA from your backend and pass the answer on.

Models

Model idWhat it isStatus
n1na-chatN1NA PRO Extreme 1.0. Everyday N1NA: assistant, friend, business manager, coding help, in 25 languages. Reads pictures. Fast.Live
n1na-proN1NA Pro brain. The big brain for coding, apps and hard reasoning.Coming soon

GET /models lists the models your key may use. Until the Pro brain is switched on, calling it returns 503 not_live_yet, so you can fall back to n1na-chat.

Each app also gets a focus, set with us when your key is made: assistant, companion, business, coding, real estate, music, creative, money, agents or talent. N1NA adds the matching know-how to every answer, so your own system prompt stays short.

Chat and streaming

POST /chat/completions takes the usual model, messages, temperature, max_tokens, tools and response_format. Add "stream": true for server-sent events, chunk by chunk, exactly like OpenAI.

const stream = await n1na.chat.completions.create({
  model: "n1na-chat",
  stream: true,
  messages: [{ role: "user", content: "Write a two-line welcome for new members." }],
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

N1NA doesn't remember earlier calls. Send the conversation so far in messages; your app decides what to store.

Tools and web search

Give N1NA your own functions with tools. She answers with tool_calls; you run them and send the results back as role: "tool" messages, the standard OpenAI loop.

tools: [{ type: "function", function: {
  name: "get_weather", description: "Weather for a city",
  parameters: { type: "object", properties: { city: { type: "string" } }, required: ["city"] },
} }]
// -> tool_calls: [{ function: { name: "get_weather", arguments: '{"city":"Dubai"}' } }]

Private web search

GET /search?q=…&n=5 returns {results: [{title, url, snippet}]} (up to 8). Wire it into a web_search tool so N1NA can look things up. Searches run on N1NA's own servers, without ad tracking.

Pictures

N1NA reads pictures: screenshots, receipts, contracts, floor plans, posters. Send them inside a message as an image_url with a data URL.

messages: [{ role: "user", content: [
  { type: "text", text: "What does this invoice ask me to pay, and by when?" },
  { type: "image_url", image_url: { url: "data:image/png;base64,iVBORw0…" } },
] }]

Send pictures as data URLs, not web links.

Voice and hearing

Voice · POST /speak

Send {"text": "…", "lang": "en"}. You get {audio, sr, seconds, visemes}: a WAV file as base64 and mouth shapes, if you animate a face.

Hearing · POST /hear

Send {"audio": "<base64 or data URL>", "lang": "en"}, up to 25 MB, with lang optional. You get {text, language, seconds}. Voice notes, calls and interviews all work.

curl https://api.n1na.ai/v1/hear -H "Authorization: Bearer $N1NA_KEY" -H "Content-Type: application/json" \
  -d '{"audio": "UklGRi…"}'
# -> {"text": "Hello, I am Nina.", "language": "en", "seconds": 1.14}

Nothing you send to voice or hearing is kept.

People in your app

Send X-N1NA-User: <your id for the person> with each request. Any stable id works, never an email or a phone number. It keeps each person's limits and privacy choices apart.

Apps that let N1NA bill their users get one free 7-day trial per person and N1NA plans with credits, checked on every request. When someone needs to act, N1NA answers with a plain code your app can show: 402 trial_available means "start your free trial", and 402 plan_required means "choose a plan". Tell us which way you'd like to bill when you ask for access.

Pricing

WhatPrice
n1na-chat$0.50 per million input tokens · $2.00 per million output tokens
n1na-pro Soon$2.00 per million input tokens · $8.00 per million output tokens
Voice, hearing, web searchIncluded

Each answer reports its token count in usage. Tell us a monthly budget for your app and we'll set it: when it's reached, calls stop with 402 budget_reached instead of running up a bill. If N1NA fails to answer, nothing is charged.

Limits

  • 120 requests a minute per app to start; ask us when you need more.
  • 25 MB of audio per hearing request.
  • Your monthly budget, when one is set.
  • Is N1NA up right now, and how fast is she answering? status.n1na.ai, checked every 5 minutes.

Errors

Every error is JSON in one shape: {"error": {"code": "…", "message": "…"}}. The message is written for people, so you can show it as it is.

StatusCodeWhat to do
400bad_request · no_userFix the request: messages missing, or X-N1NA-User needed.
401no_key · bad_keySend a valid key as Authorization: Bearer n1na_….
402budget_reached · trial_available · plan_required · insufficient_creditsRaise your budget, or show the person the trial or plan step.
403model_not_allowedUse a model your key allows (GET /models).
404no_model · not_foundCheck the model id and the path.
413too_bigSend at most 25 MB of audio.
429rate_limited · daily_limitWait and retry with backoff.
502 · 503brain_error · brain_unreachable · not_live_yetRetry shortly. Nothing was charged. Live status: status.n1na.ai

Privacy and learning

  • Off by default for developer apps. Your app's chats help N1NA learn only if you choose to switch that on.
  • Per request: X-N1NA-Learn: off means that request is never used for learning.
  • Private context: a system message that starts with #private is used for that answer only and is never kept. Put a person's own details there.
  • Emails, phone numbers and account numbers are removed before anything is kept. Health talk is never kept.

The rest is in our privacy policy and terms.

Questions

Is the N1NA API compatible with OpenAI libraries?

Yes. Point the official OpenAI SDK for JavaScript or Python at the N1NA base URL and use your N1NA key. Chat, streaming, tool calls and pictures work as they are.

How much does the N1NA API cost?

N1NA Chat costs $0.50 per million input tokens and $2 per million output tokens. Voice, hearing and web search are included.

Does N1NA train on my app's conversations?

Not unless you choose to help. Developer apps are off by default, every request can say no with the X-N1NA-Learn: off header, and health talk is never kept.

How do I get a key?

Sign in to the N1NA Console at n1na.ai/console with your email. Your first key and $1 of N1NA to build with are there right away.

Put a mind inside your app.

Get your API keyAsk her live