Software factory / Start
Add a model key
The forge pays for the Workers AI models of your agents, up to a monthly cap. You want an agent to use your own account at Anthropic, OpenAI or another provider.
3 min read
Every provider but Workers AI needs a key. A model with your own key does not count toward the monthly spend cap, and has no cap.
You need:
- Admin access to the repository, or to be an owner of the organization.
- A key from the provider.
1. Open Provider keys
- On a repository, open Agents. Provider keys is in the Software factory group of the sidebar.
- On an organization, open the Software factory tab. Provider keys is a card on it.
2. Paste the key
Pick the Provider, and paste the Key.
3. Save the key
Click Save key. The forge checks the key with the provider before it saves it:
- The provider refuses the key: the key is not saved. The page says
The provider refused this key. Check that you copied the whole key, .... Copy the key again, then save. - The account has no credits: the key is saved, with the warning
The key works, but the account has no credits.Add credits at the provider. - The forge did not check the key, for example because the provider did not answer: the key is saved, with the warning
Could not check the key now. It is saved; the first run will tell if it works.
Note
Amazon Bedrock keys always get the last warning, because the forge does not check them.
src factory set-key, REST and MCP do the same check. src prints the warning after the success line.

4. Pick a model of the provider
Open the settings of the agent, and pick the provider and a model. See Pick a model.
Done
The agent now runs on your own account at the provider. The page never shows the key.
How the forge keeps your key
A key stays on the forge:
- Nobody can read a key back, not even an admin. The page shows only the provider and when you saved it.
- The model runs on the forge. The sandbox of the agent never gets the key.
- A repository key wins over the organization key for the same provider.
- An organization key is for every repository of the organization that has no key of its own.
When a run fails on a key
- If an agent uses a provider that has no key, its runs fail with "There is no ... key". The message names the provider and the repository.
- If the key has no credits or the provider refuses it, the run fails at once. The run shows Out of credits or Key refused with a link to these settings. The message of the provider is in the run log. See The model key or account.