Skip to main content

OpenRouter integration

The OpenRouter integration lets Guard send an investigation event to an AI model and record the answer. A routing workflow uses it through the Ask an AI responder action. See Ask an AI responder.

The model only writes text. It does not run code on your machine and it does not change a Guard decision. Local Guard keeps deciding what is allowed.

Connect OpenRouterDirect link to Connect OpenRouter​

  1. In the Guard Cloud dashboard, open Settings > Integrations > OpenRouter.
  2. Select Authorize OpenRouter. Guard sends you to OpenRouter to approve access.
  3. OpenRouter returns you to Guard. Guard exchanges the approval for an API key that belongs to your OpenRouter account and stores the key encrypted.
  4. Guard runs a health check with a short sample request. The connection shows as healthy when a model returns text.
  5. Select Run test completion at any time to repeat the check with a sample investigation.

Guard uses an authorization flow with a one-time code verifier (PKCE), so you never copy an API key into Guard.

The key is created in your OpenRouter account, so you manage it there. Revoke it from your OpenRouter key settings to stop Guard from using it. After a revoke, or when you switch OpenRouter accounts, select Reconnect OpenRouter.

ModelsDirect link to Models​

Connection checks and the test completion use OpenRouter's free model router, openrouter/free. If a request to it fails or returns no text, Guard tries a short list of other free models in turn and reports the result of the last attempt. Which free models are available, and any limits on them, are set by OpenRouter.

The Ask an AI responder step has fields for a model, an instruction, an output format, token and temperature limits, and an evidence scope. See Ask an AI responder. Guard does not document that these step fields carry over to a live delivery, and the default model is openrouter/free, so check the answer in Executions after you publish. A paid model is billed by OpenRouter to your OpenRouter account, not by Guard.

What leaves GuardDirect link to What leaves Guard​

An AI responder sends a JSON description of the event to OpenRouter, and OpenRouter passes it to the model provider. The description holds the summary, the investigation ID, and event metadata. The step's Evidence shared with AI setting defaults to a safe summary only, but Guard does not document it as a content filter. Treat OpenRouter and the model provider as outside parties, keep the setting at the narrowest level the instruction needs, and route only events whose summaries you are willing to share. See Actions.

Requests time out after 30 seconds.

TroubleshootingDirect link to Troubleshooting​

SymptomFix
The connection shows an attention statusSelect Run test completion and read the error. A key that was revoked, an account without access to free models, or OpenRouter being unavailable all show here
The test returns HTTP 200 with no textThe model returned an empty answer. Try again, or use another model on the action
The test fails with an authorization errorThe key was revoked or the account changed. Select Reconnect OpenRouter
A workflow cannot be publishedAn AI responder action needs a connected OpenRouter account. Connect it, then publish

NextDirect link to Next​