Skip to main content
POST
cURL
This endpoint returns a decision only. It does not run the selected model or its fallbacks. The routing judgement consumes credits and is bounded by the caller’s model access.Omit models to use the deduplicated union of Chew’s lane chains, not every model the caller may use. Restricted candidates can appear with status: "restricted"; they are never selected or included in fallback_models.Team scope requires actual team membership, even within the same organization. Personal API keys and OAuth are supported; this is not team-key-only.

Authorizations

Authorization
string
header
required

A personal API key or an OAuth 2.0 access token. Personal API keys also require the x-auth-key header with your user ID.

Body

application/json
input
required

The message to route. message is accepted as an alias. A string or an array of {type: text, text: ...} parts.

models
string[]

Candidate model IDs to choose between. IDs must be nonempty, unique after remapping, and registered. Omit to use Chew's lane-chain union.

Required array length: 1 - 50 elements
history
object[]

Prior turns, oldest first, for context.

Maximum array length: 20
agent
object

Optional context about the agent the message is for. Sharper context produces a sharper route.

team_id
string

Scope model availability and credit attribution to a team the caller belongs to.

Response

The routing decision.

router
string

Always gumloop-chew.

route
object
candidates
object[]

Every candidate considered. Restricted candidates are reported, not selected.