> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gumloop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Route a message to a model

> Ask Gumloop Chew — the model router behind **Auto** — which model it would use for a given
message, and why. Chew is a router, not a model: `router` is always `gumloop-chew`, and the
concrete model it selected is `route.model`.

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.




## OpenAPI

````yaml post /models/route
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /models/route:
    post:
      tags:
        - Models
      summary: Route a message to a model
      description: >
        Ask Gumloop Chew — the model router behind **Auto** — which model it
        would use for a given

        message, and why. Chew is a router, not a model: `router` is always
        `gumloop-chew`, and the

        concrete model it selected is `route.model`.


        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.
      operationId: routeModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                input:
                  description: >-
                    The message to route. `message` is accepted as an alias. A
                    string or an array of `{type: text, text: ...}` parts.
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                models:
                  type: array
                  maxItems: 50
                  minItems: 1
                  uniqueItems: true
                  description: >-
                    Candidate model IDs to choose between. IDs must be nonempty,
                    unique after remapping, and registered. Omit to use Chew's
                    lane-chain union.
                  items:
                    type: string
                history:
                  type: array
                  maxItems: 20
                  description: Prior turns, oldest first, for context.
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                      content:
                        description: >-
                          Message text, as a string or text parts. `input` and
                          `message` are accepted as aliases.
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: object
                      model:
                        type: string
                        maxLength: 200
                        description: >-
                          The model that produced this turn. Assistant messages
                          only.
                agent:
                  type: object
                  additionalProperties: false
                  description: >-
                    Optional context about the agent the message is for. Sharper
                    context produces a sharper route.
                  properties:
                    name:
                      type: string
                      maxLength: 200
                    description:
                      type: string
                      maxLength: 2000
                    system_prompt:
                      type: string
                      maxLength: 20000
                team_id:
                  type: string
                  description: >-
                    Scope model availability and credit attribution to a team
                    the caller belongs to.
              required:
                - input
      responses:
        '200':
          description: The routing decision.
          content:
            application/json:
              schema:
                type: object
                properties:
                  router:
                    type: string
                    description: Always `gumloop-chew`.
                  route:
                    type: object
                    properties:
                      model:
                        type: string
                        description: The model Chew selected.
                      lane:
                        type: string
                        description: >-
                          The capability lane of the selected model (`micro`,
                          `light`, `standard`, `plus`, or `max`).
                      verdict_lane:
                        type: string
                        description: >-
                          The lane the message was judged to need, before any
                          adjustment.
                      adjustment:
                        type: string
                        nullable: true
                        description: '`escalated`, `downgraded`, or null.'
                      reasoning_effort:
                        type: string
                        nullable: true
                      fallback_models:
                        type: array
                        description: >-
                          Eligible models to try, in order, if the selected one
                          is unavailable. Restricted candidates are excluded.
                        items:
                          type: string
                      fail_closed:
                        type: boolean
                        description: >-
                          True when routing could not complete and a safe
                          default was used.
                  candidates:
                    type: array
                    description: >-
                      Every candidate considered. Restricted candidates are
                      reported, not selected.
                    items:
                      type: object
                      properties:
                        requested_model:
                          type: string
                        model:
                          type: string
                        lane:
                          type: string
                        basis:
                          type: string
                          description: >-
                            How the lane was assigned (`catalog`, `price`, or
                            `rating`).
                        status:
                          type: string
                          description: '`eligible` or `restricted`.'
              examples:
                route:
                  summary: Illustrative routing decision
                  value:
                    router: gumloop-chew
                    route:
                      model: gpt-5.6-luna
                      lane: light
                      verdict_lane: light
                      adjustment: null
                      fallback_models:
                        - claude-opus-5
                      fail_closed: false
                    candidates:
                      - requested_model: claude-opus-5
                        model: claude-opus-5
                        lane: plus
                        basis: catalog
                        status: eligible
                      - requested_model: gpt-5.6-luna
                        model: gpt-5.6-luna
                        lane: light
                        basis: catalog
                        status: eligible
        '400':
          description: >-
            Invalid request body, unknown model IDs, duplicate IDs after
            remapping, or extra properties.
        '401':
          description: Unauthorized — missing or invalid API key.
        '402':
          description: Credit limit exceeded.
        '403':
          description: >-
            Forbidden — Chew is restricted, no supplied candidate is permitted,
            or the caller is not a member of the requested team.
        '404':
          description: User profile not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl -X POST 'https://api.gumloop.com/api/v1/models/route' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{
                "input": "Summarize this email thread",
                "models": ["claude-opus-5", "gpt-5.6-luna"]
              }'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````