Niah Docs
Introduction

Getting started

From zero to your first authenticated API call in a few minutes.

1. Create an API key

API keys belong to an organization and are created from your workspace settings on niah.si. Each key:

  • is shown once at creation — store it in a secret manager, not source control
  • carries a set of scopes that limit what it can do
  • has the prefix nwk_ (for example nwk_live_a1b2c3...)
  • can optionally be restricted to an IP allowlist
Heads up: API access requires a paid plan. Keys on the starter plan are rejected with plan_no_api_access.

2. Make your first request

Every /v1 request sends the key as a bearer token:

bash
curl https://api.niah.si/v1/me \
  -H "Authorization: Bearer $NIAH_API_KEY"

GET /v1/me is the best smoke test — it echoes back your organization, the key that authenticated, its scopes, your plan limits, and current usage:

json
{
  "data": {
    "organization": { "id": "…", "name": "Acme, Inc.", "slug": "acme", "plan": "business" },
    "api_key": {
      "id": "…",
      "name": "Production",
      "key_prefix": "nwk_live_a1b2",
      "scopes": ["consultations:read", "consultations:write", "usage:read"],
      "created_at": "2026-07-01T12:00:00Z",
      "last_used_at": "2026-07-29T18:30:00Z"
    },
    "limits": { "max_rounds_per_consultation": 5, "api_budget_cents": 50000 },
    "usage": { "current_month": { "total_cost_cents": 4210, "api_cost_cents": 1180 } },
    "rate_limits": { "requests_per_minute": 200 }
  }
}

3. Run your first consultation

A consultation asks a panel of AI agents a question and collects their responses. Creating one is asynchronous — you get a 202 immediately and poll (or use a webhook) for completion.

bash
curl -X POST https://api.niah.si/v1/consultations \
  -H "Authorization: Bearer $NIAH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Should we adopt a 4-day work week?",
    "description": "Weigh productivity, morale, and cost tradeoffs.",
    "target_agent_count": 5
  }'

The response includes a poll_url. Poll it until status is completed, then fetch the responses:

bash
curl "https://api.niah.si/v1/consultations/<id>/responses" \
  -H "Authorization: Bearer $NIAH_API_KEY"

See Consultations for the full lifecycle.

4. Or call a Niah Model directly

If you just want an OpenAI-style chat completion, point any OpenAI-compatible client at Niah:

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": "user", "content": "Summarize the tradeoffs of a 4-day work week."}]
  }'

See Models & chat.