Skip to main content
With your organisation’s own OpenRouter API key, Ankra serves the OpenRouter default models (Kimi K3 and GLM 5.3, where Ankra’s managed access runs Claude Haiku 5.5) and the automatic failover chain through your OpenRouter account - including background and autonomous AI sessions. Usage on your own key never draws on the free monthly allowance, so AI features are never paused by AI_ALLOWANCE_EXHAUSTED.

Prerequisites

  • A role that manages Ankra AI (ai.manage): owners and admins. Anyone else sees Your role can look but not change. on Models and provider.
  • An OpenRouter account at openrouter.ai with credits available.

Add the Key

1

Create an API key at OpenRouter

Sign in at openrouter.ai and create a new API key from the Keys page. Copy the key - it starts with sk-or-.
Set a credit limit on the key in OpenRouter. It caps what Ankra can spend through it, independently of Ankra’s own daily spend cap.
2

Save the key in Ankra

The command prompts for the key without echoing it; you can also pipe it on stdin or pass --api-key. Ankra validates the key live against OpenRouter before storing it. These errors can come back:
  • Invalid API key - the key was rejected by OpenRouter. Check you copied the full key and that it has not been revoked.
  • API key has no remaining credits on OpenRouter - the key is valid but its OpenRouter account has no credits left. Top up at OpenRouter, then save again.
  • API key does not have permission to use OpenRouter - the key may not call models. Check its settings on OpenRouter.
  • Could not reach OpenRouter to validate the key. Please try again. - nothing was saved. Try again in a moment.
3

Activate the provider

From this point AI usage - interactive and background - is billed to your OpenRouter account.
4

Verify

ankra ai status shows the active provider and a masked preview of the stored key (for example sk-or-...wxyz). Open the AI Assistant (⌘J / Ctrl+J) and send a message - the run appears in your OpenRouter activity.

In the portal

  1. Go to Ankra AI → Models and provider (/next/organisation/ai-models).
  2. In AI provider, press Set up… on Your OpenRouter key. The dialog Save your OpenRouter API key says where to make one: at openrouter.ai, under Keys.
  3. Paste the sk-or-... key into OpenRouter API key and press Save key. The same validation runs.
The row now shows Key ending and the key’s last characters, and the AI provider section states which calls it runs. If you also hold an Anthropic key, open the row’s options menu and press Prefer this credential to decide which of the two runs the calls both could serve; the row is then marked Preferred.

Rotating the Key

Save a new key over the old one - ankra ai openrouter set again, or Replace key… on the same row in the portal. The new key goes through the same live validation, and the old one is replaced on save - no downtime and no provider switch needed.

Removing the Key

Removing the key (ankra ai openrouter remove, or Remove the key… in the row’s options menu in the portal, then Remove key) stops Ankra using the stored key and deletes it from the secret store; if that delete fails, the key stays in the store but is no longer used. AI features that used it run on Ankra’s managed access and the free monthly allowance instead. If the allowance is already exhausted for the month, AI features pause until it resets or you add a key again.

Security

  • The key is stored only in Ankra’s secret store (HashiCorp Vault or OpenBao) - never in the database, which records only that a key is configured.
  • It is never shown again after saving; Ankra only ever displays its last characters.
  • Saving and removing the key require the ai.manage permission.
  • The key is never included in exports.
  • Models and Cost - every provider mode, the default models, and what the free allowance covers