Free forever, no credit card.Get Started for Free →
← All posts
November 30, 2026 · 6 min read

Does OpenRouter Remember Between Sessions?

Does OpenRouter Remember Between Sessions? No. OpenRouter does not remember anything between sessions, or even between two requests in the same session. Every request is independent: OpenRouter keeps no conversation state on its servers, so the only history a model sees is the history your own code includes in that request. If you do not send it, the model has never seen it. That is a design choice, not a missing feature. OpenRouter is a routing layer: one OpenAI-compatible API in front of hun

Does OpenRouter Remember Between Sessions?

No. OpenRouter does not remember anything between sessions, or even between two requests in the same session. Every request is independent: OpenRouter keeps no conversation state on its servers, so the only history a model sees is the history your own code includes in that request. If you do not send it, the model has never seen it.

That is a design choice, not a missing feature. OpenRouter is a routing layer: one OpenAI-compatible API in front of hundreds of models from many providers. It picks a provider, forwards your request, returns the response, and forgets the exchange. Remembering what your agent said yesterday is a job it deliberately leaves to you.

What does OpenRouter actually keep?

Less than most builders expect, and none of it is conversation memory.

OpenRouter's Responses API documentation states it plainly: the API is stateless only, each request is independent, and no conversation state is persisted between requests. Requests that set store: true or pass a non-null previous_response_id are rejected with a 400 error. The two switches other APIs offer for server-side conversation storage are not just off here; they are refused.

What OpenRouter does hold is routing state. For prompt caching, it remembers which provider served a recent request and routes follow-ups for the same model to the same provider, so a provider-side cache stays warm. A sticky session expires after about 60 minutes of inactivity, and you can pin it explicitly with a session_id. That is a delivery optimization. It carries no messages, no facts, and no understanding of your user. When the timer lapses, nothing about your conversation survives, because nothing about it was ever stored.

Why does every OpenRouter chatbot tutorial start with a messages list?

Because the list is the memory. The standard pattern in every OpenRouter integration guide is the same: keep an array of messages in your own code, append each user message and each assistant reply, and send the whole array with every new request. The model appears to remember the conversation because your application re-sends the transcript, in full, every turn, and pays for those input tokens every turn.

This works inside one running process. It breaks in the places real agents live:

  1. The process restarts. A redeploy, a crash, or a scaled-down container takes the in-memory list with it.
  2. The work is scheduled. A cron job or a queue worker starts as a fresh process, so last night's run is invisible to this morning's run.
  3. The user switches tools or models. A transcript stored inside one app is not readable by another app, and a history tied to one model does not follow the user when routing moves them to a different one.
  4. The transcript grows. Re-sending everything gets slower and more expensive, and eventually the history has to be trimmed, which quietly deletes the oldest context first.

None of this is an OpenRouter defect. It is the expected shape of a stateless gateway. The gap appears when a builder assumes the gateway is also the memory.

What should you store yourself, at minimum?

If you build on OpenRouter, plan a memory store from day one rather than after the first amnesia bug report. A workable minimum looks like this:

  1. Give every user or agent run a stable ID. Every read and write keys off that ID, never off a request or a connection.
  2. Save each exchange after the response returns. Store the user message and the assistant reply, with the model used and a timestamp.
  3. Load before you call. Before each new request, retrieve the exchanges that are relevant to the current prompt and place them in the messages you send.
  4. Retrieve by relevance, not by dumping the archive. Semantic search finds the exchange where the user stated a preference even when the wording differs, and keyword search catches exact strings like order IDs and policy names.
  5. Let the newest correction win. When a user changes a decision, the latest saved version is the one the next session should see, so you correct the record once instead of in every client.

Steps 1 to 3 are an afternoon of work for a single chatbot. Steps 4 and 5 are where hand-rolled memory usually stalls, because relevance ranking and conflict handling are a product of their own.

How do you give an OpenRouter agent memory that survives sessions?

Connect the agent to a memory layer that lives outside the request path. Vilix AI is built for exactly that split: OpenRouter keeps routing requests to whichever model fits, and Vilix AI holds the memory those requests draw on.

The connection is one header. A built agent connects to https://api.vilix.ai/mcp with its API key sent as a Bearer header, the same pattern used for headless agents, and gets memory tools alongside its model calls. Before a run, the agent loads relevant saved context with get_context; after the exchange, it saves the turn with save_turn. Retrieval is semantic and keyword-based at the same time, so recall finds what the user meant and still matches exact strings literally. Retrieval is also recency-aware: when two saved memories conflict, the most recently saved one is what the agent sees.

Because the memory sits outside any one app, the same store serves every client connected to the account: the agent you ship, and the tools you build it with, such as Claude, Codex, and Cursor. A decision saved during a planning session in one tool is readable by the scheduled agent that acts on it later, whichever model OpenRouter routes that run to. Memory can be listed, edited, and deleted through the connected tools or the dashboard at app.vilix.ai, and the full memory can be exported in a portable format at any time. Plans start with a free tier, and a 7-day free trial of Pro needs no credit card.

Frequently asked questions

Does OpenRouter store my prompts or conversations?

No conversation state is persisted between requests. Its Responses API rejects store: true and previous_response_id, and each request must include the full conversation history your code wants the model to see.

What is a session_id in OpenRouter, if not memory?

It is a sticky-routing key. It pins follow-up requests to the same provider endpoint so prompt caching works better. It stores no messages and expires after roughly 60 minutes of inactivity.

Does switching models through OpenRouter carry my history across?

Only the history your code sends. OpenRouter routes each request independently, so a new model sees exactly the messages included in that request and nothing from earlier requests to a different model.

Can prompt caching replace memory?

No. Prompt caching reuses computation on a repeated prefix to cut cost and latency. It does not store facts, decisions, or user preferences, and a cache entry is not something your next session can search or correct.

What is the fastest way to add memory to an agent built on OpenRouter?

Connect the agent to an external memory layer over MCP, load relevant context before each run, and save each exchange after it. That keeps memory alive across restarts, schedules, tools, and model switches, instead of tying it to one process or one transcript array.

Get Started for Free

Persistent memory across ChatGPT, Claude, and the AI tools you already use in Vilix AI.

Get Started for Free

Free forever, no credit card.

Keep reading
Does Apache Ignite Remember Between Runs? The Grid Holds Data. The Agent Starts Empty.

Does Apache Ignite Remember Between Runs? The Grid Holds Data. The Agent Starts Empty. Apache Ignite remembers the data placed in its caches, and with one optional setting it remembers that data across a full cluster restart. Without that setting it remembers nothing once the cluster stops. Either way, what Ignite holds is current data under keys and in tables. It does not hold a run: what a scheduled AI agent checked, concluded, or promised to do next. An automation that wakes tomorrow can que

Does Hazelcast Remember Between Runs? The Map Holds Values. The Agent Starts Empty.

Does Hazelcast Remember Between Runs? The Map Holds Values. The Agent Starts Empty. Hazelcast remembers exactly what its data structures were told to hold, for exactly as long as the cluster, a backup, or an optional persistence layer keeps them alive. An IMap entry put by one process can be read by another process seconds or days later, as long as the cluster stays up or the entry was written through to an external store. What Hazelcast never holds is a run. It stores current values under keys

Does Solace Remember Between Runs? The Spool Holds the Message. The Agent Starts Empty.

Does Solace Remember Between Runs? The Spool Holds the Message. The Agent Starts Empty. Solace PubSub+ remembers a message for exactly as long as that message still needs delivering, and only if the flow was built for it. Send on a queue with Guaranteed messaging and the broker writes the message to its spool, persistent storage on the broker, where it survives a broker restart and waits through a consumer outage. Send with Direct messaging and nothing is spooled at all: a disconnected or slow