# Tool routing

> Choose between your own keys and Clonvo credits for a call, and when Clonvo moves on.

Without a `provider` object, Clonvo tries the providers you have a key for in the tool’s default order (the order of `providers` in [`GET /v1/tools`](https://clonvo.com/docs/calling-tools.md#list-tools)), then Clonvo credits. Add one to the call’s body to change that for a call:

| Field | Description |
| --- | --- |
| `order` | Try these providers first, in this order. Providers you leave out come after them in the default order. |
| `only` | Use only these providers. |
| `ignore` | Never use these providers. |
| `allow_fallbacks` | Try the next provider when one fails with an error worth retrying. Default `true`. With `false`, Clonvo uses only the first provider in the list (trying each of your keys for it); if that’s an own-key provider you have no key for, the call fails. |

`order`, `only` and `ignore` take [provider ids](https://clonvo.com/docs/tool-keys.md#provider-ids): your own-key providers, and `clonvo` for Clonvo credits. `clonvo` works like any other provider: `{"order": ["clonvo"]}` tries Clonvo credits first, and `{"ignore": ["clonvo"]}` keeps calls on your own keys.

```json
{
  "arguments": { "url": "https://example.com/pricing" },
  "provider": { "ignore": ["clonvo"] }
}
```

Own-key providers take part only with an enabled key, and `clonvo` only when your balance is above zero. With several keys for one provider, Clonvo tries them oldest first, as for [model keys](https://clonvo.com/docs/byok.md#how-requests-are-routed). Unknown provider ids in `order`, `only` or `ignore` fail the call with `400`.

Turn on **Always use this key** for a tool key and, when that key fails, Clonvo returns the error instead of moving on to another provider.

Over MCP, put the same object in the call’s `_meta` under `com.clonvo/provider`; see [MCP](https://clonvo.com/docs/mcp.md#routing-preferences).

## When Clonvo moves on

| What happened | Falls back? |
| --- | --- |
| The provider rejected the key (`401`, `403`) | Yes, to your next key, then the next provider. The error is shown on the key under **Provider keys**. |
| The provider account is out of credits or over its plan limit | Yes |
| Rate limit, timeout, server error, or the provider couldn’t read the page | Yes |
| The provider rejected the request itself (another `4xx`) | No. The error is returned straight away. |
| Clonvo credits are unavailable or busy, or the call couldn’t be served on credits | Yes, to your next provider if `clonvo` wasn’t last. |

If every provider fails, you get the error from the last one. Only the call that succeeded counts toward your allowance or is charged to credits; failed attempts cost nothing on Clonvo.
