80trust / 100

Chat Completions

by base.mapleai.shop in AI models & inference

x402 APIPassing, checked 2 min ago

OpenAI-compatible chat completion, priced by counted input tokens + max output tokens at per-model rates

POST https://base.mapleai.shop/v1/chat/completions

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
213 ms typical, 243 ms slowest 5%
Last check
2 min ago
Next check
in 26 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://base.mapleai.shop/v1/chat/completions" \
  -H "content-type: application/json" \
  -d '{"max_tokens":64,"messages":[{"content":"Hello","role":"user"}],"model":"openai/gpt-6-luna"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fbase.mapleai.shop%2Fv1%2Fchat%2Fcompletions
const res = await pay("https://base.mapleai.shop/v1/chat/completions", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":64,"messages":[{"content":"Hello","role":"user"}],"model":"openai/gpt-6-luna"}),
});
console.log(await res.json());

Example input

{
  "max_tokens": 64,
  "messages": [
    {
      "content": "Hello",
      "role": "user"
    }
  ],
  "model": "openai/gpt-6-luna"
}

Example output

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "Hello!",
        "role": "assistant"
      }
    }
  ],
  "id": "chatcmpl_example",
  "object": "chat.completion"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 min agoPassed402245 ms$0.001
4 h agoPassed402213 ms$0.001
7 h agoPassed402226 ms$0.001
11 h agoPassed402242 ms$0.001
15 h agoPassed402210 ms$0.001
18 h agoPassed402225 ms$0.001
22 h agoPassed402202 ms$0.001
26 h agoPassed402199 ms$0.001
29 h agoPassed402194 ms$0.001
34 h agoPassed402243 ms$0.001