---
title: "Bring Your Own Key"
description: "Bring your own LLM API key to run QuantConnect Agents on Anthropic, DeepSeek, Google, Groq, or OpenAI."
canonical: https://www.quantconnect.com/docs/v2/ai-assistance/bring-your-own-key
markdown: https://www.quantconnect.com/docs/v2/ai-assistance/bring-your-own-key.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/09%20AI%20Assistance/07%20Bring%20Your%20Own%20Key
modified: 2026-10-25
index: https://www.quantconnect.com/llms.txt
---

# Bring Your Own Key

[Documentation](https://www.quantconnect.com/docs/v2.md) > [AI Assistance](https://www.quantconnect.com/docs/v2/ai-assistance.md) > Bring Your Own Key

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

By default, Agents run on the free QuantConnect Meta Agent, which requires no setup. Organizations with a paid [Agent Node](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/resources.md#05-Agent-Nodes) can instead supply their own API key and run the Agents on an LLM provider of their choice. Bring your own key when you want to run a specific model, tune how the model reasons, or route the cost through your own provider account.

The provider, API key, and model are stored in a [secret](https://www.quantconnect.com/docs/v2/ai-assistance/bring-your-own-key.md#02-Secrets). To configure your own provider, either [add an agent](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#11-Add-Agents) or [update an existing one](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#12-Update-Agents). In the **Provider** section of the Agent Configuration, click the **Use Your Own Provider** option and select a secret from the **Provider Token** dropdown. The following settings become available:

| Setting | Description |
| --- | --- |
| **Reasoning Effort** | The amount of reasoning the model applies before it responds. The default is `high`. |
| **Max Turns** | The maximum number of turns the agent takes per deployment. The default is 100. |
| **Tool Choice** | The tool selection policy. The default is `auto`, which lets the model decide when to call tools. |

## Secrets

A secret securely stores an LLM provider token and the model configuration that goes with it, so you can reuse the same credentials across your Agents without pasting the token each time. To manage your secrets, log in to the [Algorithm Lab](https://www.quantconnect.com/lab) and, in the left navigation bar, click **Organization > Secrets**. The **Secrets** page lists every secret in your organization with its name, key, configuration, and a masked preview of its token. The token is write-only, while the secret configuration stays visible and editable.

### Add a Secret

Follow these steps to add a secret to your organization:

1. On the **Secrets** page, click **New Secret**.
2. Fill out the following fields:

   | Field | Description |
   | --- | --- |
   | **Name** | A label to identify the secret. |
   | **Key** | The type of secret. Select **Llm Provider Token** to store LLM provider credentials. |
   | **Provider** | The LLM provider that issued the token. |
   | **Token** | The API key from your provider account. |
   | **Model** | The model to run. The list shows the models that the selected provider offers. |
3. Click **Save**.

### Update or Delete a Secret

On the **Secrets** page, each secret has **Update** and **Delete** actions. Click **Update** to edit the secret configuration. Because the token and its configuration are saved together, leave the **Token** field blank to keep the current value, or re-enter the token to change any configuration below it. Click **Delete** to remove the secret.

### Use a Secret

To run an Agent on a secret, associate the secret with the Agent in one of the following ways:

- When you [add](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#11-Add-Agents) or [update](https://www.quantconnect.com/docs/v2/ai-assistance/agents.md#12-Update-Agents) an Agent, in the **Provider** section, click **Use Your Own Provider** and select the secret from the **Provider Token** dropdown.
- When you deploy an Agent, click **Configure**, select **Bring your own token**, and select the secret from the **Secret** dropdown.

In either dropdown, select **Create new secret** to add a secret without leaving the Agent.

Keep the following in mind when you use a secret:

- When you run an [Agent Team](https://www.quantconnect.com/docs/v2/ai-assistance/agent-teams.md), the orchestrator's secret is used for the whole team.
- You cannot change the secret after you deploy a task. To use a different secret, start a new task.

## Anthropic

To run the Agents on Anthropic's Claude models, follow these steps to get an API key:

1. [Log in or create an account](https://platform.claude.com/login) on the Claude Console.
2. On the [API Keys](https://platform.claude.com/settings/keys) page, click **Create Key**.
3. Copy the key and paste it into the **Token** field in the Organization's **Secrets**.

## DeepSeek

To run the Agents on DeepSeek's models, follow these steps to get an API key:

1. [Log in or create an account](https://platform.deepseek.com/sign_in) on the DeepSeek Open Platform.
2. On the [API keys](https://platform.deepseek.com/api_keys) page, click **Create new API key**.
3. Copy the key and paste it into the **Token** field in the Organization's **Secrets**.

## Google

To run the Agents on Google's Gemini models, follow these steps to get an API key:

1. [Log in or create an account](https://aistudio.google.com) on Google AI Studio.
2. On the [API keys](https://aistudio.google.com/apikey) page, click **Create API key**.
3. Copy the key and paste it into the **Token** field in the Organization's **Secrets**.

## Groq

To run the Agents on a model from Groq, follow these steps to get an API key:

1. [Log in or create an account](https://console.groq.com/login) on the Groq Console.
2. On the [API Keys](https://console.groq.com/keys) page, click **Create API Key**.
3. Copy the key and paste it into the **Token** field in the Organization's **Secrets**.

## OpenAI

To run the Agents on OpenAI's models, follow these steps to get an API key:

1. [Log in or create an account](https://platform.openai.com/login) on the OpenAI Platform.
2. On the [API keys](https://platform.openai.com/api-keys) page, click **Create new secret key**.
3. Copy the key and paste it into the **Token** field in the Organization's **Secrets**.
