Guide
Build a thin HTTP service that wraps the LLM API. Your clients call your endpoint. Your service adds the API key, applies rate limits, caches frequent requests, and returns the response. Deploy it as a standard API and manage it from the CLI.
You want to use OpenAI, Anthropic, or another LLM API in your product, but you do not want to expose your API key to clients. You need a proxy that adds authentication, rate limiting, caching, and custom prompts on top of the raw LLM API. Building this as a standalone service is the standard pattern.
Calling OpenAI or Anthropic directly from your frontend exposes your API key. Even from a backend, every service that needs LLM access needs its own API key management. A wrapper centralizes access: one service holds the key, enforces rate limits, caches responses, adds custom system prompts, and logs usage. All other services call your wrapper.
At minimum: an HTTP endpoint that proxies requests to the LLM, environment variables for API keys, and HTTPS. Better: response caching (save money on repeated queries), rate limiting (prevent abuse), custom system prompts (add context without client-side changes), usage logging (track costs per user), and multi-model routing (try GPT-4o, fall back to Claude).
Client sends POST /api/chat with a prompt. Your wrapper adds the system prompt, checks the cache, calls OpenAI if cache misses, stores the response, logs the usage, and returns the result. Total code: under 100 lines in Express or FastAPI.
Pros
Cons
Best for: Teams that need custom logic on top of LLM APIs
Pros
Cons
Best for: Teams that need a gateway without building one
Pros
Cons
Best for: Simple proxying without custom business logic
Here is how to do it step by step using CreateOS CLI.
A thin Express server that proxies OpenAI with a custom system prompt. Under 50 lines of code.
Deploy like any Node.js app. The CLI auto-detects Express and handles the rest.
Your API key lives on the server. Clients never see it.
Scale up when traffic increases. Scale down when it does not.
Modern CLI tools let you deploy directly from the terminal with a single command. No browser, no dashboard, no clicking. Push code, see build logs stream in real time, and get a live URL printed back to your terminal.
Read guideCLI tools let you set, list, remove, and sync environment variables directly from the terminal. The best tools support pulling remote variables to a local .env file and pushing local files to remote, so your development and production environments stay in sync.
Read guideDeploy your AI agent as an API service. Package it as a standard HTTP server (Express, FastAPI, Flask), deploy with a CLI command, and get a live URL. The agent becomes a callable endpoint that other applications, users, or even other agents can interact with.
Read guideGet product updates, builder stories, and early access to features that help you ship faster.
CreateOS is a unified intelligent workspace where ideas move seamlessly from concept to live deployment, eliminating context-switching across tools, infrastructure, and workflows with the opportunity to monetize ideas immediately on the CreateOS Marketplace.