---
title: "Invoke a model with routing"
method: POST
path: "/v1/model-router/invoke"
tags: ["model-router"]
---

# Invoke a model with routing

`POST /v1/model-router/invoke`

## Request body

- InvokeRequest
  - `messages` MessageInput[], required
    - `role` string, required
    - `content` string, required
  - `router_config_id` string, uuid, nullable
  - `config_overrides` object, nullable
  - `session_id` string, uuid, nullable
  - `smart_routing` boolean

## Response `200`

Successful Response

- ModelResponse
  - `content` string, required
  - `model_identifier` string, required
  - `provider` string, required
  - `input_tokens` integer, required
  - `output_tokens` integer, required
  - `total_tokens` integer, required
  - `input_cost_usd` number, required
  - `output_cost_usd` number, required
  - `total_cost_usd` number, required
  - `latency_ms` integer, required
  - `tool_calls` object[], nullable
  - `routing_metadata` SmartRoutingMetadata
    - `classifier_model` string, required
    - `classifier_tier` 'economy' | 'standard' | 'premium', required
    - `classifier_confidence` number, required
    - `recommended_model` string, required
    - `executed_model` string, required
    - `candidate_chain` string[], required
    - `reason` string, required
  - `parsed_output` object, nullable
  - `execution_engine` 'pydantic_text' | 'pydantic_tools' | 'pydantic_structured'
  - `cache_read_input_tokens` integer
  - `cache_creation_input_tokens` integer
  - `cache_hit` boolean
  - `route_decision_id` string, nullable

## Other responses

- `400` — Bad request
- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/oneloop-hq/apis/feather-api.md) · [All operations](https://skmtc.net/oneloop-hq/apis/feather-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oneloop-hq/feather-api/versions/888bdd5c076e/schema)
