> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skale.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Kobaru

> Payment infrastructure for devs with reliability, control and speed

[Kobaru](https://www.kobaru.io) enables machine-to-machine payments, allowing AI agents and automated systems to pay per request. With payment infrastructure built for developers they aim to deliver reliable, transparent payments without operational overhead.

## Kobaru Products

* **Kobaru Console**: A central revenue command center that allows users to manage payment infrastructure, track real-time analytics, and perform professional financial reconciliation without writing code.

* **Transparent Proxy**: A no-code monetization tool that transforms any existing API into a paid endpoint by wrapping it in a payment layer without requiring changes to the original backend.

* **Kobaru Gateway**: The core facilitator infrastructure that handles cryptographic signatures and verifies instant settlements on the SKALE network for incoming payment requests.

* **API Paywall Cookbook**: An open-source repository of production-ready templates and examples that help developers implement various monetization patterns across multiple programming languages.

## Why SKALE Base with Kobaru?

Kobaru makes it easy to get started with x402 payments on SKALE. Just hook right up to the gateway with your existing SDK -- setting Kobaru as the facilitator -- and you can start accepting payments on SKALE.

**x402 Facilitator** Point your SDK to `https://gateway.kobaru.io` and start accepting payments with SKALE.

**Instant settlement.** SKALE's instant finality—faster than any other network. Your customers get immediate access, you get immediate revenue.

**Predictable costs.** No gas price spikes or unexpected fees. Perfect for high-volume APIs processing thousands of micropayments daily.

**Fiat Settlement.** Kobaru focuses on abstracting payment complexities and will soon introduce Fiat Settlement options for users looking to leverage SKALE's performance without any blockchain-related friction.

***

## Prerequisites

* A EVM wallet address - to receive USDC payments
* An API you want to monetize
* Basic understanding of x402 protocol. To learn more about it check [here](/get-started/agentic-builders/start-with-x402).

***

## Instant API Monetization

**Transparent Proxy**, a Kobaru product, transforms any existing API into a monetized endpoint without modifying your backend. No code changes. No deployment cycles. No infrastructure modifications.

This is not just "zero code"—this is production-ready monetization that works with your existing infrastructure exactly as it runs today.

### Step 1: Create Your Kobaru Account

1. Go to [console.kobaru.io](https://console.kobaru.io)
2. Sign up with your email

### Step 2: Register Your API

In the Kobaru Console:

1. Click **New Service**
2. Configure your service:
   * **Service name**: Descriptive name (e.g., `skale-data-api`)
   * **Backend URL**: Your API's base URL (e.g., `https://api.yourcompany.com`)
   * **Slug**: Unique identifier for proxy URL (e.g., `skale-data`)
3. Define your first paid route:
   * **Route pattern**: Endpoint path (e.g., `/premium-data`)
   * **Price**: Cost per request in USD (e.g., `$0.001`)
   * **Network**: Select **SKALE Base** (Mainnet or Sepolia)
   * **Usage model**: `pay_per_request` or `pay_per_time`

### Step 3: Go Live and Get Paid

Your API is now accessible at:

```
https://access.kobaru.io/{your-slug}/premium-data
```

**That's it.** Your API is now x402-compatible an able to be paid for by both humans and agents using x402. Kobaru automatically:

* Returns an HTTP 402 response with payment requirements on unpaid requests
* Verifies payments on SKALE Base with cryptographic proof
* Forwards authenticated requests to your backend
* Settles payments to your wallet in \~1 second
* Logs every transaction for reconciliation

***

## x402 SDK

### Official support

**Languages supported:**

* **TypeScript/Node.js** - Full middleware support for Hono and Express
* **Go** - Integration for Go backends with Gin
* **Python** - Flask and FastAPI compatibility

**Key advantage:** Use the same SDK code across any x402-compatible facilitator. Kobaru implements the complete x402 v2 specification, ensuring your integration works exactly as documented.

### Integration

Environment variables:

```bash theme={null}
# Required: Your wallet to receive payments
WALLET_ADDRESS=0xYourWalletAddress

# Optional: Kobaru API key for enhanced features
KOBARU_API_KEY=your_api_key_from_console
```

Here's a minimal example to accept SKALE payments with Kobaru:

<Tabs>
  <Tab title="Server Setup">
    ```typescript theme={null}
    import { Hono } from "hono";
    import { serve } from "@hono/node-server";
    import { cors } from "hono/cors";
    import { paymentMiddleware, x402ResourceServer } from "@x402/hono";
    import { ExactEvmScheme } from "@x402/evm/exact/server";
    import { HTTPFacilitatorClient } from "@x402/core/server";
    import "dotenv/config";

    const app = new Hono();
    app.use("*", cors());

    async function main() {
      // Configure Kobaru facilitator
      const facilitatorUrl = "https://gateway.kobaru.io";
      const facilitatorClient = new HTTPFacilitatorClient({
        url: facilitatorUrl
            })
      

      // Register EVM payment scheme for SKALE
      const resourceServer = new x402ResourceServer(facilitatorClient);
      resourceServer.register("eip155:*", new ExactEvmScheme());

      // Fetch token metadata from Kobaru instead of hardcoding
      const networkId = "eip155:324705682"; // SKALE Base Mainnet
      const assetAddress = "0x2e08028E3C4c2356572E096d8EF835cD5C6030bD"; // USDC on SKALE Base

      // Define payment requirements
      const routes = {
        "GET /api/data": {
          accepts: [
            {
              scheme: "exact",
              network: networkId,
              payTo: process.env.WALLET_ADDRESS as `0x${string}`,
              price: {
                amount: "1000", // 0.001 USDC
                asset: assetAddress,
                extra: { 
                  name: "USDC", 
                  version: "2" 
                  }
              }
            }
          ],
          description: "Premium data access",
          mimeType: "application/json"
        }
      };

      // Apply payment middleware
      app.use("*", paymentMiddleware(routes, resourceServer));

      // Protected endpoint
      app.get("/api/data", (c) => {
        return c.json({
          message: "Premium data unlocked!",
          timestamp: new Date().toISOString()
        });
      });

      const port = 3000;
      serve({ fetch: app.fetch, port }, () => {
        console.log(`Server running on http://localhost:${port}`);
        console.log(`Using Kobaru facilitator: ${facilitatorUrl}`);
      });
    }

    main().catch(console.error);
    ```
  </Tab>

  <Tab title="Client Setup">
    ```typescript theme={null}
    import { x402Client, x402HTTPClient } from "@x402/core/client";
    import { ExactEvmScheme } from "@x402/evm";
    import { privateKeyToAccount } from "viem/accounts";
    import "dotenv/config";

    async function main() {
      const account = privateKeyToAccount(
        process.env.PRIVATE_KEY as `0x${string}`
      );

      const evmScheme = new ExactEvmScheme(account);
      const coreClient = new x402Client().register("eip155:*", evmScheme);
      const httpClient = new x402HTTPClient(coreClient);

      const url = "http://localhost:3000/api/data";
      const response = await fetch(url);

      if (response.status === 402) {
        console.log("Payment required, processing via Kobaru...");

        const responseBody = await response.json();
        const paymentRequired = httpClient.getPaymentRequiredResponse(
          (name: string) => response.headers.get(name),
          responseBody
        );

        const paymentPayload = await httpClient.createPaymentPayload(
          paymentRequired
        );
        
        const paymentHeaders = httpClient.encodePaymentSignatureHeader(
          paymentPayload
        );

        const paidResponse = await fetch(url, {
          headers: { ...paymentHeaders },
        });

        const data = await paidResponse.json();
        console.log("Data received:", data);
      }
    }

    main();
    ```
  </Tab>
</Tabs>

Kobaru maintains an open-source cookbook with production-grade examples demonstrating real-world integrations:

**API Paywall Cookbook:**
[https://github.com/kobaru-io/api-paywall-cookbook](https://github.com/kobaru-io/api-paywall-cookbook)

***

## Kobaru Console

The Kobaru Console is not just a dashboard—it is a complete revenue command center that gives you operational control over your entire payment infrastructure.

**Create a free account** to unlock Console access with enhanced features:

* **Real-time analytics** - Live transaction feed, revenue tracking, settlement confirmation
* **Failure diagnostics** - Identify and resolve payment issues before they impact customers
* **Professional reconciliation** - Complete audit trails and exportable reports for compliance
* **Manage your payment infrastructure without touching code** - Adjust pricing, endpoints, and rate limits instantly
* **Improved performance** - Priority routing and enhanced uptime guarantees
* **Enterprise support** - 24/7 diagnostics with guaranteed response times

**Using Console with the SDK:**

When you have an API key from [console.kobaru.io](https://console.kobaru.io), include it for enhanced service:

```typescript theme={null}
const facilitator = new HTTPFacilitatorClient({
  url: "https://gateway.kobaru.io",
  headers: {
    "Authorization": `Bearer ${process.env.KOBARU_API_KEY}`
  }
});
```

## Troubleshooting

Kobaru provides detailed error messages and the Console shows real-time diagnostics. For common issues:

### Payment verification fails

| Issue                | Solution                                                                                                             |
| -------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Invalid API key      | Verify `KOBARU_API_KEY` in console.kobaru.io                                                                         |
| Wrong network        | Ensure application uses `eip155:1187947933` (mainnet) or `eip155:324705682` (testnet)                                |
| Insufficient balance | User needs USDC on SKALE Base (bridge from Base)                                                                     |
| Expired signature    | Client must sign fresh payment (check `maxTimeoutSeconds`)                                                           |
| Wrong token address  | Use `0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20` (mainnet) or `0x2e08028E3C4c2356572E096d8EF835cD5C6030bD` (testnet) |

### Viem token metadata issues

If using Viem with Node.js, token name fetching may fail. **Solution**: Fetch metadata from Kobaru's `/supported` endpoint instead of hardcoding:

```typescript theme={null}
// Fetch from Kobaru instead of hardcoding
const supported = await facilitatorClient.getSupported();
const networkData = supported.kinds?.find(
  (kind: any) => kind.network === networkId &&
  kind.extra?.asset?.toLowerCase() === assetAddress.toLowerCase()
  );
if (networkData?.extra) {
	const { name, version, decimals } = networkData.extra;
	return {
		name: (name as string),
		version: (version as string),
		decimals: (decimals as number)
	};
}
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="SKALE Supported Facilitators" icon="dollar-sign" href="/get-started/agentic-builders/facilitators">
    Alternative hosted facilitator service
  </Card>

  <Card title="Run Your Own" icon="server" href="/cookbook/x402/facilitator">
    Deploy your own facilitator infrastructure
  </Card>

  <Card title="Accept Payments" icon="dollar-sign" href="/cookbook/x402/accepting-payments">
    Protect endpoints with payment middleware
  </Card>

  <Card title="Make Payments" icon="credit-card" href="/cookbook/x402/buying">
    Build clients that handle x402 payments
  </Card>
</CardGroup>

***

## Resources

* [Kobaru Documentation](https://docs.kobaru.io)
* [x402 Protocol Specification](https://x402.org)

***

<Note>
  This entity -- Kobaru -- is deployed and activley supporting SKALE. These are 3rd party services that may have their own terms and conditions and privacy polices. Use these services at your own risk. AI and agents is a highly experimental space; the 3rd party software solutions may have bugs or be unaudited. You and your agents and your customers use all 3rd party services chosen at your own risk and per their terms.
</Note>
