API Quickstart
GWMM is reachable through OpenRouter’s standard OpenAI-compatible interface. Pick a language, copy the snippet, drop in your GWMM direct API key (gw_live_…), and you’re sending requests to a dedicated, single-tenant inference node with Zero Data Retention.
cURL
Zero-dependency smoke test against the chat completions endpoint. Set $GWMM_API_KEY to a gw_live_… direct key (create one in the Console) in your shell, paste, and run.
curl https://api.gwmmai.com/v1/chat/completions \
-H "Authorization: Bearer $GWMM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gwmm/gemma-4-12b-it",
"messages": [{"role": "user", "content": "Say hello in one short sentence."}],
"max_tokens": 64
}'Python (openai SDK)
The official OpenAI Python SDK works against any OpenAI-compatible base URL. Swap the base URL to GWMM, keep your existing direct key.
from openai import OpenAI
client = OpenAI(
base_url="https://api.gwmmai.com/v1",
api_key="$GWMM_API_KEY",
)
resp = client.chat.completions.create(
model="gwmm/gemma-4-12b-it",
messages=[{"role": "user", "content": "Say hello in one short sentence."}],
max_tokens=64,
)
print(resp.choices[0].message.content)API reference
The full OpenAPI schema is available at /openapi.json. Use the embedded reference below for live, auto-generated documentation.
Endpoint reference
| Endpoint | Method | Purpose |
|---|---|---|
| /v1/chat/completions | POST | OpenAI-compatible chat completions |
| /v1/models | GET | List published models with capability and pricing metadata |
| /v1/keys | GET / POST / DELETE | Manage direct API keys |
| /v1/billing | GET | Wallet summary and recent usage |
| /v1/billing/transactions | GET | Wallet ledger transactions |
| /v1/billing/checkout | POST | Create a Stripe Checkout top-up session |
| /v1/billing/portal | POST | Create a Stripe Customer Portal session |
| /v1/usage | GET | Aggregated usage for a time window |
| /v1/requests | GET | Request metadata history (no content) |
| /health | GET | Gateway and backend health status |
| /v1/stats | GET | Public status page payload |
Error codes
GWMM returns OpenAI-compatible error objects. Example shape: &123;"error": &123; "type": "...", "message": "...", "code": "..." &125;&125;
| HTTP | type | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | Malformed request or invalid parameters | Check the request body |
| 401 | invalid_auth | API key invalid, revoked, or session expired | Refresh your key or re-authenticate |
| 402 | insufficient_balance | Wallet + credit below the minimum threshold | Top up your wallet |
| 403 | content_policy / unsupported_region | Content policy violation or sanctioned region | Do not retry; review AUP/Terms |
| 429 | rate_limited | Guest or concurrency limit exceeded | Back off and retry (read Retry-After) |
| 500 | internal_error | Gateway internal error | Retry; contact support if persistent |
| 502 | backend_unavailable | vLLM backend is unreachable | Back off and retry |
| 503 | draining / maintenance | Gateway is draining for maintenance | Retry after the Retry-After interval |
Operational limits
- Concurrency ceiling. 64 simultaneous in-flight requests per API key. Excess returns
HTTP 429. - First-token timeout. 20 s.
- Context window. 28K tokens (input + output combined).
- Precision. FP8, served at advertised precision under load.
- Data retention. Zero. See Privacy Policy for the full architecture.
- Authentication. Direct access requires a
gw_live_…/gw_test_…key (issued via the Console). OpenRouter customers should point athttps://openrouter.ai/api/v1with their OpenRouter key instead.
MCP (Model Context Protocol)
GWMM also exposes an MCP server so AI agents can call it natively. The MCP endpoint is https://api.gwmmai.com/v1/mcp/sse (HTTP/SSE transport).
Available tools:
chat_completion— run a non-streaming chat completionlist_models— list models, context windows, and pricingget_balance— return wallet balance and granted credit
For stdio-only MCP clients, use the bridge script mcp_stdio_bridge.py:
python mcp_stdio_bridge.py https://api.gwmmai.com/v1/mcpUnauthenticated requests are mapped to the acc_guest sandbox (max 64 concurrent, no billing). Authenticated requests use the same Authorization: Bearer header as the HTTP API.