Basics

Guides

Going live

From the sandbox to live mode on the client's side — live keys and scopes, key hygiene, mode detection, operator signatures, the MCP live switch, idempotent retries and the answers to handle.

Live mode follows the contract you exercised in the sandbox, on real networks and with real value. What changes is on your side: the keys you hold, the signatures operator routes need, and the care a retry takes.

Live keys and scopes

Request live keys from Path Global, with the scopes each server needs and nothing more. A live key starts with key_live_…; it reaches live mode only.

  • Keep keys on your server. Never ship one in a browser, a mobile application, a log or a repository.
  • Ask for one key per server or per role, so that one can be revoked without stopping the others.
  • Ask for an expiry (expires_at) and for the address ranges your servers call from. A key past its expiry, or used from outside its ranges, answers 401 pathglobal.auth.unauthenticated.
  • A key that names an operator is used by that operator only.

The routes that exist in test mode only (funding a holding, simulating a deposit, sandbox scripts, funding a position) answer 404 pathglobal.core.not_found on a live key. In live mode a holding is funded by a real deposit to one of its endpoints, and a route draws only on what the holding holds.

Detect the mode

const pg = new PathGlobal({ apiKey: process.env.PATHGLOBAL_API_KEY! });

if (pg.mode === 'live') {
  // real value: no sandbox keywords, no test-only calls
}

pg.mode reads the prefix of the key: key_test_… is test, any other key is live. Every response also carries PathGlobal-Mode. Keep the test and live keys in separate configurations, so that a test run never holds a live key.

Corridors

Payments run on corridors, one per pair of asset and network. Path Global opens the corridors of your pairs on request, with the bounds agreed with you. A pair without an open corridor is refused with pathglobal.risk.corridor_closed.

Operator signatures

If your agreement includes operator routes (treasury, risk, intelligence, operations), each request to them in live mode is signed by a person registered as an operator.

  1. Each person generates an Ed25519 key pair and keeps the private key. Never share one key between two people: a checker is another operator than the maker.
  2. Hand Path Global the public key, in hexadecimal. Path Global registers the person as an operator, with the scopes agreed.
  3. Sign every request to an operator route with three headers.
HeaderValue
Path-OperatorThe id of the operator
Path-Operator-TimestampThe instant of signing, ISO 8601
Path-Operator-SignatureThe Ed25519 signature, in hexadecimal, of the text below
METHOD\npath?query\nsha256(body)\ntimestamp

path?query is the path of the route with its query string, without the /genesis prefix; sha256(body) is the hexadecimal SHA-256 of the raw bytes sent, or of the empty string when there is no body. Sign at the time of the request. A request that is not signed by a registered operator who carries the scope of the route answers 403 pathglobal.risk.operator_required.

The SDK signs every request when it is given operator. sign receives the text and returns the signature; the private key stays in your code:

import { ed25519 } from '@noble/curves/ed25519';
import { bytesToHex, hexToBytes } from '@noble/hashes/utils';

const privateKey = hexToBytes(process.env.OPERATOR_PRIVATE_KEY!); // the person's key, from your own secret store

const pg = new PathGlobal({
  apiKey: process.env.PATHGLOBAL_API_KEY!,
  operator: { id: 'op-amara', sign: (message) => bytesToHex(ed25519.sign(new TextEncoder().encode(message), privateKey)) },
});

Without the SDK:

import { createHash } from 'node:crypto';

const body = JSON.stringify({ type: 'rebalance', from, to, amount, reason });
const path = '/treasury/transfers';
const timestamp = new Date().toISOString();
const digest = createHash('sha256').update(body).digest('hex');
const signature = bytesToHex(ed25519.sign(new TextEncoder().encode(`POST\n${path}\n${digest}\n${timestamp}`), privateKey));

await fetch(`https://api.pathglobal.finance${path}`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PATHGLOBAL_API_KEY}`,
    'Content-Type': 'application/json',
    'Path-Version': '2026-11-26.genesis',
    'Path-Operator': 'op-amara',
    'Path-Operator-Timestamp': timestamp,
    'Path-Operator-Signature': signature,
  },
  body,
});

Sign the bytes you send: serialise the body once and use that string for both the digest and the request.

Checkers. A checker who decides an approval in live mode also signs the decision, in the body of the decision: see The decision in live mode.

The MCP server

With a test key every tool of @pathglobal/mcp is available. With any other key, the tools that move value appear only when the server runs with PATHGLOBAL_MCP_LIVE_WRITES=1; their descriptions then end with "LIVE: this moves real value." Give an agent a live key with that switch only when a person reviews what it does. See Path Global MCP server.

Idempotency and retries

  • Send an Idempotency-Key on every POST that creates something once: an account, a holding, an address, an endpoint, an obligation, a route. Derive it from your own id for the operation, such as the invoice number, so a retry from another process uses the same key.
  • On a timeout, a network error or a 5xx, send the same request with the same key. The first answer comes back with PathGlobal-Idempotent-Replay: true if it was given; otherwise the request runs.
  • 409 pathglobal.core.idempotency_in_progress means the first request still runs: wait, then send again. 409 pathglobal.core.idempotency_conflict means the key was used with another body: send the new request under a new key.
  • A quote moves nothing and needs no idempotency key: quote again. POST /settlement/exchanges is idempotent per caller and reference.
  • A route that answers executing is not sent again: poll it. A delivery in doubt is resolved by Path Global; a second payment for the same obligation would pay twice.

Answers to handle

StatusCodeWhat to do
202The change waits for a second person: keep approval, then apply it as Risk, limits and approvals describes
400pathglobal.core.unsupported_versionPath-Version is not a version of the API: pin the version in details.latest
401pathglobal.auth.unauthenticatedThe key is missing, revoked, expired or outside its ranges
403pathglobal.auth.scope_missingAsk Path Global for the scope
403pathglobal.risk.operator_requiredSign the request as a registered operator who carries the scope
409pathglobal.risk.approval_pendingWait for the decision
409pathglobal.risk.approval_invalidRequest a new approval for the change as it is now
409pathglobal.router.quote_expiredQuote again
409pathglobal.core.idempotency_in_progressSend again later with the same key
429Rate limit: wait, then send again. pathglobal.risk.velocity_exceeded and pathglobal.risk.corridor_throttled are bounds of risk, also 429
503pathglobal.core.mode_unavailableThe mode of the key is not available: send again later
503pathglobal.risk.haltedNew work is paused: send again later
503pathglobal.risk.breaker_openA breaker is open on the path of the payment

Log PathGlobal-Request-Id with every error; it is what Path Global needs to look into a request.

Before the first live payment

  • Live keys are on your servers only, with an expiry and address ranges.
  • Test and live configurations are separate, and your code checks pg.mode where it matters.
  • Every creating POST carries an Idempotency-Key, and retries reuse it.
  • Your code switches on code, not on message.
  • The corridors of your pairs are open.
  • If your agreement includes operator routes: each person has a registered key, the SDK is given operator, and checkers can sign decisions.
  • Signed quotes and receipts are verified against GET /.well-known/path-keys, with verifySigned of @pathglobal/sdk or verifyEnvelope of @pathprotocol/sdk; a pg-live-… kid signs in live mode.

On this page