Can you bring your own AI key to a coding agent?
Yes. A coding agent can accept a provider key you hold, such as an API key from a model provider. The key changes who is billed for model calls and can unlock engines the platform does not supply on its own keys. A well-built agent keeps the credential on its own side and never places it inside the running build environment.
What does bringing your own key actually change?
The immediate change is billing. When the platform supplies model access, the platform is the provider's customer and usually charges you in platform credits for each run. When you supply the key, the model provider bills you directly, and the platform may charge only for its own part of the run. That separates the model cost from the agent cost.
The second change is access. Some engines cannot be offered through a platform-held key, so the only way to use them is to connect your own. That may matter when you need a specific model's behaviour, context window, or data handling terms.
| Setup | Who bills model usage | What the agent may still charge |
|---|---|---|
| Platform-held key | The provider bills the platform | A per-engine credit price shown before you choose |
| Your own key | The provider bills you directly | The platform's base run price |
| Engine not held by platform | You, through your provider | Only the base run price, because no platform key exists |
What should a coding agent do with your key?
The key should stay with the agent platform, not in the build. A sandbox is risky because it can run commands, read files and make network requests. If the key sits in that environment, any prompt, package or dependency that reads process variables could leak it. The safer pattern is for model calls to route through the platform, which holds the key, while the sandbox receives only a result.
GROX Code follows that split. The sandbox never holds a provider key. Model calls go through GROX, which holds the keys, and the sandbox is destroyed when the run ends.
- Provider key
- An API credential issued by a model provider that lets the holder make paid model calls.
- Sandbox
- A disposable, isolated environment with a shell and real files, used for builds, destroyed when the run ends.
- Platform-held key
- A credential the agent platform keeps and calls through, without exposing it to you or the sandbox.
- Base run price
- The platform's charge for running an engine when you have supplied the provider key; distinct from a per-engine credit price.
When is your own key worth the friction?
It is worth it when you already pay for a provider and want those calls on that bill, when you need an engine the platform does not hold a key for, or when your accounting requires the provider's invoice. It is not worth it if you only make occasional requests, or if you prefer one platform charge to several provider bills.
A simpler tool may be the better choice if you do not need model choice. Managing a provider key adds a second billing relationship, so the trade-off only pays off when you will use it often or need a specific engine.
- You already have a paid provider account and want those calls on that bill
- You need a model the agent platform does not hold a key for
- You want a clear separation between model cost and agent cost
- You would rather keep one platform credit balance and avoid managing provider keys
Which engines can your key unlock?
It depends on the agent. Some platforms hold keys for a small set of engines and let you bring keys for the rest. A useful agent shows the choice before a build, not buried in settings. Engines the platform holds no key for run only with your own key.
For example, GROX Code lets you choose Grok, Claude, GPT, DeepSeek, Kimi, MiniMax, GLM or Qwen, and shows the credit price of each before you choose. Engines you bring your own provider key for run at the base price, and engines GROX holds no key for run only on your own key.
Common questions
Does bringing my own key remove the platform fee?
No. Bringing your own key changes who bills the model usage, not whether the agent platform charges for its own run. The provider bills you directly for model calls, while the platform may still apply its base run price. A per-engine credit price and a base price are separate; the key removes the platform-held model cost, not the agent cost.
Can the agent see my key when it runs code?
It should not. A well-built agent routes model calls through the platform, which holds the key, rather than placing the credential in the build sandbox. The sandbox can run commands and read files, so exposing a key there would be unsafe. A single-use sandbox should be destroyed when the run ends, leaving no copy behind.
Which model providers can I use with my own key?
It depends on the platform. Some coding agents support a fixed set, and engines the platform holds no key for run only when you supply your own key. Check the engine picker before a build: useful agents show the available choices and the credit price of each before you choose.
Is a platform-held key or my own key safer?
Each has a different risk. A platform-held key means you never expose your credential, but you trust the platform's handling and billing. Your own key gives you direct provider billing and access to engines the platform may not hold, but you must keep it out of the sandbox. The safe design is the same in both cases: the build environment never sees the key.
You can try GROX Code with your own provider key at grox.life.