Authentication

SDK — Authentication

API key scopes, spend tokens, and token rotation.

Runtime

API key types

sk_live_...Full access — create/delete agents, modify policies, read transactions.
sk_test_...Sandbox environment — identical API surface, no real funds.
sk_ro_...Read-only — list and retrieve only; no mutations.

Initialising the client

typescriptnomiqon.com
import { Nomiqon } from "@nomiqon/sdk";

export const nomiqon = new Nomiqon({
  apiKey:    process.env.NOMIQON_API_KEY!,
  timeoutMs: 10_000,
  retries:   3,
});

Spend tokens

When an agent makes an outbound request, it must include a short-lived Spend Token — a signed JWT authorising a single spend event. Spend tokens are issued by the gateway and expire after 60 seconds.

typescriptnomiqon.com
const { token, expiresAt } = await nomiqon.agents.issueSpendToken(agent.id, {
  amount:    "0.025",
  recipient: "api.openai.com",
});

fetch("https://api.openai.com/v1/chat/completions", {
  headers: { "x-nomiqon-spend-token": token, ... },
});

Rotating API keys

typescriptnomiqon.com
const newKey = await nomiqon.apiKeys.create({ name: "rotated-key", scopes: ["full"] });
await nomiqon.apiKeys.delete(oldKeyId);
SDK — Authentication — Nomiqon Docs