OpenAI-compatible API gateway
Point OpenAI-shaped SDKs and coding agents at https://monkeytheme.com/v1, authenticate with a MonkeyAI key, then pick model ids from GET /v1/models. Compatibility is about HTTP shape and auth — not a free pass on every vendor-specific feature.
Direct answer
An OpenAI-compatible API gateway lets tools that already speak OpenAI's HTTP shape point at a different host. On MonkeyAI that host is https://monkeytheme.com/v1: same style of Bearer auth and /v1/... paths, with model routing handled behind the gateway.
| Item | MonkeyAI value |
|---|---|
| Public Base URL | https://monkeytheme.com/v1 (include /v1) |
| Auth (measured error text) | Authorization: Bearer, or x-api-key, or x-goog-api-key |
| First safe probe | GET /v1/models with your key |
| Hostname in this guide | monkeytheme.com only |
What we measured on production (no user key)
Probes hit public https://monkeytheme.com on 2026-08-04. No customer key was used. JSON bodies are summarized from live responses.
| Request | HTTP | Body signal | What it shows |
|---|---|---|---|
GET /v1/models (no auth) | 401 | API_KEY_REQUIRED | Models route exists behind auth |
POST /v1/chat/completions (no auth) | 401 | API_KEY_REQUIRED | Chat Completions path is live |
POST /v1/responses (no auth) | 401 | API_KEY_REQUIRED | Responses path is live |
POST /v1/messages (no auth) | 401 | API_KEY_REQUIRED | Messages-shaped path hits the same auth layer |
GET /models (site root, no /v1) | 404 | nginx HTML | Wrong base without /v1 is not the API |
/v1/models check on your account.When a gateway is the right fit
Good fit
- SDKs and agents that already take a custom Base URL
- Teams that want one key surface for multiple model families
- Coding tools (Codex CLI, Cline, Roo Code, Hermes) that speak OpenAI-compatible HTTP
- Apps that need one ops path for 401 / 429 / 504 handling
Check first
- Claude-only clients that hard-code Anthropic field names
- Features that only exist on one vendor's proprietary surface
- Clients that silently double
/v1or strip it - Any claim about a model id you have not seen in
/v1/models
Setup path that sticks
- Create a key in the MonkeyAI dashboard. Keep it out of git and chat logs.
- Set Base URL to
https://monkeytheme.com/v1— not the bare site root. - Run
GET /v1/models. A valid key should return a JSON model list. - Copy a model id exactly as listed (case and punctuation matter).
- Send one short
/v1/chat/completionsrequest. - Only then point Codex CLI, Cline, Roo Code, Hermes, or your app at the same Base URL + key + model id.
# 1) Prove auth + routing (replace *** ; never commit real keys)
curl -sS https://monkeytheme.com/v1/models \
-H "Authorization: Bearer ***" | head -c 800
# 2) One small completion after models works
curl -sS https://monkeytheme.com/v1/chat/completions \
-H "Authorization: Bearer ***" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID_FROM_LIST","messages":[{"role":"user","content":"ping"}],"max_tokens":32}'
# 3) Wrong base (for contrast) — site root /models is not the API
curl -sS -o /dev/null -w "%{http_code}\n" https://monkeytheme.com/models
What “compatible” usually maps to
| Client expectation | Typical mapping on MonkeyAI |
|---|---|
OpenAI SDK base_url / baseURL | https://monkeytheme.com/v1 |
api_key | MonkeyAI dashboard key |
GET .../models | https://monkeytheme.com/v1/models |
| Chat Completions | https://monkeytheme.com/v1/chat/completions |
| Responses-style clients | https://monkeytheme.com/v1/responses (path is auth-gated; feature depth still needs your own tests) |
| Model selection | Per-request model id from your visible list |
For Anthropic-shaped tools, do not assume every field is interchangeable with OpenAI names. Prefer the Claude Code gateway guide when the client is Messages-first.
Failure classes gateway users hit first
| Symptom | Likely class | First move |
|---|---|---|
401 API_KEY_REQUIRED | No accepted key header reached the API | Fix env/export/header; see 401 guide |
401 INVALID_API_KEY | Value present but rejected | Re-copy key; confirm host is monkeytheme.com |
404 HTML on /models | Base URL missing /v1 | Use https://monkeytheme.com/v1; see Base URL guide |
| Model not found | Auth ok; id wrong or not entitled | Re-read /v1/models |
| 429 | Rate or quota | Honor Retry-After; see 429 guide |
| 504 / client timeout | Upstream or wait budget | See 504 / SDK timeout guides |
Security and ops habits
- Keep keys server-side or in trusted local env files — not public frontend bundles.
- Prefer one key per person or service when you need clean revocation.
- When escalating, share endpoint, UTC time, HTTP status, JSON
code/message, and request id headers if present — not the full key. - After changing agent config, restart the process or open a fresh session so the new Base URL actually loads.
FAQ
Is MonkeyAI an OpenAI-compatible API gateway?
Yes for common OpenAI-shaped clients. Public Base URL is https://monkeytheme.com/v1. On 2026-08-04, unauthenticated probes to /v1/models, /v1/chat/completions, /v1/responses, and /v1/messages all returned HTTP 401 with code API_KEY_REQUIRED, which shows those routes are live behind auth on this host.
Should the Base URL include /v1?
Yes for OpenAI-compatible clients and SDKs that append paths like /models or /chat/completions. Use https://monkeytheme.com/v1. Calling https://monkeytheme.com/models without /v1 returned HTTP 404 HTML from nginx in the same probe set.
Does a gateway remove the need for model names?
No. Base URL and API key only get the request accepted by the auth layer. You still send a model id that your account can see. Confirm ids with GET /v1/models after attaching a real key.
Can one key call GPT and Claude through the gateway?
One MonkeyAI key authenticates to the gateway. Which GPT or Claude ids succeed depends on account and group entitlements. Do not invent nicknames; copy exact ids from /v1/models. See the one-key GPT+Claude guide for the multi-model workflow.
What does OpenAI-compatible not guarantee?
It does not guarantee every Claude-native client field, every Responses-only feature, or every coding agent's tool loop without checking that client. Compatibility means common /v1 shapes and auth patterns — not a blank check for every vendor-specific surface.