Skip to main content

Agents & x402

Jintel offers two access paths:

  1. API-key bearer auth — for humans, backend services, and SDK users. You sign up, get jk_live_…, and send it as Authorization: Bearer …. Billing runs on a monthly plan (Polar).
  2. x402 pay-per-query — for autonomous agents. No signup, no API key, no prefunded balance. The agent's wallet signs a USDC payment for each GraphQL request and settles on Base.

The schema, rate limits, and data are identical on both paths. Pick the one that matches how your client is architected.

How per-request payment works

POST /api/graphql is both a normal bearer-auth endpoint and an x402 v2-paid endpoint. The routing is decided by which headers you send:

  • Authorization: Bearer jk_live_… → normal API-key flow, billed against your plan's monthly credits.
  • No Authorization, no PAYMENT-SIGNATURE → returns 402 Payment Required with the quote delivered in a base64-encoded PAYMENT-REQUIRED response header (USDC amount, chain, pay-to address, EIP-3009 nonce). The HTTP body is {}.
  • Re-sent with PAYMENT-SIGNATURE: <base64-encoded payload> → verified and settled against the CDP facilitator on Base mainnet, then executed. On success the response carries a PAYMENT-RESPONSE header with the on-chain transaction hash.

The payer wallet recovered from the signature auto-identifies the caller — no signup, no Bearer token. The quote amount is priced off the GraphQL query AST (the same credit model as the plan path, converted to USDC). Cheap queries like quotes(tickers: […]) cost fractions of a cent.

Discovery via AgentCash / CDP Bazaar

Jintel's paid POST /api/graphql endpoint is cataloged on AgentCash, the CDP Bazaar, and agentic.market. Agents that support x402 discovery find Jintel automatically — no manual configuration.

The discovery descriptor lives at https://api.jintel.ai/openapi.json and validates against @agentcash/discovery. It carries:

  • info.x-guidance — agent-friendly usage doc (entry points, sub-graphs, filter inputs)
  • x-payment-info on POST /api/graphql{ price: { mode: 'dynamic', currency: 'USD', min, max }, protocols: [{ x402: {} }] }
  • x-x402 extension — { network: 'eip155:8453', asset: USDC, payTo, scheme: 'exact', identity: 'payer-wallet' }
  • A 402 response with the per-query quote delivered via the base64-encoded PAYMENT-REQUIRED header

The full GraphQL schema is discoverable via the always-free GraphQL introspection or GraphiQL.

You can validate the descriptor yourself:

npx -y @agentcash/discovery@latest discover https://api.jintel.ai

Tool catalog (x-jintel-tools)

POST /api/graphql is one physical endpoint, but Jintel's API surface is naturally a toolkit of named capabilities — get a quote, search entities, run a sanctions check, pull a macro series, etc. The OpenAPI doc surfaces that catalog two ways so agents and code generators can discover capabilities by name:

  1. x-jintel-tools — a structured array on the /api/graphql operation. Each entry has:

    {
    name: string; // matches the @yojinhq/jintel-client method
    summary: string; // one-line capability description
    category: 'market' | 'regulatory' | 'macro' |;
    query: string; // parametrised GraphQL query string
    variables: object; // example variables
    inputSchema: object; // JSON schema for the variables
    outputPath: string; // dot-path into the response
    }
  2. OpenAPI examples — the same 15 entries are also exposed under requestBody.content["application/json"].examples so any OpenAPI viewer (Swagger UI, Redoc, Stoplight) renders them as a labelled dropdown of ready-to-paste request bodies.

The shipped catalog covers the highest-leverage agent shapes:

CategoryTools
marketquotes, searchEntities, priceHistory, entityByTicker, entitiesByTickers, marketStatus, sp500Multiples
regulatorysanctionsScreen, institutionalHoldings, shortInterest, campaignFinance
macrogdp, inflation, interestRates, macroSeries

All 15 tools share the same POST /api/graphql endpoint, the same auth options, and the same per-query x402 pricing — the catalog is documentation only. To call a tool, copy its query and variables straight into a GraphQL request:

// Example — equivalent to jintel.quotes(["AAPL", "MSFT"])
import { JintelClient } from "@yojinhq/jintel-client";
const jintel = new JintelClient({ fetch: payFetch });
const res = await jintel.request(
'query Quotes($tickers: [String!]!) { quotes(tickers: $tickers) { ticker price changePercent } }',
{ tickers: ["AAPL", "MSFT"] },
);

LLM tool-calling integrations and MCP servers can iterate the x-jintel-tools array to register every capability as a discrete callable function — without hard-coding the schema. The list is the single source of truth for the agent surface.

Using an x402 client

If you are building an agent and want to pay per query, any x402-compatible fetch wrapper works. The simplest path is x402-fetch:

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

const wallet = createWalletClient({
account: privateKeyToAccount(process.env.AGENT_PK as `0x${string}`),
chain: base,
transport: http(),
});

const payFetch = wrapFetchWithPayment(fetch, wallet, 1_000_000n); // 1 USDC cap

const res = await payFetch("https://api.jintel.ai/api/graphql", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: `query ($tickers: [String!]!) {
quotes(tickers: $tickers) { ticker price changePercent }
}`,
variables: { tickers: ["AAPL", "MSFT"] },
}),
});

console.log(await res.json());

The third argument (1_000_000n) caps the maximum USDC amount you'll sign per request — atomic units, so 1_000_000n = 1 USDC. If Jintel ever quoted more than that, the client would refuse to sign.

When to pick which path

Use casePath
Production backend, billing on a monthly planAPI key
Jupyter notebook, one-off researchAPI key
Autonomous agent with its own walletx402
Running on a platform that pays per tool callx402
You want to avoid any signup or KYCx402

The Authentication page covers the API-key flow in detail. The Rate limits page applies to both paths.