0Bit Documentation

Installation

Install the 0Bit packages, choose SDK versus REST, and set up the first development environment.

You can integrate with 0Bit through SDKs or direct HTTPS calls. The install path depends on the product surface. Use SDKs when an official package exists for the workflow you are building; use REST when the product API reference is the source of truth or when your organization has product-gated access.

The canonical public SDK package in the current codebase is 0Gate. Other products may be REST-first, entitlement-gated, or reviewed before SDK use:

Product or surfacePackage/API pathUse
0Gate Node server@0bit/gateCreate sessions and call 0Gate server APIs from your backend.
0Gate browser bundler@0bit/gate/browserMount the hosted 0Gate experience with a publishable key and client_secret.
0Gate React@0bit/gate/reactRender a React wrapper around the same hosted 0Gate flow.
0Gate Python0bit-gate / zerobit.gateCreate sessions from Python services.
0PoolsREST/API reference where approvedDiscover entitled pools, create quotes, execute quotes, and read trade status.
0BaseREST/API reference where enabledCreate checkout/payment objects, payment links, invoices, reports, and ledger reads.
0LinkREST/API reference where enabledReview route/workflow state, fallback boundaries, and settlement-handling records.
0Pools ScanPublic-safe readsQuery indexed activity and explorer/status records.

Install the product you are integrating

The 0Gate SDK is the right first package for hosted buy, sell, swap, and checkout-style flows. 0Pools, 0Base, and 0Link docs explain product concepts and API boundaries, but access and SDK availability depend on your entitlement and product status.

Node and browser

npm install @0bit/gate

Server usage:

import { GateClient } from '@0bit/gate';

const gate = new GateClient({
  apiKey: process.env.OBIT_SECRET_KEY!,
  baseUrl: 'https://gate-api-sandbox.0bit.app',
});

const session = await gate.sessions.create({
  amount: '100.00',
  currency: 'EUR',
  return_url: 'https://app.partner.example/checkout/done',
});

Browser usage:

import { GateRamp } from '@0bit/gate/browser';

const ramp = new GateRamp({
  publishableKey: process.env.NEXT_PUBLIC_OBIT_PUBLISHABLE_KEY!,
  clientSecret: session.client_secret,
  environment: 'sandbox',
});

await ramp.mount('#gate-container');

The SDK constructor uses the API origin, while raw REST examples include /v1 in the URL. Keep that distinction clear:

MethodExample
SDK base URLhttps://gate-api-sandbox.0bit.app
REST base URLhttps://gate-api-sandbox.0bit.app/v1

React

import { RampCheckout } from '@0bit/gate/react';

export function CheckoutGate({ clientSecret }: { clientSecret: string }) {
  return (
    <RampCheckout
      publishableKey={process.env.NEXT_PUBLIC_OBIT_PUBLISHABLE_KEY!}
      clientSecret={clientSecret}
      onSuccess={({ txId }) => {
        console.log('UX callback only', txId);
      }}
    />
  );
}

React callbacks are still browser callbacks. Use them to update the screen, not to mark an order paid.

Python

pip install 0bit-gate

Framework extras are available when you want adapter helpers:

pip install "0bit-gate[fastapi]"
pip install "0bit-gate[flask]"
pip install "0bit-gate[django]"

Python usage:

import os
from zerobit.gate import GateClient

client = GateClient(
    api_key=os.environ["OBIT_SECRET_KEY"],
    base_url="https://gate-api-sandbox.0bit.app",
)

session = client.sessions.create({
    "amount": "100.00",
    "currency": "EUR",
    "return_url": "https://app.partner.example/checkout/done",
})

print(session["client_secret"])

Direct REST

SDKs are optional. This is the same create-session call over HTTPS:

curl -X POST "$OBIT_GATE_API_BASE_URL/gate_sessions" \
  -H "Authorization: Bearer $OBIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_123_create_gate_session" \
  -d '{
    "amount": "100.00",
    "currency": "EUR",
    "return_url": "https://app.partner.example/checkout/done"
  }'

Use REST for 0Pools, 0Base, or 0Link when the API reference is the source of truth for fields and status codes. Product docs explain what to build and why; API reference pages define exact request/response schemas.

Product install decision

If you are starting with...Install/callContinue to
Hosted buy, sell, swap, checkout, redirect, WebView, or widget@0bit/gate or 0bit-gate0Gate quickstart
Headless liquidity, entitled pools, quote execution, or trade statusREST against the approved Pools API0Pools quickstart
Merchant checkout/payment objects, reports, payment links, or invoicesProduct documentation for enabled 0Base workflows0Base quickstart
Route review, fallback behavior, quote availability, or connected workflow stateProduct documentation for 0Link routing review0Link quickstart
Explorer/status/search visibilityScan docs and public-safe reads0Pools Scan

Local project checklist

StepCheck
Install package or choose REST0Gate SDK installed, or product API reference selected for 0Pools/0Base/0Link/Scan.
Configure envProduct API base URL, sk_test_* or approved credential, browser-safe key where applicable, and webhook secret where events are used.
Server routeYour backend creates the 0Bit object and stores the returned id.
Browser routeYour frontend receives only browser-safe values.
Webhook routeRaw request body is available for signature verification.
LoggingYour logs include your reference id, 0Bit object id, request id where available, and event id.

Continue

On this page