# MapleAI — AI Agent Discovery

## Service Overview
- **Name**: MapleAI
- **Type**: LLM API provider (GPT models)
- **Protocol**: x402 (pay-per-request on Base)
- **Base URL**: https://base.mapleai.shop/v1
- **Compatibility**: OpenAI Chat Completions + OpenAI Responses API
- **Contact**: contact@mapleai.shop

## Available Models
14 GPT models, priced per token. Full catalog: GET https://base.mapleai.shop/v1/models

- **openai/gpt-5.6-sol** — GPT-5.6 Sol, 1.1M context, $2.80 in / $14.00 out per 1M tokens
- **openai/gpt-5.6-terra** — GPT-5.6 Terra, 1.1M context, $1.40 in / $8.40 out per 1M tokens
- **openai/gpt-6-luna** — GPT-6 Luna, 1.1M context, $0.07 in / $0.35 out per 1M tokens
- **openai/gpt-6-sol** — GPT-6 Sol, 1.1M context, $1.40 in / $7.00 out per 1M tokens
- **anthropic/claude-sonnet-5** — Claude Sonnet 5, 1.1M context, $1.00 in / $5.00 out per 1M tokens
- **anthropic/claude-opus-4-8** — Claude Opus 4.8, 1.1M context, $2.50 in / $12.50 out per 1M tokens
- **anthropic/claude-opus-5** — Claude Opus 5, 1.1M context, $2.50 in / $12.50 out per 1M tokens
- **anthropic/claude-haiku-4-5** — Claude Haiku 4.5, 1.1M context, $0.50 in / $2.50 out per 1M tokens
- **anthropic/claude-sonnet-4-5** — Claude Sonnet 4.5, 1.1M context, $1.50 in / $7.50 out per 1M tokens
- **anthropic/claude-sonnet-4-6** — Claude Sonnet 4.6, 1.1M context, $1.50 in / $7.50 out per 1M tokens
- **anthropic/claude-sonnet-5-5** — Claude Sonnet 5.5, 1.1M context, $1.00 in / $5.00 out per 1M tokens
- **anthropic/claude-opus-4-6** — Claude Opus 4.6, 1.1M context, $2.50 in / $12.50 out per 1M tokens
- **anthropic/claude-opus-4-7** — Claude Opus 4.7, 1.1M context, $2.50 in / $12.50 out per 1M tokens
- **anthropic/claude-opus-5-5** — Claude Opus 5.5, 1.1M context, $2.00 in / $10.00 out per 1M tokens

## Image Models

- gpt-image-2 (1024x1024): $0.0200 per image
- gpt-image-2.5 (1024x1024): $0.0400 per image
- gpt-image-2.5-flare (1024x1024): $0.0400 per image
- gpt-image-2.5-sunburst (1024x1024): $0.0400 per image
- grok-imagine-image (1024x1024): $0.0450 per image
- gpt-image-2-2k (2048x2048): $0.0900 per image
- gpt-image-2.5-sunburst-2k (2048x2048): $0.2200 per image

POST https://base.mapleai.shop/api/v1/images/generations generates images. POST https://base.mapleai.shop/api/v1/images/image2image edits a PNG, JPEG or WebP supplied as a base64 data URI (maximum 10 MB). Send model, size, prompt and optional n (1-4); edits also require image. The x402 challenge includes the exact price with payment overhead. Successful responses contain data[].url or data[].b64_json.


## Audio Models

- TTS: `tts-1`, `tts-1-hd`, `orpheus-english`, `orpheus-arabic` — $0.015 per request. POST https://base.mapleai.shop/v1/audio/speech with JSON model, input (text up to 5000 chars), optional voice and response_format (wav only). OpenAI voice presets (alloy, nova, onyx…) map to Gemini voices; `orpheus-*` models take their own voice names (en: autumn/diana/hannah/austin/daniel/troy, ar: fahad/sultan/noura/lulwa/aisha/abdullah) and emotion tags like [laughs]. speed (0.25-4) is honored on the orpheus models only. Returns an audio/wav stream.
- STT: `whisper-1`, `whisper-large-v3`, `whisper-large-v3-turbo` — $0.006 per request. POST https://base.mapleai.shop/v1/audio/transcriptions as multipart form (file + model fields) or JSON {file: base64/data-URI, model}; audio up to 25 MB. response_format: json|text everywhere; verbose_json (word timestamps), srt and vtt only on the whisper-large-v3* models. Returns {"text": ...} or the requested format body.
Every audio response carries `x-audio-upstream` (the vendor/model that served) and `x-fallback-used` (1 = a secondary vendor served after the primary failed; for TTS the voice then differs from the primary).


## Jev

- jev-latest: $0.06 per 1M input tokens, output free, plus settlement overhead. POST https://base.mapleai.shop/jev uses SystemOne; send model, state and named questions, each with type and instructions. Read answers from the response.


## Agents

- agents/oss-20b: $0.002 base + $0.001 per step (charged at the max_steps ceiling, default 8), plus settlement overhead. POST https://base.mapleai.shop/v1/agents/execute with model, task, optional context, max_steps (1-20) and tools (calculator, fetch_url). The agent reasons step by step, runs allowed tools server-side, and returns the full step trace, fetched sources and token usage.


## Free Embeddings

- nvidia/nemotron-3-embed-1b: free POST https://base.mapleai.shop/v1/embeddings; send input as a string or array of strings.


## Free Chat (Nemotron 3.5 Bolt)

- nvidia/gpt-oss-20b: free POST https://base.mapleai.shop/v1/free/chat/completions; no payment. Rate-limited 10/10min and 100/day per agent IP; max_tokens capped at 2048. Check remaining window: GET https://base.mapleai.shop/v1/free/chat/completions/quota.
- The id nvidia/gpt-oss-20b is an alias kept for existing configs; the model that actually serves the request is nvidia/nemotron-3.5-bolt-e4b (NVIDIA retired the gpt-oss NIM endpoint).



## Prepaid API Keys

POST https://base.mapleai.shop/prepaid/codes (x402-paid) issues a prepaid bearer key for one GPT or Claude model with a token budget in 100000-token steps from 100000 to 1000000, priced at the model input rate plus settlement fee. Use the key at https://mapleai.shop/v1 (OpenAI-compatible), or right here on the gateway without x402: POST https://base.mapleai.shop/prepaid/v1/chat/completions with the oms_buy_ Bearer key (any /prepaid/v1/* subpath forwards the same way; Jev packs spend at POST https://base.mapleai.shop/prepaid/v1/jev, billed input-tokens only). Check usage and status for free: GET https://base.mapleai.shop/prepaid/status (or https://mapleai.shop/v1/prepaid/status) with the prepaid key as the Bearer token — returns valid, reason and tokens total/used/reserved/remaining.

Error recovery: an invalid purchase body is answered with availableModels and their pack prices; a prepaid chat call whose model is outside the key returns 403 with the current allowedModels of that key; an exhausted key returns valid=false with reason. In every case the response names https://mapleai.shop/v1/prepaid/status as the refresh URL before buying a new pack.



## Buy with a bank card (mapleai.shop)

Humans can buy 10M/30M/50M-token packs (same oms_buy_ keys, one model each)
with a bank card at https://mapleai.shop/ — Lava.top checkout, key delivered on
the success page and by email. Agents keep using x402: these card routes are
for humans only.

## Quick Start for AI Agents

The code below shows the request format. A standard OpenAI SDK does not handle x402 payment automatically. Use an x402-aware client to read the 402 challenge, sign it and retry with PAYMENT-SIGNATURE.

### Python
```python
from openai import OpenAI

client = OpenAI(
    base_url="https://base.mapleai.shop/v1",
    api_key="payment-signature-required"  # use an x402-aware client
)

response = client.chat.completions.create(
    model="openai/gpt-5.6-sol",
    messages=[{"role": "user", "content": "Hello"}]
)
```

### TypeScript
```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://base.mapleai.shop/v1',
  apiKey: 'payment-signature-required' // use an x402-aware client
});

const response = await client.chat.completions.create({
  model: 'openai/gpt-5.6-sol',
  messages: [{role: 'user', content: 'Hello'}]
});
```

### Responses API
```bash
curl https://base.mapleai.shop/api/v1/responses \
  -H 'content-type: application/json' \
  -d '{"model":"openai/gpt-5.6-sol","input":"Hello"}'
```

## Discovery Endpoints

Developer guide with network URLs, model prices and request examples: https://base.mapleai.shop/developers

### Service Index
`GET https://base.mapleai.shop/service-endpoints.json`
One-shot machine-readable index: every route with its access mode
(x402 / free / prepaid bearer), live per-unit pricing and request examples.

### x402 Resource Manifest
`GET https://base.mapleai.shop/.well-known/x402`
Machine-readable x402 resource manifest for wallet/agent discovery.

### A2A Agent Card
`GET https://base.mapleai.shop/.well-known/agent-card.json`
A2A-protocol agent card: skills, x402 security scheme and the OpenAI-compatible
HTTP interface; use it for agent-to-agent service discovery.

### OpenAPI Specification
`GET https://base.mapleai.shop/openapi.json`
Full API specification in OpenAPI 3.1 format, including per-model pricing.

### Model Catalog
`GET https://base.mapleai.shop/v1/models`
Free list of available models with pricing and context windows.

## Paid Endpoints

| Method | Path | Protocol |
| --- | --- | --- |
| POST | `/v1/chat/completions` | OpenAI Chat Completions |
| POST | `/api/v1/chat/completions` | OpenAI Chat Completions (alias) |
| POST | `/api/v1/responses` | OpenAI Responses API (alpha) |
| POST | `/v1/responses` | OpenAI Responses API (alpha) |
| POST | `/v1/messages` | Anthropic Messages API (Claude) |

| POST | /v1/audio/speech | Text-to-speech (WAV) |
| POST | /v1/audio/transcriptions | Speech-to-text |
| POST | /api/v1/images/generations | Image generation |
| POST | /api/v1/images/image2image | Image editing |
| POST | /jev | Jev SystemOne decisions |
| POST | /v1/agents/execute | Autonomous agent execution (oss-20b, tools) |
| POST | /v1/free/chat/completions | Free chat, alias nvidia/gpt-oss-20b -> nvidia/nemotron-3.5-bolt-e4b (quota-limited) |
| POST | /prepaid/codes | Buy a prepaid API key |
| POST | /prepaid/v1/chat/completions | Chat with a prepaid key (Bearer oms_buy_, no x402) |
| POST | /prepaid/v1/jev | Prepaid Jev decisions (input-tokens only) |
| GET | /prepaid/status | Prepaid key usage and status (free) |

## Payment Protocol
1. Send the request without payment
2. Receive HTTP 402 with the exact USDC amount in the `PAYMENT-REQUIRED` header
3. Sign the USDC transfer with your wallet
4. Retry with the `PAYMENT-SIGNATURE` header — the call executes immediately

Price = counted input tokens × input rate + requested output tokens × output rate,
floored at $0.0010 per paid request. Failed calls (HTTP >= 400 from the
model provider) are cancelled, not settled.

### Payment rules (critical for agents)
- **One signature = one request.** Every request needs its own 402 challenge and its own signed authorization.
- **Never reuse or fan out a `PAYMENT-SIGNATURE`.** Replays and parallel fan-out of one signed payload are rejected after the first settlement (`settlement_unconfirmed`).
- **On 402, start over**: fetch a fresh challenge and sign again — never pay against a stale quote.

## Anthropic Messages API (Claude)

`POST /v1/messages` speaks the native Anthropic Messages API: `model` (Claude family —
`claude-haiku-4-5`, `claude-sonnet-4-5/4-6/5/5-5`, `claude-opus-4-6/4-7/4-8/5/5-5`;
bare ids or the `anthropic/...` catalog form, full list with prices in `GET https://base.mapleai.shop/v1/models`),
required `max_tokens`, optional `system` prompt, `stream: true` for Anthropic SSE events.
Point the Anthropic SDK at `https://base.mapleai.shop/v1` as `baseURL`; authentication and pricing are
the same x402 flow as above (402 challenge first, then retry with `PAYMENT-SIGNATURE`).

## Agents API (`agent.execution`)

`POST /v1/agents/execute` runs a multi-step agent on a natural-language task. Payment: x402, or a prepaid `oms_buy_` Bearer key on the same URL.

### Request
| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `task` | string (required) | — | What the agent must do |
| `model` | `"agents/oss-20b"` \| `"agents/gpt-6-sol"` | `agents/oss-20b` | Cheap or premium engine |
| `context` | string | — | Untrusted data/constraints for the task |
| `max_steps` | int 1–20 | 8 | Reasoning/tool steps cap; also the billing ceiling |
| `tools` | array of `"calculator"` `"fetch_url"` `"web_search"` `"data_analysis"` `"code_exec"` | all | Tools the agent may call |
| `stream` | boolean | false | `true` → SSE stream of `open` / `step` / `done` events |

### Tools
- `calculator` — arithmetic only: `{"expression": "2*(3+4)/5"}` (digits, `+ - * / % ^ ( )`)
- `fetch_url` — downloads public page text: `{"url": "https://example.com"}` (max 3 per task)

**Deterministic math:** raw chat models approximate arithmetic and occasionally slip on multi-digit carries (we measured it live). For anything with sums, rates, conversions or any numbers that must be exact, run the task through `/v1/agents/execute` with `calculator` (and `data_analysis`) instead of plain chat — the result is computed, not guessed.
- `web_search` — web search via keyless Exa (DuckDuckGo fallback): `{"query": "..."}` → title/url/snippet (max 3 per task)
- `data_analysis` — descriptive stats, no code execution: `{"data": [1,2,3], "field": "price"}` → count/sum/mean/median/min/max/stdev
- `code_exec` — sandboxed code execution: `{"language": "python", "code": "print(2+2)"}` with python / javascript / typescript → stdout/stderr + exit code; no network, no filesystem, no persistence (max 3 per task, $0.002 per call)
- Unknown tools are rejected with `tool_not_allowed`.

### Response (`application/json`, or the SSE `done` payload)
```jsonc
{
  "id": "agexec_<uuid>",
  "object": "agent.execution",
  "model": "agents/oss-20b",
  "task": "<task text>",
  "status": "completed | failed | timeout",
  "reason": "<only on failed/timeout>",
  "steps_executed": 2,
  "steps": [
    { "n": 1, "thought": "…", "action": "tool",
      "tool_call": { "name": "web_search", "args": { "query": "…" } },
      "tool_result": "…", "usage": { "input_tokens": 0, "output_tokens": 0 } },
    { "n": 2, "thought": "…", "action": "final",
      "usage": { "input_tokens": 0, "output_tokens": 0 } }
  ],
  "output": { "reasoning": "thought1 | thought2 | …", "result": "…",
              "confidence": null, "sources": [{ "url": "…", "title": "…" }] },
  "usage": {
    "input_tokens": 0, "output_tokens": 0,
    "reasoning_tokens": 0,  "action_tokens": 0,
    "total_tokens": 0, "tools_invoked": 0, "steps_executed": 2,
    "charge": { "base_usd": 0.002, "step_usd": 0.0005,
                "steps_charged_ceiling": 8, "charged_ceiling_usd": 0.006 }
  }
}
```

`status`: `completed` — answered; `timeout` — hit a per-step (30 s) or wall-clock ceiling and returns the executed steps so far; `failed` — protocol/upstream error (partial steps included, reason set).

### SSE (`"stream": true`)
`event: open` — charged ceiling, engine, step cap, enabled tools. `event: step` — each completed step as it happens. `event: done` — the full `agent.execution` JSON shown above.

### Billing
Charged at the ceiling: `base_usd + max_steps × step_usd` plus, when `code_exec` is allowed, `min(3, max_steps) × $0.002` (+ small settlement overhead), visible in `open` and in `usage.charge.charged_ceiling_usd` — no post-hoc extra fees. Per-tool counters land in `usage.charged_tools`.

| Engine | base/step | Use for |
| --- | --- | --- |
| `agents/oss-20b` | $0.002 / $0.0005 | quick lookups, arithmetic, short searches |
| `agents/gpt-6-sol` | $0.004 / $0.004 | hard multi-step reasoning, long fetch+analyze pipelines |

## Key Features
- **14 GPT models**: GPT-5.6 Sol, GPT-5.6 Terra, GPT-6 Luna and GPT-6 Sol

## Audio

- **TTS** `POST /v1/audio/speech` — models `tts-1`, `tts-1-hd`, `orpheus-english`, `orpheus-arabic`; OpenAI voice presets (`alloy`, `nova`, `shimmer`, …). $0.015 flat per request via x402. Example: `{"model":"tts-1","input":"Hello","voice":"alloy","response_format":"wav"}` → WAV audio bytes.
- **STT** `POST /v1/audio/transcriptions` — models `whisper-1`, `whisper-large-v3`, `whisper-large-v3-turbo` (multipart `file` field). $0.006 flat per request via x402. Responses follow the OpenAI transcription schema (`text`, optionally `verbose_json` with segments).
- **Pricing**: 30% below published OpenAI rates, from $0.07 per 1M input tokens
- **OpenAI-compatible request format**: requires an x402-aware payment client
- **x402 payments**: pay per request in USDC on Base
- **No accounts**: your wallet address is your identity

## Technical Details
- **Network**: eip155:8453 (Base mainnet)
- **Payment token**: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
- **Treasury (payTo)**: 0x63db6eaf635a31bbc6714fe37bdc85243864f611
- **Facilitator**: https://facilitator.payai.network
- **Minimum charge**: $0.0010 per paid request
- **Max context**: 1.1M tokens

## Use Cases
- Autonomous AI agents with budget control
- Multi-agent systems (pay per agent, per request)
- Research and prototyping with no commitment
- Enterprise deployments that cannot hold API keys

## Support
- API status: https://base.mapleai.shop/health
- Contact: contact@mapleai.shop
- x402scan: https://x402scan.com
- Protocol docs: https://x402.org

---

**For AI agents**: every endpoint returns structured JSON. Point the OpenAI SDK at
`https://base.mapleai.shop/v1` with any non-empty `api_key` and handle the 402 challenge with an
x402 client. Last updated: 2026-11-13.
