Before touching your first configuration, you need to prepare the foundational skills of AI routing, HTTP/REST, JSON/YAML, and observability, while making sure tools like Node.js, Git, Docker, and your LLM provider credentials are ready in your environment.

Welcome to the Learn 9router series! This series will take you through mastering 9router — the AI routing gateway that manages, directs, and optimizes request traffic to various LLM providers — from conceptual foundations all the way to production-grade patterns. There are 23 episodes in total, arranged into six phases, starting from pre-requisites all the way to production hardening.
But before writing your first configuration file, there are several foundational skills and tools you must have. Why are these prerequisites important? Because 9router is a gateway — it stands between clients and LLM providers, receiving HTTP requests, making routing decisions, then forwarding traffic to the most appropriate model. If you don't yet understand how an HTTP conversation works, or how to read a YAML file, 9router configuration will feel like a mantra that sometimes works and sometimes doesn't.
Imagine wanting to become an airport traffic controller without understanding flight maps and communication protocols. No matter how capable the control tower — and 9router is an extremely capable control tower — it's still hard to direct aircraft without understanding the routes. Episode 0 is your roadmap: we'll prepare the foundational skills, make sure the tools are installed, then complete the LLM provider credentials that will accompany you throughout the series.
AI routing is the practice of deciding which AI model handles a given request. Every request has different needs: some need quick, cheap answers, some need deep reasoning, and some need image analysis or embeddings. 9router reads the request, then selects a model based on criteria such as cost, latency, quality, and business policy.
Model selection is not about picking "the best model", but about picking the model most appropriate for the request context. Sometimes an expensive large model is the wrong choice for a trivial question, and vice versa. From now on, get used to thinking in trade-offs: what you give up (cost, latency) for what you gain (quality, accuracy).
9router is an HTTP service. All traffic flows in and out over the HTTP protocol, so understanding it is a mandatory foundation. Understand the basic shape of the conversation: a request contains a method, path, headers, and sometimes a body; a response contains a status code, headers, and a body.
| Method | Role in the AI Routing Context |
|---|---|
| GET | Reads metadata, status, or health checks |
| POST | Sends a prompt to be routed (most frequently used) |
| PUT / PATCH | Updates a resource such as a route or model |
| DELETE | Deletes a resource |
Also learn the five status code classes: 2xx success, 3xx redirect, 4xx client error (including 429 Too Many Requests during rate limiting), and 5xx server error. The last one matters too, because 9router maps errors from LLM providers to the appropriate status codes.
Beyond request/response, understand webhooks: a callback mechanism where the server sends an HTTP request back to the client when an event occurs. In the 9router context, webhooks are used for example for streaming completions, status notifications, or syncing results to a downstream service.
9router configuration is written in YAML, while requests and responses between services are almost always JSON. You must be comfortable reading and writing both — including remembering that YAML is sensitive to indentation, and that numbers like 0123 can be misinterpreted without quoting.
Then there's the CLI: all 9router operations — project initialization, configuration validation, running a local server, and managing routes — happen through the terminal. Finally, Git workflows: because route config is code, it must be version-controlled, reviewed via pull request, and rolled back when something goes wrong. Note that the YAML format is an ideal baseline for diffing between versions.
An AI gateway without observability is pure guesswork. There are three pillars you must know:
| Pillar | Question It Answers | Example in 9router |
|---|---|---|
| Metrics | How much / how fast? | Requests per second, model latency, error rate |
| Logs | What exactly happened? | Route selected, model called, status code |
| Tracing | How does a request flow? | The journey from client to provider and back |
All three will be covered in depth in episode 7, but from now on get used to reading numbers like latency percentiles and success rates. Prometheus for metrics, a log aggregator for logs, and an OpenTelemetry-based tracing tool for distributed traces are tools you'll encounter often.
There are two ways to start playing with 9router. First, use the hosted platform — log in to the dashboard, create a workspace, and use the provided endpoints. Second, and most recommended for learning, run a local emulator whose behavior is identical to the production platform. The local emulator is available as a Docker image:
docker run -d --name 9router-local -p 8080:8080 \
-e 9ROUTER_MODE=emulator \
ghcr.io/9router/9router:latestThe command above runs the emulator on port 8080. Make sure Docker is running and port 8080 doesn't collide with another service.
9router needs to call LLM providers on your behalf, which requires an API key. Prepare credentials for at least one provider — OpenAI, Azure OpenAI, or Anthropic. Never put a key directly in a configuration file; use environment variables as in the example below:
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export AZURE_OPENAI_API_KEY="..."Important note: the credential values above are examples only. Real keys are secret, so store them in a secret manager or a dot-env file that is never committed to git.
For the editor, VS Code with JSON and YAML extensions is more than enough — the auto-format and schema validation features will save you from indentation errors. For monitoring, set up Prometheus and Grafana to visualize metrics, or use your observability stack of choice. Not mandatory in this episode, but good to install early.
Before moving on to the next episode, make sure all the core tools are installed by running a single verification line:
node --version
npm --version
git --version
docker --version
curl --versionAll the commands above must return a version number, not command not found. If one is missing, install it using your package manager — for example npm install -g @9router/cli for the 9router CLI or sudo apt install docker.io for Docker on Debian-based distros.
Info
The verification command order above sets the baseline: Node.js as the CLI runtime, npm as the package manager, git for version control, Docker for the emulator, and curl for testing HTTP requests. Once these five tools are ready, your environment is ready to follow the entire series.
localhost:8080.In episode 0 you've laid the foundation for the entire series: understanding the basics of AI routing, HTTP/REST and webhooks, JSON/YAML, CLI and Git, and observability; making sure the local emulator and LLM provider credentials are ready; and verifying the core tooling in your environment.
Key takeaways:
In the next episode, episode 1, we'll discuss the history, background, and why the world needs an AI routing gateway — from the evolution of classic load balancers, comparisons of traditional API gateways with service mesh, to real-world use cases of prompt routing and multi-model orchestration. Make sure your environment is ready, because the Learn 9router journey has just begun!