The Lab works in one of two modes. Without a connection it uses QuantLab's own model, which writes Pine and checks that it compiles. With your own AI connected, the model also checks the script on TradingView and produces a second form of the build that runs on QuantLab bars.
| QuantLab's model | Your connected AI | |
|---|---|---|
| Writes Pine v6 | Yes | Yes |
| Compile check | Yes | Yes, verified on TradingView |
| Runs on QuantLab bars | No, Pine export only | Yes, when every line can be translated |
| Cost | No key needed | Billed by your provider |
Connecting
Press Connect AI in the strip above the composer, or the Connect AI chip, to open the dialog. You have two routes.
- Sign in with OpenRouter. This opens openrouter.ai in a popup. One OpenRouter key reaches Claude, GPT, DeepSeek, GLM and MiniMax models, billed to your own OpenRouter credits.
- Paste an API key from a provider directly: Claude, an OpenAI API key, DeepSeek, GLM (Z.ai) or MiniMax. Each row links to the page where you create a key.
After you pick a provider you can edit the model name, test the connection and press Connect. The dialog header confirms the provider and model you are on.
Where the key lives
Your key stays in this browser. QuantLab never receives it. Tick Remember on this device to keep it between visits. Left unticked, the key is held in memory only and goes when you reload or close the tab. Press Disconnect in the dialog to clear it, and the Lab returns to QuantLab's model.