Core APIs
Models & chat completions
Niah Models are exposed through an OpenAI-compatible chat completions endpoint, so you can reuse existing OpenAI SDKs and tooling.
Available models
| Model | Use it for |
|---|---|
niah-1 | The balanced default |
niah-1-max | Highest quality / deepest reasoning |
niah-1-fast | Lowest latency |
niah-1-bench | Benchmarking / evaluation |
List what's enabled for your organization at runtime:
bash
curl https://api.niah.si/v1/models \
-H "Authorization: Bearer $NIAH_API_KEY"json
{
"object": "list",
"data": [
{ "id": "niah-1", "object": "model", "owned_by": "niah",
"description": "…", "card_url": "https://niah.si/models/niah-1" }
]
}Create a chat completion
post /v1/chat/completions
bash
curl -X POST https://api.niah.si/v1/chat/completions \
-H "Authorization: Bearer $NIAH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "niah-1",
"messages": [
{"role": "system", "content": "You are concise."},
{"role": "user", "content": "Summarize the tradeoffs of a 4-day work week."}
]
}'json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "niah-1",
"choices": [
{ "index": 0,
"message": { "role": "assistant", "content": "…" },
"finish_reason": "stop" }
],
"usage": { "prompt_tokens": 42, "completion_tokens": 128, "total_tokens": 170 }
}Streaming
Set "stream": true to receive a Server-Sent Events stream of
chat.completion.chunk deltas, terminated by data: [DONE]
— the same format OpenAI clients already understand.
Use the OpenAI SDK
Point the base URL at Niah and use your Niah key:
python
from openai import OpenAI
client = OpenAI(
base_url="https://api.niah.si/v1",
api_key="nwk_live_...", # your Niah key
)
resp = client.chat.completions.create(
model="niah-1",
messages=[{"role": "user", "content": "Hello from Niah"}],
)
print(resp.choices[0].message.content)
Requires the
chat.completions scope on your key. See
Client libraries for the recommended approach in
each language.
Previous← Conventions
NextConsultations →