Create router
POST/v1/routers
Create a router. Its mode is required and can't change afterwards:
proposal: your app sends its request toPOST /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) withmodelset to the router's name, and Emissary serves the model it picks with the provider keys stored on the router. Every enabled model needs aprovider, and every provider the models name needs a key inproviders.
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
- 201
- 400
- 401
- 403
- 409
The created router
The router can't be saved as sent. details names each problem.
Unauthorized error
The API key is not valid
Another of your routers has this name