﻿# Keep an OpenRouter tool conversation portable across eligible routes

Preserve OpenRouter tool-call history across routed requests by retaining call identifiers, assistant records and matching results in the chosen API contract.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-openrouter-tool-history-routing/
Language: en

An application often sends another inference request after executing a client tool. OpenRouter can route that request across eligible providers, but the client still owns coherent conversation history. The tool-calling documentation makes the sequence explicit: request a tool, execute it in the application and return the result through the matching protocol structure.

## Preserve the original assistant request

For a hypothetical catalog lookup, keep the assistant record that requested the lookup, including its call identifier and arguments. The result should not appear as an unexplained paragraph detached from the operation. The model needs the relationship between question, proposed call and observation. Preserving the original request also lets the application audit whether it executed the requested operation or substituted something else during validation.

## Return the result with the matching identity

Responses uses function-call output items associated with their call identifier. Chat Completions uses tool messages tied to the requested tool call. Use the shape documented for the active endpoint. If the model proposed several lookups, each returned observation must be matched to the correct request. Array order alone is a fragile substitute when independent operations can finish in a different order.

## Keep tool support in the eligible route

A route used for continuation must support the tool workflow the client is sending. Consult model and endpoint capabilities and apply required-parameter controls where the contract needs them. A provider switch should not silently convert a structured tool history into a text-only approximation. The shared interface reduces adaptation work, but it does not eliminate the need to verify the specific capabilities required by the conversation.

## Preserve dependent reasoning state when required

Some reasoning-capable workflows return continuation material alongside tool requests. Preserve it according to the relevant reasoning documentation rather than stripping everything except the visible function call. Keep opaque fields unchanged. For the catalog example, the application adds the actual lookup result while retaining the protocol items the model returned. A simplified chat transcript may be suitable for display but insufficient for the next inference request.

## Test a routed continuation as a whole

Use a harmless catalog fixture to test the first tool request, application result and final response. Exercise the client’s serialization boundary, including multiple calls if the product supports them. Confirm that an execution error is represented as such instead of a successful empty lookup. The test verifies the application’s history handling; it should not claim that every provider or future model version behaves identically without its own current compatibility evidence.

## Documentation and further study

- [Tool & Function Calling - Use Tools with OpenRouter](https://openrouter.ai/docs/guides/features/tool-calling).

- [OpenRouter API Reference - Complete Documentation](https://openrouter.ai/docs/api-reference/overview).

- [Provider Routing - Smart Multi-Provider Request Management](https://openrouter.ai/docs/guides/routing/provider-selection).

Related engineering guides: [Tool calling through OpenRouter: the model proposes, your app executes](/journal/openrouter-tool-calling/); [OpenRouter provider routing: defining permitted routes](/journal/openrouter-provider-routing/).
