Getting started
Quickstart
From wallet to first response in about two minutes.
If you already use the OpenAI or Anthropic SDK, you change one line.
1. Connect your wallet
Open the app and connect the wallet that holds your $MERCATO, or any wallet for market-price access. You sign a message; it costs no gas.
2. Create your API key
Create a key under API keys. Your first key carries the holder discount. It is shown once; store it as an environment variable:
export MERCATO_API_KEY="mk_live_…"
3. Top up
Add credit with ETH or USDG on Robinhood Chain from Balance. Credit is held in USD and drawn down per request after the discount.
4. Send a request
from openai import OpenAI
import os
client = OpenAI(base_url="https://api.mercatocoin.com/v1", api_key=os.environ["MERCATO_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5.5",
messages=[{"role": "user", "content": "Explain the Mercato discount in one sentence."}],
)
print(reply.choices[0].message.content)
curl https://api.mercatocoin.com/v1/chat/completions \
-H "Authorization: Bearer $MERCATO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek/deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello"}]}'
Check what you paid
Every response carries billing headers:
x-mercato-list-cost: 0.004120
x-mercato-market-cost: 0.001190
x-mercato-discount: 0.45
x-mercato-charged: 0.000655
The same figures appear per request under Usage.