Reference
Client libraries
You can integrate today in any language. Here's the recommended approach per surface, plus what's on our roadmap.
Two surfaces, two approaches
| Surface | Recommended client |
|---|---|
Chat completions (/v1/chat/completions, /v1/models) |
Any OpenAI SDK — it's wire-compatible. Just set the base URL. |
| REST resources (consultations, batches, webhooks, automations, usage) | Plain HTTP, or a client generated from our OpenAPI spec. |
Chat: reuse the OpenAI SDKs
Because the chat surface is OpenAI-compatible, point an existing SDK at Niah:
python
from openai import OpenAI
client = OpenAI(base_url="https://api.niah.si/v1", api_key="nwk_live_...")
client.chat.completions.create(model="niah-1", messages=[{"role":"user","content":"Hi"}])javascript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.niah.si/v1", apiKey: process.env.NIAH_API_KEY });
await client.chat.completions.create({ model: "niah-1", messages: [{ role: "user", content: "Hi" }] });REST: the API is thin on purpose
The REST resources are ordinary JSON over HTTPS with bearer auth — no SDK is required. Here's the same "create a consultation" call in several languages.
cURL
bash
curl -X POST https://api.niah.si/v1/consultations \
-H "Authorization: Bearer $NIAH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Q3 planning","target_agent_count":5}'Python
python
import os, httpx
r = httpx.post(
"https://api.niah.si/v1/consultations",
headers={"Authorization": f"Bearer {os.environ['NIAH_API_KEY']}"},
json={"title": "Q3 planning", "target_agent_count": 5},
)
r.raise_for_status()
print(r.json()["data"]["id"])Ruby
ruby
require "net/http"; require "json"
uri = URI("https://api.niah.si/v1/consultations")
req = Net::HTTP::Post.new(uri, {
"Authorization" => "Bearer #{ENV['NIAH_API_KEY']}",
"Content-Type" => "application/json"
})
req.body = { title: "Q3 planning", target_agent_count: 5 }.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]["id"]Elixir
elixir
Req.post!("https://api.niah.si/v1/consultations",
auth: {:bearer, System.fetch_env!("NIAH_API_KEY")},
json: %{title: "Q3 planning", target_agent_count: 5}
).body["data"]["id"]Prefer a typed client? Generate one
Our OpenAPI spec is public and complete, so you can generate a fully typed client for your language in seconds and regenerate whenever the API changes.
bash
# Example: openapi-generator (supports python, ruby, go, java, typescript, …)
openapi-generator-cli generate \
-i https://api.niah.si/v1/openapi.json \
-g python \
-o ./niah-clientTools like OpenAPI Generator, Speakeasy, and Stainless all consume this spec.
Do we need official SDKs?
Our recommendation, and the plan:
- Chat: no dedicated SDK needed — OpenAI compatibility covers Python, Node, Go, Java, Ruby, .NET, and more for free.
- REST: ship official, spec-generated SDKs for the highest-demand languages once the API stabilizes. Python and TypeScript/Node first (largest audience), then Ruby, Go, and Elixir based on customer demand.
- Because the SDKs are generated from the OpenAPI spec, keeping the spec accurate (the current priority) is what makes first-class SDKs cheap to produce and keep in sync.
Want an SDK in a specific language sooner? Tell us at
niah.si/support — demand drives the order.
Previous← Webhooks
ReferenceAPI Reference →