- OAuth for clients that complete a browser-based sign-in flow
- API keys for direct REST, Claude Code, raw MCP clients, and local scripts
- Supabase session JWTs for first-party Memex web, extension, and mobile traffic
https://memex.garden/api/checkout uses Memex bearer auth. Send the
same bearer token the agent uses for authenticated Memex requests.
Choose the right auth flow
OAuth
Use OAuth when the client expects a browser-based sign-in flow and sends bearer tokens after authorization. Memex publishes:- auth server metadata at
https://memex.garden/api/.well-known/oauth-authorization-server - public API protected resource metadata at
https://memex.garden/api/.well-known/oauth-protected-resource - MCP protected resource metadata at
https://memex.garden/api/.well-known/oauth-protected-resource/mcp
api:readapi:write
https://memex.garden/api/mcp when the granted scopes are sufficient.
API key
Use API keys for:- direct REST calls
- the Codex plugin bundle
- local Claude Code setups
- raw MCP clients that can send custom headers or query parameters
- local scripts and hooks
X-Api-Key header:
userId is optional when you already have it:
Supabase session JWT
First-party Memex browser, extension, and mobile clients can also use:Human setup
- Sign up or sign in at
https://memex.garden/auth. - Open
https://memex.garden/dashboard?settings. - Go to MCP server.
- Click Generate Key if needed, then copy your API Key.
- Reuse that key for direct REST calls, Claude Code, raw MCP clients, OpenClaw, and copyable skills.
Agent setup
If you are writing an agent workflow that stores long-lived credentials, use this order:- Check whether
MEMEX_API_KEYis already stored in the agent config. - If it is missing, ask the human for their existing Memex API key first.
- If the API key is not available, leave it empty and ask the human for an email address so you can sign up on their behalf.
- If your runtime has access to
x-agent-service-token, callPOST https://memex.garden/api/agent-create-user. - Return the new
apiKeyto the human and store it in the agent config for future runs. - If your runtime does not have
x-agent-service-token, send the human tohttps://memex.garden/auth, then ask them to copy API Key from Settings -> MCP server.
Agent signup request
This endpoint is for agent runtimes that have the service token:Troubleshooting
- Claude plugin redirects to
localhostand Safari cannot connect: return to Claude and retry the plugin connection. The local callback only works while Claude is waiting for the OAuth result. - Codex or local Claude Code setup is missing credentials: export
MEMEX_BEARER_TOKENorMEMEX_API_KEYbefore launching the client. - Missing or stale API key: regenerate the key in Settings -> MCP server.
401 UnauthorizedorAuthentication required: verify that the bearer token or API key matches the auth mode expected by that client.401 Unauthorizedfrom/checkout: send the same Memex API key or OAuth bearer token the agent uses for MCP.- Next step after auth: Available endpoints
- If the response says credits are exhausted: Buy credits

