While 9Router is built for coding tools, it exposes an OpenAI-compatible endpoint. You can interact with it via Postman to test routing, manage budgets, or check fallback behavior directly.
Here is how to set up and test your 9Router configuration in Postman:
1. 9Router Prerequisites
- Start local proxy: Install and run 9Router using npm:
npm install -g 9router && 9router. - By default, it operates as a local proxy server at
http://localhost:20128/v1.
2. Configure Postman
- Create a New Request: Open Postman, click the "+" icon to create a blank request, and set the method to POST.
- Set the URL: Point your request to the 9Router chat completions endpoint:
http://localhost:20128/v1/chat/completions - Authorization:
- Go to the Authorization tab.
- Select Bearer Token from the type dropdown.
- Paste your
9router_api_key(or the API key of the primary provider you've configured inside 9Router).
3. Setup the Request Body
- Go to the Body tab.
- Select raw and change the format to JSON.
- Paste the following JSON template. You can switch the
"model"field to test how 9Router handles your specific fallback or combo logic:
json
{
"model": "your-model-or-9router-alias",
"messages": [
{
"role": "user",
"content": "Test my 9Router setup by summarizing this git diff: [Test Context]"
}
],
"temperature": 0.7,
"stream": false
}
Gunakan kode dengan hati-hati.
4. Send the Request
Click Send. Postman will forward the request through 9Router, which will automatically compress the input (RTK Token Saver), route to your primary service, or cascade to a cheaper/free tier if your primary limit is reached.
PETIRS