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

# Invoke a model with routing



## OpenAPI

````yaml /api-reference/openapi.json post /v1/model-router/invoke
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/model-router/invoke:
    post:
      tags:
        - model-router
      summary: Invoke a model with routing
      operationId: invokeModel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvokeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    InvokeRequest:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/MessageInput'
          type: array
          title: Messages
        router_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Router Config Id
        config_overrides:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config Overrides
        session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Session Id
        smart_routing:
          type: boolean
          title: Smart Routing
          default: false
      type: object
      required:
        - messages
      title: InvokeRequest
    ModelResponse:
      properties:
        content:
          type: string
          title: Content
        model_identifier:
          type: string
          title: Model Identifier
        provider:
          type: string
          title: Provider
        input_tokens:
          type: integer
          title: Input Tokens
        output_tokens:
          type: integer
          title: Output Tokens
        total_tokens:
          type: integer
          title: Total Tokens
        input_cost_usd:
          type: number
          title: Input Cost Usd
        output_cost_usd:
          type: number
          title: Output Cost Usd
        total_cost_usd:
          type: number
          title: Total Cost Usd
        latency_ms:
          type: integer
          title: Latency Ms
        tool_calls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tool Calls
        routing_metadata:
          anyOf:
            - $ref: '#/components/schemas/SmartRoutingMetadata'
            - type: 'null'
        parsed_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parsed Output
        execution_engine:
          type: string
          enum:
            - pydantic_text
            - pydantic_tools
            - pydantic_structured
          title: Execution Engine
          default: pydantic_text
        cache_read_input_tokens:
          type: integer
          title: Cache Read Input Tokens
          default: 0
        cache_creation_input_tokens:
          type: integer
          title: Cache Creation Input Tokens
          default: 0
        cache_hit:
          type: boolean
          title: Cache Hit
          default: false
        route_decision_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Route Decision Id
      type: object
      required:
        - content
        - model_identifier
        - provider
        - input_tokens
        - output_tokens
        - total_tokens
        - input_cost_usd
        - output_cost_usd
        - total_cost_usd
        - latency_ms
      title: ModelResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageInput:
      properties:
        role:
          type: string
          title: Role
        content:
          type: string
          title: Content
      type: object
      required:
        - role
        - content
      title: MessageInput
    SmartRoutingMetadata:
      properties:
        classifier_model:
          type: string
          title: Classifier Model
        classifier_tier:
          type: string
          enum:
            - economy
            - standard
            - premium
          title: Classifier Tier
        classifier_confidence:
          type: number
          title: Classifier Confidence
        recommended_model:
          type: string
          title: Recommended Model
        executed_model:
          type: string
          title: Executed Model
        candidate_chain:
          items:
            type: string
          type: array
          title: Candidate Chain
        reason:
          type: string
          title: Reason
      type: object
      required:
        - classifier_model
        - classifier_tier
        - classifier_confidence
        - recommended_model
        - executed_model
        - candidate_chain
        - reason
      title: SmartRoutingMetadata
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````