LANGUAGE MODELS · x402

LLM x402 for your agents.

Pay in USDC for actual token usage.

Call language models without a platform API key or prepaid balance. Authorize a spending limit for each request, then settle in USDC based on actual token usage, subject to the per-call minimum.

  • Chat Completions / Responses
  • Streaming

Get started with KoinCode ↓

Use LLM x402 with KoinCode

KoinCode is an open-source desktop AI agent with built-in access to Koinelix models. Pay from your local wallet without configuring an API key.

Download
  1. Set up your wallet

    Install and open KoinCode. In Preferences → Wallet, create or import a wallet, check that it is on Base mainnet, then use Receive to find the address and fund it with USDC.

  2. Enable a model

    In Preferences → Model settings, select KoinCode, click Refresh models, and enable the model you want to use.

  3. Send a task and authorize payment

    Open New task, choose an enabled KoinCode model, and send a message. When prompted, review the spending limit and approve the request or the current session.

  4. Check the actual charge

    Read the model reply in your task. Open Wallet → Payment history to see the settled USDC charge and payment status.

Conversation and writing

Answer questions, summarize information and draft content.

Code and function definitions

Generate and explain code; supply local function definitions for tool-call suggestions.

Choose your protocol

Discover supported endpoints for each model, including Chat Completions and Responses.

Stream your response

Receive text progressively or request a complete response.

From discovery to settlement

  1. Discover models, protocols and prices with GET /v1/models.
  2. Send your request to receive an HTTP 402 quote.
  3. Sign the upto limit and resend the same request with payment proof.
  4. Receive the model response and final token usage.
  5. Settle by actual token usage after generation.

A clear limit. An actual-usage bill.

The quote uses this request’s input estimate and maximum output budget. The final bill uses the actual input, cached input and output tokens at the quoted rates, subject to the per-call minimum charge.

Signing sets the maximum payment for this call. Funds move when the settlement transaction executes after generation. With streaming, text arrives progressively and settlement follows final usage; non-streaming returns the complete response after settlement.

Catalog prices are final billable rates; do not apply another discount. New quotes use current rates; signed quotes keep their quoted rates.

See live model prices →

Give your agent a starting point

Read https://koinelix.com/agents.md and discover models at https://api.koinelix.com/v1/models.
Choose a model and supported protocol for my task.
Catalog pricing already contains final billable rates; do not apply another discount. Billing uses actual usage at the quoted rates, subject to minimum_charge_usdc. New quotes use current rates; signed quotes keep their quoted rates.
For Chat Completions, use only max_completion_tokens for the output limit; max_tokens and max_output_tokens are rejected with HTTP 400.
Use x402 v2 upto / Permit2. Check the quoted network, asset, trusted payee and my spending budget before signing.
Preserve the exact request body, path, identity, idempotency key and payment proof.
Receive the response and settle by actual token usage.
For pending or unknown outcomes, recover the original call with X-Koinelix-Recover-Only: true and the original authorization; query with bounded backoff.
Confirm payment=settled and the transaction receipt before treating payment as complete.

Discovery resources:/agents.md · /llms.txt · /openapi.json · /.well-known/x402