---
title: "How to get an OpenRouter API key - Workflow Trigger Extensions"
description: "Create an OpenRouter API key to write trigger code with models from Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek and more using one key."
canonical: "https://docs.workflow-trigger-extensions.app/get-openrouter-api-key"
---

# How to get an OpenRouter API key

OpenRouter gives you one API key for models from many companies, such as Anthropic, OpenAI, Google, Meta, Mistral and DeepSeek. Connect it to use **Generate with AI** with any of them.

## Create the key

1. Sign in to **OpenRouter**, or create an account: <a href="https://openrouter.ai" target="_blank" rel="noopener">openrouter.ai</a>.
2. Add credits to your account: <a href="https://openrouter.ai/settings/credits" target="_blank" rel="noopener">openrouter.ai/settings/credits</a>. Generations are paid from these credits.
3. Open **Keys** - direct link: <a href="https://openrouter.ai/settings/keys" target="_blank" rel="noopener">openrouter.ai/settings/keys</a> - select **Create API key**, name it (for example `Workflow Trigger Extensions`) and **copy the key**. It starts with `sk-or-` and is shown only once. You can set a credit limit on the key.

OpenRouter's own guide: <a href="https://openrouter.ai/docs/quickstart" target="_blank" rel="noopener">openrouter.ai/docs/quickstart</a>.

## Connect it

1. In your Shopify admin, open **Workflow Trigger Extensions -> Developer -> Connections**.
2. Paste the key into the **OpenRouter** card and select **Save key**.

Your key is encrypted at rest and used only for generation. It is never shown again, and it never runs inside your trigger code. Then open a custom trigger and use **Generate with AI** on the Code tab: pick OpenRouter and a model. For a model that is not in the list, choose **Other model id** and enter its id, for example `mistralai/mistral-large`.

> [!NOTE]
> **Billing and models**
> Generation is paid from your OpenRouter credits, not your Workflow Trigger Extensions plan. Browse models and prices at <a href="https://openrouter.ai/models" target="_blank" rel="noopener">openrouter.ai/models</a>, and see [Generate trigger code with AI](https://docs.workflow-trigger-extensions.app/generate-with-ai.md) for how generation works.
