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, answers401 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.
- 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.
- Hand Path Global the public key, in hexadecimal. Path Global registers the person as an operator, with the scopes agreed.
- Sign every request to an operator route with three headers.
| Header | Value |
|---|---|
Path-Operator | The id of the operator |
Path-Operator-Timestamp | The instant of signing, ISO 8601 |
Path-Operator-Signature | The Ed25519 signature, in hexadecimal, of the text below |
METHOD\npath?query\nsha256(body)\ntimestamppath?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-Keyon everyPOSTthat 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 withPathGlobal-Idempotent-Replay: trueif it was given; otherwise the request runs. 409 pathglobal.core.idempotency_in_progressmeans the first request still runs: wait, then send again.409 pathglobal.core.idempotency_conflictmeans 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/exchangesis idempotent per caller andreference. - A route that answers
executingis 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
| Status | Code | What to do |
|---|---|---|
202 | The change waits for a second person: keep approval, then apply it as Risk, limits and approvals describes | |
400 | pathglobal.core.unsupported_version | Path-Version is not a version of the API: pin the version in details.latest |
401 | pathglobal.auth.unauthenticated | The key is missing, revoked, expired or outside its ranges |
403 | pathglobal.auth.scope_missing | Ask Path Global for the scope |
403 | pathglobal.risk.operator_required | Sign the request as a registered operator who carries the scope |
409 | pathglobal.risk.approval_pending | Wait for the decision |
409 | pathglobal.risk.approval_invalid | Request a new approval for the change as it is now |
409 | pathglobal.router.quote_expired | Quote again |
409 | pathglobal.core.idempotency_in_progress | Send again later with the same key |
429 | Rate limit: wait, then send again. pathglobal.risk.velocity_exceeded and pathglobal.risk.corridor_throttled are bounds of risk, also 429 | |
503 | pathglobal.core.mode_unavailable | The mode of the key is not available: send again later |
503 | pathglobal.risk.halted | New work is paused: send again later |
503 | pathglobal.risk.breaker_open | A 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.modewhere it matters. - Every creating
POSTcarries anIdempotency-Key, and retries reuse it. - Your code switches on
code, not onmessage. - 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, withverifySignedof@pathglobal/sdkorverifyEnvelopeof@pathprotocol/sdk; apg-live-…kid signs in live mode.
Versioning
Paths without a number, a dated API version pinned with Path-Version, the answer when a request does not pin, and the train in the path for proxies that remove headers.
Route a payment
From an Omni Account to a beneficiary on another network or to a PATH address — quote, execute once, follow the route to settled, then read and verify its SETTL, execution and receipts.