Skip to main content

Create router

POST 

/v1/routers

Create a router. Its mode is required and can't change afterwards:

  • proposal: your app sends its request to POST /v1/route, gets back the router's ranked candidates, and calls the chosen model itself, with its own keys. A Proposal Mode router takes no providers or keys.
  • gateway: your app sends its requests to the gateway (https://api.withemissary.com/gateway) with model set to the router's name, and Emissary serves the model it picks with the provider keys stored on the router. Every enabled model needs a provider, and every provider the models name needs a key in providers.

A model entry needs only its name (and, on a gateway router, its provider). What it leaves out comes from the router model's catalog (GET /v1/router-models): prices, context window, vision support, and model_id (the model's name on a Proposal Mode router, its id at the chosen provider on a gateway router).

Request​

Responses​

The created router