---
title: "How to get an OpenRouter API key - Workflow Functions"
description: "Create an OpenRouter API key and connect it to Workflow Functions to write functions with Claude, GPT, Gemini and more."
canonical: "https://docs.workflow-functions.app/get-openrouter-api-key"
---

# How to get an OpenRouter API key

OpenRouter gives you one key for models from many companies - Claude, GPT, Gemini, Llama, Mistral, DeepSeek and more. To use it with **Write with AI**, connect your own OpenRouter key.

## Create the key

1. Go to **OpenRouter** and sign in (or create an account): <a href="https://openrouter.ai" target="_blank" rel="noopener">openrouter.ai</a>.
2. Add credits under **Credits** - generation is billed to your OpenRouter account.
3. Open **Keys** - direct link: <a href="https://openrouter.ai/settings/keys" target="_blank" rel="noopener">openrouter.ai/settings/keys</a> - select **Create key**, name it (for example `Workflow Functions`) and **copy the key**. It starts with `sk-or-`.

## Connect it

1. In your Shopify admin, open **Workflow Functions -> Developer -> Connections**.
2. Paste the key into the **OpenRouter** card and select **Save key**. The key is checked with OpenRouter before it is saved.
3. Pick a default model from the list, or enter any OpenRouter model id, for example `anthropic/claude-sonnet-5`.

Your key is encrypted and used only for generation - it is never shown again and never runs inside your functions. Then open a function and select **Write with AI**.

![The Connections tab with cards for Anthropic, OpenAI, Google Gemini and OpenRouter](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/fbc7ed51a748741c.png)
*Developer, Connections: one card per AI provider.*

Generation is billed to your own OpenRouter account, not your Workflow Functions plan. See [Generate functions with AI](https://docs.workflow-functions.app/generate-with-ai.md).
