---
title: "exchange.compat-routing@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/exchange.compat-routing"
updated: null
---

# exchange.compat-routing@1 · OpenVibe.Services

HTML: [exchange.compat-routing@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/exchange.compat-routing)

# ExchangeCompatRouting `exchange.compat-routing@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: exchange
- Visibility: public
- Status: active
- Compatibility: backward
- Decision: [ADR-025](/docs/adr/ADR-025)
- Schema: [`https://openvibe.network/contracts/exchange/compat-routing.v1.json`](/docs/contracts/exchange.compat-routing.json)

OpenRouter-compatible model fallback and provider policy controls. Prices are USD per million tokens.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `model` | string |  |  | - `minLength 1`<br>- `maxLength 256` |
| `models` | array of string |  |  | - `minItems 1`<br>- `maxItems 8`<br>- `items: minLength 1`<br>- `items: maxLength 256` |
| `provider` | object |  |  | - `no other fields` |
| `provider.order` | array of string |  |  | - `maxItems 64`<br>- `unique items`<br>- `items: pattern ^[a-zA-Z0-9._-]{1,100}$` |
| `provider.only` | array of string |  |  | - `maxItems 64`<br>- `unique items`<br>- `items: pattern ^[a-zA-Z0-9._-]{1,100}$` |
| `provider.ignore` | array of string |  |  | - `maxItems 64`<br>- `unique items`<br>- `items: pattern ^[a-zA-Z0-9._-]{1,100}$` |
| `provider.allow_fallbacks` | boolean |  |  |  |
| `provider.sort` | enum |  |  | - `one of "price", "throughput", "latency", "quality", "value"` |
| `provider.max_price` | object |  |  | - `no other fields` |
| `provider.max_price.prompt` | number |  |  | - `minimum 0` |
| `provider.max_price.completion` | number |  |  | - `minimum 0` |
| `provider.data_collection` | enum |  |  | - `one of "allow", "deny"` |
| `provider.zdr` | boolean |  |  |  |
| `usage` | object |  |  | - `no other fields` |
| `usage.include` | boolean |  |  |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: example

~~~~
{
  "model": "maker/model:free",
  "models": [
    "maker/backup"
  ],
  "provider": {
    "sort": "value",
    "zdr": true
  },
  "usage": {
    "include": true
  }
}
~~~~

Rejected: example

~~~~
{
  "provider": {
    "sort": "magic"
  }
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('exchange.compat-routing@1', value);   // { valid, errors: [{ path, message }] }
~~~~
