Skip to main content
1Router X.com

Principles

In the future, there will be many models - from language to image - and providers. How will you pick the best one?

Price and Performance

1Router finds the best prices and speeds from various providers, letting you decide what matters most.

Seamless API

Switch between models easily without changing your code, and let users choose and pay for their own options.

Usage Over Evals

The most popular models will be used more often. Compare them based on real usage instead of flawed evaluations.

Chatroom Feature

Interact with multiple models at once in the Chatroom for a more dynamic experience.

Quick Start

To get started, you can use 1Router via API like this:
fetch("https://1router.com/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${1ROUTER_API_KEY}`,
    "HTTP-Referer": `${YOUR_SITE_URL}`, // Optional, for including your app on 1router.com rankings.
    "X-Title": `${YOUR_SITE_NAME}`, // Optional. Shows in rankings on 1router.com.
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "meta-llama/llama-3.1-405b-instruct",
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  })
});

You can also use 1Router with OpenAI’s client API:
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://1router.com/api/v1",
  apiKey: $ROUTER_API_KEY,
  defaultHeaders: {
    "HTTP-Referer": $YOUR_SITE_URL, // Optional, for including your app on 1router.com rankings.
    "X-Title": $YOUR_SITE_NAME, // Optional. Shows in rankings on 1router.com.
  }
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: "meta-llama/llama-3.1-405b-instruct",
    messages: [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  });

  console.log(completion.choices[0].message);
}

main();