N Northline API Reference
API Reference

Short surface. Stable shape.

Northline API exposes a compact integration contract for internal applications: token auth, routed inference requests, model listing, and consistent streaming behavior.

Authentication

Send a bearer token with every request. Console credentials and API tokens are managed separately.

Authorization: Bearer nl_live_xxxxxxxxxxxxx

Base paths

Path Purpose
/v1/models List models available to the active token.
/v1/chat/completions Chat-style requests with optional streaming.
/v1/usage Token and request metrics for the current key.

Example request

Use the same request envelope regardless of the upstream route selected by policy.

POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer nl_live_xxxxxxxxxxxxx

{
  "model": "gemini-2.5-flash",
  "stream": false,
  "messages": [
    {"role": "system", "content": "You are an internal operations assistant."},
    {"role": "user", "content": "Draft a release note for the latest deployment."}
  ]
}

Response model

Completion payloads include normalized usage fields so downstream clients do not need upstream-specific accounting logic.

Streaming behavior

Streaming responses are delivered over server-sent events with deterministic close semantics and final usage summaries when available.

Error handling

Common failure conditions return stable codes for auth failures, exhausted quotas, invalid payloads, and upstream unavailability.

Operational notes

  • Issue unique API keys per internal workload.
  • Use streaming for interactive sessions and non-stream mode for batch jobs.
  • Review usage and quota policies before enabling unattended automation.