How to get an OpenRouter API key
Create an OpenRouter API key and connect it to Workflow Functions to write functions with Claude, GPT, Gemini and more.
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
- Go to OpenRouter and sign in (or create an account): openrouter.ai.
- Add credits under Credits - generation is billed to your OpenRouter account.
- Open Keys - direct link: openrouter.ai/settings/keys - select Create key, name it (for example
Workflow Functions) and copy the key. It starts withsk-or-.
Connect it
- In your Shopify admin, open Workflow Functions -> Developer -> Connections.
- Paste the key into the OpenRouter card and select Save key. The key is checked with OpenRouter before it is saved.
- 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.

Generation is billed to your own OpenRouter account, not your Workflow Functions plan. See Generate functions with AI.
