MapleAI
API reference / Base mainnet

Build with MapleAI

OpenAI-compatible GPT requests paid in USDC through x402. This page shows the live model rates for Base mainnet.

Endpoints

Chat completions
POST https://base.mapleai.shop/v1/chat/completions
Responses
POST https://base.mapleai.shop/v1/responses
Anthropic Messages (Claude)
POST https://base.mapleai.shop/v1/messages

Models & pricing

USD per 1 million tokens. Each request is quoted from input tokens and maximum output tokens before it runs. The final quote includes the configured payment overhead and minimum charge. The exact USDC amount is in the 402 response.

ModelContextInput / 1MOutput / 1M
openai/gpt-5.6-solGPT-5.6 Sol1.1M$2.80$14.00
openai/gpt-5.6-terraGPT-5.6 Terra1.1M$1.40$8.40
openai/gpt-6-lunaGPT-6 Luna1.1M$0.07$0.35
openai/gpt-6-solGPT-6 Sol1.1M$1.40$7.00
anthropic/claude-sonnet-5Claude Sonnet 51.1M$1.00$5.00
anthropic/claude-opus-4-8Claude Opus 4.81.1M$2.50$12.50
anthropic/claude-opus-5Claude Opus 51.1M$2.50$12.50
anthropic/claude-haiku-4-5Claude Haiku 4.51.1M$0.50$2.50
anthropic/claude-sonnet-4-5Claude Sonnet 4.51.1M$1.50$7.50
anthropic/claude-sonnet-4-6Claude Sonnet 4.61.1M$1.50$7.50
anthropic/claude-sonnet-5-5Claude Sonnet 5.51.1M$1.00$5.00
anthropic/claude-opus-4-6Claude Opus 4.61.1M$2.50$12.50
anthropic/claude-opus-4-7Claude Opus 4.71.1M$2.50$12.50
anthropic/claude-opus-5-5Claude Opus 5.51.1M$2.00$10.00

Images

Generate or edit images with x402 USDC payments. The exact quote includes payment overhead.

Generate
POST /api/v1/images/generations
Edit
POST /api/v1/images/image2image
ModelSizeUSD / image
gpt-image-21024x1024$0.0200
gpt-image-2.51024x1024$0.0400
gpt-image-2.5-flare1024x1024$0.0400
gpt-image-2.5-sunburst1024x1024$0.0400
grok-imagine-image1024x1024$0.0450
gpt-image-2-2k2048x2048$0.0900
gpt-image-2.5-sunburst-2k2048x2048$0.2200
Image request
curl -i https://base.mapleai.shop/api/v1/images/generations \
  -H 'content-type: application/json' \
  -d '{"model":"gpt-image-2","size":"1024x1024","prompt":"A maple leaf","n":1}'

For image2image, add image as a PNG, JPEG or WebP base64 data URI. Both routes return data[].url or data[].b64_json.

Audio

OpenAI-compatible audio endpoints with x402 USDC payments; flat price per request plus settlement overhead shown in the 402 challenge.

Text-to-speech
POST /v1/audio/speech — $0.015 / request
Speech-to-text
POST /v1/audio/transcriptions — $0.006 / request
TTS modelBackend & voices
tts-1Gemini 3.8 Flash Lite; OpenAI presets (alloy, nova, onyx…)
tts-1-hdGemini 3.8 Flash; same presets, fuller voice
orpheus-englishOrpheus EN (emotive, [laughs] tags, real speed): autumn, diana, hannah, austin, daniel, troy
orpheus-arabicOrpheus AR Saudi: fahad, sultan, noura, lulwa, aisha, abdullah
STT modelNotes
whisper-1Gemini 3.5 Transcribe — default quality, json/text
whisper-large-v3Groq Whisper v3 — accuracy + verbose_json word timestamps, srt, vtt
whisper-large-v3-turboGroq Whisper turbo — fast + same timestamp formats
Text-to-speech
curl -i https://base.mapleai.shop/v1/audio/speech \
  -H 'content-type: application/json' \
  -d '{"model":"tts-1","input":"Hello from MapleAI","voice":"alloy"}'
Transcription
curl -i https://base.mapleai.shop/v1/audio/transcriptions \
  -F [email protected] -F model=whisper-large-v3-turbo -F response_format=verbose_json

Transcription also accepts JSON with file as a base64 string or data: URI (max 25 MB). Responses include x-audio-upstream and x-fallback-used headers; a fallback 1 means a secondary vendor served the request (for TTS the voice then differs).

Jev

jev-latest evaluates structured questions through SystemOne. $0.06 per 1M input tokens; output tokens are free. The x402 challenge includes settlement overhead and the exact amount. This model does not support Chat Completions or Responses.

Jev request
POST https://base.mapleai.shop/jev
content-type: application/json

{"model":"jev-latest","state":"The customer was charged twice for one order.","questions":{"billing":{"type":"noul","instructions":"Is this about a billing issue?"}}}

The JSON response contains answers.billing. Each named question uses a type of noul, choice or score and its own instructions.

Agents

Autonomous task execution via agents/oss-20b (multi-step reasoning with tools). $0.002 base + $0.001 per step, charged at the max_steps ceiling (default 8, maximum 20), plus settlement overhead shown in the 402 challenge. Available tools: calculator (safe arithmetic) and fetch_url (public pages, up to 3 per task).

Execute a task
POST https://base.mapleai.shop/v1/agents/execute
content-type: application/json

{"model":"agents/oss-20b","task":"What is 12% of 340?","max_steps":6,"tools":["calculator","fetch_url"]}

The response is an agent.execution object: status (completed | failed | max_steps_exhausted), the full steps trace (thought, tool_call, tool_result), output.result with fetched sources, and per-step plus total token usage.

Prepaid API keys

Buy a prepaid bearer key for one GPT or Claude model with x402. The budget counts total tokens (input + output) in 100000-token steps from 100000 to 1000000 and is priced at the model input rate, plus the network settlement fee shown in the 402 challenge. The key works at https://mapleai.shop/v1 (OpenAI-compatible).

Model0.1M pack1M pack
openai/gpt-5.6-sol$0.28$2.80
openai/gpt-5.6-terra$0.14$1.40
openai/gpt-6-luna$0.007$0.07
openai/gpt-6-sol$0.14$1.40
anthropic/claude-sonnet-5$0.10$1.00
anthropic/claude-opus-4-8$0.25$2.50
anthropic/claude-opus-5$0.25$2.50
anthropic/claude-haiku-4-5$0.05$0.50
anthropic/claude-sonnet-4-5$0.15$1.50
anthropic/claude-sonnet-4-6$0.15$1.50
anthropic/claude-sonnet-5-5$0.10$1.00
anthropic/claude-opus-4-6$0.25$2.50
anthropic/claude-opus-4-7$0.25$2.50
anthropic/claude-opus-5-5$0.20$2.00
Buy a prepaid key
POST https://base.mapleai.shop/prepaid/codes
content-type: application/json

{"model":"openai/gpt-6-luna","tokens":100000}
Response (after x402 payment)
{"object":"prepaid_code","code":"oms_buy_...","model":"openai/gpt-6-luna",
 "tokens":{"total":100000,"remaining":100000},
 "api_base":"https://mapleai.shop/v1",
 "status_url":"https://mapleai.shop/v1/prepaid/status"}
Spend the key on this gateway (no x402)
POST https://base.mapleai.shop/prepaid/v1/chat/completions
Authorization: Bearer oms_buy_...
content-type: application/json

{"model":"openai/gpt-6-luna","messages":[{"role":"user","content":"Hello"}]}
Check key usage and status (free)
curl https://mapleai.shop/v1/prepaid/status \
  -H "Authorization: Bearer oms_buy_..."

The status check also works same-origin: GET https://base.mapleai.shop/prepaid/status. Status returns valid, reason and tokens with total/used/reserved/remaining. An exhausted key answers valid: false, reason: "disabled" — buy a fresh pack to continue.

Supported networks

Choose the domain for the network where your wallet holds USDC. Each domain has its own OpenAPI document and payment quote.

NetworkCAIP-2API origin
Solanasolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdphttps://sol.mapleai.shop
Base (current)eip155:8453https://base.mapleai.shop
Polygoneip155:137https://polygon.mapleai.shop
Arceip155:5042https://arc.mapleai.shop

cURL

Request the resource once to receive the exact amount and payment requirements in the PAYMENT-REQUIRED header. Sign those requirements with an x402 wallet, then retry with PAYMENT-SIGNATURE.

Get the payment quote
curl -i https://base.mapleai.shop/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'
Retry with a signed x402 payload
curl https://base.mapleai.shop/v1/chat/completions \
  -H 'content-type: application/json' \
  -H "PAYMENT-SIGNATURE: $PAYMENT_SIGNATURE" \
  -d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'

Use the same request body for both calls. PAYMENT_SIGNATURE is the base64 x402 payment payload signed by your wallet.

Embeddings to GPT example

A runnable TypeScript app retrieves local FAQ context with free embeddings, then requests a paid GPT answer through x402. It supports Base and Solana and includes a quote-only mode.

Open the example project

MCP for agent clients

Use the local stdio server with Node.js 20+. It exposes nine tools — free list_models, embed_text, prepaid_status, paid chat_completion, claude_message, jev_decide, agent_execute, buy_prepaid_tap, and prepaid_chat which spends a prepaid key with no wallet. The server signs the x402 challenge and retries the API request; the agent client only needs standard MCP tool support.

Check a quote without paying
npx -y -p mapleai-mcp mapleai-quickstart --network polygon
Client MCP configuration
{
  "mcpServers": {
    "mapleai": {
      "command": "npx",
      "args": ["-y", "-p", "mapleai-mcp", "mapleai-mcp"],
      "env": {
        "EVM_PRIVATE_KEY": "0x...",
        "MCP_PAY_TO_POLYGON": "0x63db6eaf635a31bbc6714fe37bdc85243864f611",
        "MCP_MAX_PAYMENT_USDC": "0.10",
        "MCP_MAX_PREPAID_USDC": "3.00"
      }
    }
  }
}

After checking the quote, use mapleai-quickstart --pay with a funded local wallet to test settlement. For Base and Arc, set MCP_PAY_TO_BASE or MCP_PAY_TO_ARC to the verified recipient. For Solana use SVM_PRIVATE_KEY and MCP_PAY_TO_SOLANA=9DbpH2Mf9D26ak4bASsv6KA4Ra4V571oLpiVdZjAjcU8. The default network is Polygon; set MCP_NETWORK to change it. Metered calls are capped by MCP_MAX_PAYMENT_USDC, prepaid key packs by MCP_MAX_PREPAID_USDC. Keep the wallet key in your local MCP client configuration.

Bootstrapping a paying agent? Fork mapleai-agent-starter on GitHub: repo instructions for agent clients, MCP wiring, a full paid scenario script and a free CI smoke.

JavaScript

Use the x402 SDK to sign the 402 challenge. Set EVM_PRIVATE_KEY for an EVM wallet, or provide a Solana keypair signer on Solana. The example caps payments at 0.10 USDC on EVM networks.

Node.js 20+
import { x402Client } from '@x402/core/client';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const client = new x402Client().setSpendControls({
  allowedAssets: [{ network: 'eip155:8453', asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', maxAmountPerPayment: '100000' }]
});
registerExactEvmScheme(client, { signer: account, networks: ['eip155:8453'] });

const url = 'https://base.mapleai.shop/v1/chat/completions';
const body = JSON.stringify({
  model: 'openai/gpt-5.6-sol',
  messages: [{ role: 'user', content: 'Hello' }],
  max_tokens: 64
});
const headers = { 'content-type': 'application/json' };
const first = await fetch(url, { method: 'POST', headers, body });
if (first.status !== 402) throw new Error('Expected payment challenge');
const challenge = JSON.parse(Buffer.from(
  first.headers.get('payment-required'), 'base64'
).toString());
if (challenge.resource.url !== url || challenge.accepts[0].network !== 'eip155:8453') {
  throw new Error('Unexpected payment request');
}
const payload = await client.createPaymentPayload(challenge);
delete payload.extensions?.quote; // optional display metadata is not required to settle
const signature = Buffer.from(JSON.stringify(payload)).toString('base64');
const paid = await fetch(url, {
  method: 'POST',
  headers: { ...headers, 'PAYMENT-SIGNATURE': signature },
  body
});
if (!paid.ok) throw new Error('Request failed: ' + paid.status);
console.log(await paid.json());

Install the x402 packages for your network. On EVM: npm install @x402/core @x402/evm viem. On Solana: npm install @x402/svm @solana/kit @scure/base. Keep private keys outside source code.