monkgatedocs
Everything you need to call four open models with one key.
Monkgate is an LLM gateway. You sign in with a wallet, top up a balance in USDG, create an API key, and call our models through the OpenAI or Anthropic API you already use. You pay per token. There is no subscription, no seat fee and no email account.
What is Monkgate
Monkgate sits between your code and a set of open-weight language models. It gives you a single endpoint and a single key for four models, each tuned for a different job, and it speaks the two wire formats most tools already support.
- Who it is for
- Developers and agents that want capable models without a monthly plan, a credit card or vendor lock-in.
- What you get
- OpenAI- and Anthropic-compatible endpoints, real streaming, scoped API keys, per-key rate limits and a full usage ledger.
- How you pay
- Prepaid credit in USDG on Robinhood Chain. Each request is priced to the token and debited from your balance.
- What it is not
- Not a chat app and not a subscription. It is infrastructure: you bring the client, we serve the model.
How it works
- Sign in with your wallet. One signature, no gas, no transaction. It only proves you own the address, which becomes your account.
- Top up in USDG. Send USDG on Robinhood Chain from that same wallet. It is credited 1:1 in USD once the block is final, usually about ten minutes.
- Create an API key. Keys start with
sk-mg-, are shown once and stored only as a hash. You can scope a key to certain models, give it its own rate limit, rotate it or revoke it. - Call the API. Point your OpenAI or Anthropic client at Monkgate. Every request is metered, and its exact cost is written to your ledger.
Try it first without any of this: the console on the home page answers a few questions for free and shows what each one would have cost.
Quickstart
Open the dashboard, connect your wallet, add credit under Billing and create a key under API keys. Then:
export MONKGATE_API_KEY="sk-mg-..."
curl https://monkgate.vercel.app/v1/chat/completions \
-H "Authorization: Bearer $MONKGATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "monkgate-om",
"messages": [{"role": "user", "content": "Write a haiku about latency."}]
}'import os
from openai import OpenAI
client = OpenAI(base_url="https://monkgate.vercel.app/v1", api_key=os.environ["MONKGATE_API_KEY"])
stream = client.chat.completions.create(
model="monkgate-om",
messages=[{"role": "user", "content": "Explain SSE in one paragraph."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://monkgate.vercel.app/v1", apiKey: process.env.MONKGATE_API_KEY });
const res = await client.chat.completions.create({
model: "monkgate-om",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);import os
import anthropic
# No /v1 here: the Anthropic SDK appends /v1/messages itself.
client = anthropic.Anthropic(base_url="https://monkgate.vercel.app", api_key=os.environ["MONKGATE_API_KEY"])
msg = client.messages.create(
model="monkgate-om",
max_tokens=512,
messages=[{"role": "user", "content": "Hello!"}],
)
print(msg.content[0].text)Models
Prices are in USD per million tokens. The live list is always available at GET /v1/models, no key needed.
| Model id | Best for | Context | Input | Output |
|---|---|---|---|---|
monkgate-nirvana | Flagship for hard reasoning, coding and agents | 1M | $1.40 | $2.80 |
monkgate-zen | Balanced quality and cost for everyday work | 1M | $0.65 | $1.30 |
monkgate-koan | Capable and inexpensive general model | 128K | $0.22 | $0.88 |
monkgate-om | Fastest and cheapest, with a 1M-token context | 1M | $0.14 | $0.28 |
Start with monkgate-om for speed and cost, and move to monkgate-nirvana for hard reasoning, coding and agent loops. The models think before they answer, and that thinking counts toward max_tokens: keep it above about 200, or leave it unset.
Authentication
Send your key in either header:
| Header | Accepted on |
|---|---|
Authorization: Bearer sk-mg-… | All endpoints |
x-api-key: sk-mg-… | /v1/messages only, which is what Anthropic SDKs send |
Every response carries an x-request-id header. Include it when you report a problem.
Endpoints
GET /v1/models
Public. Returns the catalog in OpenAI list format, plus name, description, context_length and pricing.
POST /v1/chat/completions
OpenAI Chat Completions format. Supported parameters:
modelmessagesstreamstream_optionsmax_tokensmax_completion_tokenstemperaturetop_ptop_kmin_pfrequency_penaltypresence_penaltyrepetition_penaltystopseedtoolstool_choiceparallel_tool_callsresponse_formatlogit_biaslogprobstop_logprobsreasoning_effort
Any other parameter is dropped. n must be 1 or omitted, and user is never forwarded.
POST /v1/messages
Anthropic Messages format, translated in both directions, streaming included. Supported: model, max_tokens (required), messages, system, stop_sequences, temperature, top_p, top_k, stream, tools and tool_choice, with text, image, tool_use and tool_result blocks.
Not supported: extended thinking blocks (dropped), document blocks (400 error), images inside tool_result (text is kept), and cache_control (ignored).
Default system prompt
If a request has no system or developer message, Monkgate adds a short one (about 60 tokens) so the model introduces itself by its product name. Those tokens count as input. Send your own system prompt and nothing is added.
Streaming
With "stream": true the response is text/event-stream. Each event is data: {chunk} and the stream ends with data: [DONE]. Lines are forwarded the moment they arrive; nothing is buffered on our side.
For token usage in the stream, set "stream_options": {"include_usage": true}. The last chunk before [DONE] then carries a usage object. On /v1/messages you get the standard Anthropic events, from message_start to message_stop.
If text arrives all at once, a proxy between you and Monkgate is buffering the stream.
Billing
- Cost = input tokens × input price + output tokens × output price, rounded up to the next $0.000001 per request.
- Before a request runs, its worst-case cost is held against your balance: the estimated input plus
max_tokens, or 4,096 output tokens if you don't set it. Afterwards the exact cost is charged and the hold is released. This is why a402can appear while a little balance is left; setmax_tokensto avoid it. - If you disconnect mid-stream, the model may keep generating to the end, and every generated token is billed. Set
max_tokensto cap a request you might abandon. - The Usage page in the dashboard shows requests, tokens and cost per day and per model. Every credit and debit is a ledger entry; your balance is their sum.
Deposits
- Get USDG on Robinhood Chain. Bridge USDC from Ethereum, Base, Arbitrum or another chain with a bridge such as across.to; it arrives as USDG, 1:1 with the dollar. Bridge a little ETH the same way for network fees.
- Send it from the wallet you signed in with to the deposit address shown on the Billing page. Deposits are matched to accounts by the sending address, so never send from an exchange.
- Wait for finality. The deposit is verified on-chain and credited once its block is final, usually about ten minutes. It is credited exactly once.
USDG is accepted today. Top-ups with the token open when it launches; see below.
$MONK
$MONK is Monkgate's own utility on Robinhood Chain. It is launching soon; until then, everything below describes how it will work, and USDG is the way to top up.
| Top-up bonus | +25% credit on every top-up paid with the token |
| How it is priced | At its lowest price of the last 30 minutes, so a short spike can't buy extra credit |
| Daily limit | Up to $100 of token credit per account per day, $1,000 across all accounts. USDG has no daily limit. |
| Holding | Held in your signed-in wallet over 24 hours; a quick buy-and-sell doesn't count |
Holder tiers
| Tier | Hold | Requests / min (account) | Per key default | Concurrent per key |
|---|---|---|---|---|
| No token | — | 300 | 60 | 8 |
| Holder | 1,000,000 | 600 | 120 | 16 |
| Builder | 5,000,000 | 1,500 | 300 | 32 |
| Scale | 20,000,000 | 3,000 | 600 | 64 |
The token is a utility for paying for and using Monkgate. It is not an investment, and nothing here is a promise about its price or any return.
Limits
| Limit | Default | Notes |
|---|---|---|
| Requests per minute, per key | 60 | Can be set lower per key in the dashboard |
| Requests per minute, per account | 300 | Across all your keys |
| Concurrent requests, per key | 8 | Extra parallel calls get a 429 |
A 429 carries a retry-after header in seconds. Give each tool or agent its own key so you can see its usage and revoke it on its own.
Errors
Errors keep each API family's native shape, so SDKs parse them normally.
{ "error": { "message": "Invalid API key", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } }{ "type": "error", "error": { "type": "authentication_error", "message": "Invalid API key" } }| Status | Code | Meaning |
|---|---|---|
400 | — | Malformed request |
401 | invalid_api_key | Missing, wrong or revoked key |
402 | insufficient_quota | Balance too low for this request's hold |
403 | model_not_allowed · account_suspended | The key or account may not do this |
404 | model_not_found | Unknown model id |
429 | rate_limit_exceeded · concurrency_limit_exceeded | Slow down; see retry-after |
502 | — | Upstream provider error |
503 | — | Temporarily overloaded; retry with backoff |
An error that happens mid-stream arrives as a final event: data: {"error": …} on OpenAI endpoints, or event: error on /v1/messages.
Tools & SDKs
Anything that accepts a custom OpenAI- or Anthropic-compatible base URL works.
| OpenAI-compatible base URL | https://monkgate.vercel.app/v1 |
| Anthropic-compatible base URL | https://monkgate.vercel.app (no /v1) |
| API key | sk-mg-… from the dashboard |
| Model id | Any id from GET /v1/models |
export OPENAI_API_BASE=https://monkgate.vercel.app/v1
export OPENAI_API_KEY=sk-mg-...
aider --model openai/monkgate-nirvanamodels:
- name: Monkgate Nirvana
provider: openai
model: monkgate-nirvana
apiBase: https://monkgate.vercel.app/v1
apiKey: sk-mg-...import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";
const monkgate = createOpenAICompatible({
name: "monkgate",
baseURL: "https://monkgate.vercel.app/v1",
apiKey: process.env.MONKGATE_API_KEY,
});
const result = streamText({ model: monkgate("monkgate-om"), prompt: "Hello" });
for await (const text of result.textStream) process.stdout.write(text);Cline: set the provider to OpenAI Compatible, the base URL to https://monkgate.vercel.app/v1, your key, and a model id such as monkgate-nirvana. Open WebUI: Settings → Connections → OpenAI API, same URL and key; the model list loads by itself.
Privacy
- Prompts and completions are never stored by Monkgate.
- Requests are routed only to inference providers with a zero-data-retention policy that don't train on your data.
- Usage logs hold token counts, the model and the time. Nothing else.
- No email or password. Your wallet is your account.
Be aware: providers still process prompts in memory to answer them, and wallet addresses and payments are public on-chain, permanently.