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

# Router Select

> Resolve the Auto Router's model choice for a prompt without running inference.



## OpenAPI

````yaml /api/openapi.json post /v1/router/select
openapi: 3.1.0
info:
  title: MeshAPI
  description: One key, all AI models.
  version: 0.1.0
servers:
  - url: https://api.meshapi.ai
security:
  - BearerAuth: []
paths:
  /v1/router/select:
    post:
      tags:
        - Router
      summary: Router Select
      description: >-
        Resolve the Auto Router's model choice for a prompt without running
        inference.
      operationId: router_select
      parameters:
        - in: header
          name: X-Mesh-Version
          required: false
          schema:
            type: string
            enum:
              - 2026-08
            default: 2026-08
          example: 2026-08
          description: >-
            Dated version of the API contract to pin this request to. Omit it
            and the request is served under `2026-08` — the oldest supported
            version, so an existing integration is never moved by a release. A
            malformed or unsupported value is rejected with `400
            invalid_api_version` rather than falling back silently. The version
            actually served is echoed as `X-Mesh-Version` on every response,
            including errors.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouterSelectRequest'
            examples:
              default:
                summary: Example request
                value:
                  messages:
                    - role: user
                      content: Write a SQL query for monthly revenue.
                  api_type: completions
                  exclude_models:
                    - openai/gpt-4o-mini
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterSelectResponse'
              examples:
                default:
                  summary: Example response
                  value:
                    model: anthropic/claude-haiku-4.5
                    auto_router:
                      selected: true
                      strategy: registry
                      reason: Best latency-adjusted fit for the prompt and API type.
                    reasoning_effort: none
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    RouterSelectRequest:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          minItems: 1
          title: Messages
        api_type:
          type: string
          enum:
            - completions
            - responses
            - embeddings
          title: Api Type
          default: completions
        exclude_models:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exclude Models
        candidate_models:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Candidate Models
      type: object
      required:
        - messages
      title: RouterSelectRequest
    RouterSelectResponse:
      properties:
        model:
          type: string
          title: Model
        auto_router:
          $ref: '#/components/schemas/AutoRouterMeta'
        reasoning_effort:
          anyOf:
            - type: string
              enum:
                - high
                - medium
                - low
                - none
            - type: 'null'
          title: Reasoning Effort
      type: object
      required:
        - model
        - auto_router
      title: RouterSelectResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Message:
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ContentPart'
              type: array
            - type: 'null'
          title: Content
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolCall'
              type: array
            - type: 'null'
          title: Tool Calls
        reasoning_details:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Reasoning Details
        cache_control:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Cache Control
      type: object
      required:
        - role
      title: Message
    AutoRouterMeta:
      properties:
        fallback_used:
          type: boolean
          title: Fallback Used
          default: false
        fallback_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Fallback Reason
      type: object
      title: AutoRouterMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContentPart:
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
            - video_url
            - input_audio
          title: Type
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        image_url:
          anyOf:
            - $ref: '#/components/schemas/ImageUrl'
            - type: 'null'
        video_url:
          anyOf:
            - $ref: '#/components/schemas/VideoUrl'
            - type: 'null'
        input_audio:
          anyOf:
            - $ref: '#/components/schemas/InputAudio'
            - type: 'null'
        fps:
          anyOf:
            - type: string
            - type: 'null'
          title: Fps
        cache_control:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Cache Control
      type: object
      required:
        - type
      title: ContentPart
    ToolCall:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: function
          title: Type
          default: function
        function:
          additionalProperties: true
          type: object
          title: Function
        thought_signature:
          anyOf:
            - type: string
            - type: 'null'
          title: Thought Signature
      type: object
      required:
        - id
        - function
      title: ToolCall
    ImageUrl:
      properties:
        url:
          type: string
          title: Url
        detail:
          type: string
          enum:
            - auto
            - low
            - high
          title: Detail
          default: auto
      type: object
      required:
        - url
      title: ImageUrl
    VideoUrl:
      properties:
        url:
          type: string
          title: Url
      type: object
      required:
        - url
      title: VideoUrl
    InputAudio:
      properties:
        data:
          anyOf:
            - type: string
            - type: 'null'
          title: Data
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        format:
          type: string
          enum:
            - wav
            - mp3
            - aiff
            - aac
            - ogg
            - flac
            - m4a
            - pcm16
            - pcm24
          title: Format
      type: object
      required:
        - format
      title: InputAudio
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter your MeshAPI key (`rsk_...`) — sent as `Authorization: Bearer
        <key>`.

````