Connect

Call any Apiosk API in 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.

Examples

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://mcp.apiosk.com/mcp"
    }
  }
}
Client one-linersShell
# Claude Code
claude mcp add --transport http apiosk https://mcp.apiosk.com/mcp

# Codex
codex mcp add apiosk -- npx -y @apiosk/mcp

# Any ChatGPT-compatible client: add this URL
https://mcp.apiosk.com/mcp
Surfaces

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
For providers

Get into the comparison in minutes

List it as it is, or keep your own URL and let the SDK put the paywall there.

01

List in the portal

Managed listing. No code changes.

02

Or keep your own URL

@apiosk/sdk in front of your routes.

03

Take paid calls

Agents pick, call, pay per request.

$ npm i @apiosk/sdk

import { apiosk } from "@apiosk/sdk/express";

app.use(apiosk({
  apiKey: process.env.APIOSK_API_KEY,
  baseUrl: "https://api.yourcompany.com",
  // Your own customers never see a 402
  isExistingCustomer: (req) => Boolean(req.header("x-api-key")),
}));

// Unchanged. Same route, same handler
app.post("/v1/todos", createTodo);
@apiosk/sdk/express · your URL · your handlers
WebMCP

Sell your API from your own website

One script tag on a page the agent already reads. It discovers the endpoint, gets the price, pays and calls without ever leaving your docs. Your API stays unchanged. Apiosk handles the payment and grants access after it.

your-docs-page.htmlHTML
<script
  src="https://gateway.apiosk.com/webmcp.js"
  data-apiosk-slug="your-api"
  data-apiosk-pay="popup"
  async
></script>
DiscoverChoosePayResultNo account, no subscription, no API key.

Your own traffic

Agents buy straight from your docs, on your domain.

Gateway discovery

The same listing is where agents shop for tools.

Bazaar distribution

Auto-registered in Coinbase's x402 Bazaar.

Before your first call

What you need, and what protects you

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.

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.

FAQ

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.

Your API is one key away from AI revenue.

Built for APIs, MCP servers, datasets and digital services.