Integrations

Call any Apiosk APIin under 2 minutes.

Every endpoint on gateway.apiosk.com speaks x402. Your agent requests, the gateway replies 402 Payment Required with a price, your wallet signs a USDC payment on Base or Solana, and the data comes back. No API key, no account, no invoice.

Four ways to wire it up

Pick the surface that fits where your software runs. Same payment flow underneath, whether you reach for raw HTTP, a hosted MCP endpoint, the SDK, or the gateway skill.

Direct HTTP

Gateway API

The raw payment gateway. Handle the 402, attach an x402 proof, retry. Maximum control over headers, retries, and ledger events.

Endpoint
https://gateway.apiosk.com
Gateway docs
ChatGPT + agent clients

Remote MCP

A hosted MCP endpoint for chat-native agents. Add the URL, finish OAuth once, run paid tools from the same session.

Remote URL
https://mcp.apiosk.com/mcp
Open endpoint
@apiosk/sdk

JavaScript SDK

A package for application code that wraps payment execution, typed 402 errors, and retry helpers for Node backends.

Install
npm install @apiosk/sdk
SDK docs
skills.sh

Gateway Skill

An installable skill for coding agents like Claude Code and Codex that need to run paid gateway requests from a shell.

Install
npx skills add Apiosk/openclaw-apiosk --skill apiosk-gateway
Starter kit

What you need

A wallet on Base

Fund it with a few USDC and give your client a private key it can sign with. Payments settle on Base.

Node 18+ or Python 3.10+

Every snippet below runs on a current Node or Python runtime. Pick the stack you already ship on.

Copy-paste integrations

Every example below uses a placeholder FX endpoint. Swap in any endpoint from the catalog at gateway.apiosk.com.

01

Plain fetch (Node / TypeScript)

The lowest-level integration. wrapFetchWithPayment intercepts the 402, signs the payment, and retries automatically.

pay-per-call.tsTypeScript
// pay-per-call.ts
// Run with: npx tsx pay-per-call.ts

import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { wrapFetchWithPayment } from "x402-fetch";

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);

const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
});

const fetchWithPayment = wrapFetchWithPayment(fetch, walletClient);

async function main(): Promise<void> {
  const response = await fetchWithPayment(
    "https://gateway.apiosk.com/v1/fx/convert?from=EUR&to=USD&amount=100",
  );

  const data = await response.json();
  console.log(data);
}

main().catch(console.error);
02

Axios (Node / TypeScript)

Same flow, for codebases already on axios.

apiosk-client.tsTypeScript
// apiosk-client.ts

import axios from "axios";
import { privateKeyToAccount } from "viem/accounts";
import { withPaymentInterceptor } from "x402-axios";

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);

export const apiosk = withPaymentInterceptor(
  axios.create({ baseURL: "https://gateway.apiosk.com" }),
  account,
);

// Usage anywhere in your app:
// const { data } = await apiosk.get("/v1/email/verify", { params: { email } });
03

Python (httpx)

The same pay-per-call flow for Python services, built on httpx and eth-account.

pay_per_call.pyPython
# pay_per_call.py
# pip install x402-httpx eth-account

import asyncio
import os

import httpx
from eth_account import Account
from x402_httpx import x402HTTPXClient

account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])


async def main() -> None:
    async with x402HTTPXClient(account=account) as client:
        response = await client.get(
            "https://gateway.apiosk.com/v1/fx/convert",
            params={"from": "EUR", "to": "USD", "amount": 100},
        )
        print(response.json())


asyncio.run(main())
04

Vercel AI SDK tool

Expose an Apiosk endpoint as a tool your model can decide to call.

tools/convert-currency.tsTypeScript
// tools/convert-currency.ts

import { tool } from "ai";
import { z } from "zod";
import { apiosk } from "../apiosk-client"; // the x402-axios client from example 2

export const convertCurrency = tool({
  description:
    "Convert an amount between two currencies using live FX rates. " +
    "Costs a fraction of a cent per call, paid automatically in USDC.",
  parameters: z.object({
    from: z.string().describe("ISO currency code to convert from, e.g. EUR"),
    to: z.string().describe("ISO currency code to convert to, e.g. USD"),
    amount: z.number().positive(),
  }),
  execute: async ({ from, to, amount }) => {
    const { data } = await apiosk.get("/v1/fx/convert", {
      params: { from, to, amount },
    });
    return data;
  },
});
agent.tsTypeScript
// agent.ts

import { generateText } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { convertCurrency } from "./tools/convert-currency";

const result = await generateText({
  model: anthropic("claude-sonnet-4-6"),
  tools: { convertCurrency },
  prompt: "What is 250 EUR in USD right now?",
});

console.log(result.text);
05

LangChain tool (Python)

Wrap a paid endpoint as a LangChain tool your Python agent can call. Paid per call in USDC via x402. No API key required.

tools/convert_currency.pyPython
# tools/convert_currency.py

import os

import httpx
from eth_account import Account
from langchain_core.tools import tool
from x402_httpx import x402Client

account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])
client = x402Client(account=account)


@tool
def convert_currency(from_code: str, to_code: str, amount: float) -> dict:
    """Convert an amount between two currencies using live FX rates.

    Paid per call in USDC via x402. No API key required.
    """
    response = client.get(
        "https://gateway.apiosk.com/v1/fx/convert",
        params={"from": from_code, "to": to_code, "amount": amount},
    )
    response.raise_for_status()
    return response.json()
06

MCP (Claude Desktop, Claude Code, Cursor)

One config block gives your assistant the entire Apiosk catalog as tools.

claude_desktop_config.jsonJSON
{
  "mcpServers": {
    "apiosk": {
      "url": "https://gateway.apiosk.com/mcp",
      "env": {
        "WALLET_PRIVATE_KEY": "0x..."
      }
    }
  }
}
Claude Code one-linerShell
claude mcp add apiosk https://gateway.apiosk.com/mcp

Add it to your agent client

One command and the agent can run paid tools through Apiosk.

Claude Code
claude mcp add apiosk -- npx -y apiosk-mcp-server
Codex
codex mcp add apiosk -- npx -y apiosk-mcp-server
ChatGPT-compatible client
https://mcp.apiosk.com/mcp

Pricing and receipts

Price stated before you pay

Each 402 response states the exact price up front. Nothing is charged without your client signing it.

On-chain receipts, spend caps

Every settled call produces an on-chain receipt on Base. Set per-transaction and per-day caps in your wallet mandate so an agent loop can never drain funds.

Questions, or a missing endpoint you want listed? Email hello@apiosk.com.

Frequently asked questions

Do I need an API key or an account to call an Apiosk API?

No. Every endpoint on gateway.apiosk.com speaks x402. Your agent makes a request, the gateway replies 402 Payment Required with a price, your wallet signs a USDC payment on Base or Solana, and the data comes back. There is no API key, no account, and no invoice.

How does the payment actually happen in code?

A helper such as wrapFetchWithPayment (fetch), withPaymentInterceptor (axios), or the x402HTTPXClient (Python) intercepts the 402 response, signs the payment with your wallet, and retries the request automatically. You call the endpoint as you normally would and get the data back.

Which languages and frameworks are supported?

Node and TypeScript via x402-fetch and x402-axios, Python via x402-httpx and eth-account, agent frameworks via the Vercel AI SDK and LangChain, and any MCP client (Claude Desktop, Claude Code, Cursor) via the hosted MCP endpoint.

How do I control spend so an agent loop cannot drain my wallet?

Set spend caps per transaction and per day in your wallet mandate. The exact price is stated in every 402 response before payment, nothing is charged without your client signing it, and every settled call produces an on-chain receipt on Base you can verify independently.

AI is going to pay.At prices your subscriptions never will.

Connect once. Keep your plans, keep your billing stack, keep your accounting process. Add the revenue line you've been turning away.