Connect AI Models to Paperclip
Paperclip organises the work; the models do the thinking. Before your first agent can do anything, it needs a model to talk to, and in Paperclip that means a credential for the agent's command-line tool. This guide covers the two kinds of credential, the places you can put them, and how they interact with budgets.
Which agents use which credentials
An agent in Paperclip runs through an adapter. On Hosting for Paperclip two adapters run on the server itself:
- Claude Code (
claude_local) runs Anthropic's Claude Code CLI. It readsANTHROPIC_API_KEY, or uses a Claude subscription sign-in. - Codex (
codex_local) runs OpenAI's Codex CLI. It readsOPENAI_API_KEY, or uses a ChatGPT subscription sign-in.
Agents that run somewhere else, such as OpenClaw, Hermes or any HTTP endpoint, keep their own credentials and connect to Paperclip over the network. The Gemini, Kimi and OpenCode CLIs are not part of the image we run.
Step 1: Choose an API key or a subscription
The choice changes how usage is billed and how Paperclip counts it:
| API key | Subscription | |
|---|---|---|
| Billing | Per token, by the provider | Your subscription fee and its limits |
| Recorded cost in Paperclip | The reported dollar cost | $0, tokens still recorded |
| Budgets | Count toward company, agent and project budgets | Never move a budget |
| How to limit | Budgets with hard stops | Pause the agent; watch the Providers tab |
For a team that wants predictable spending controls inside Paperclip, API keys with budgets are the clearer option. If you use a subscription, read your provider's terms for automated use.
Step 2: Add the credential
There are two places to put it.
At deploy. Enter ANTHROPIC_API_KEY or OPENAI_API_KEY as an environment variable when you deploy, or later in Deployment Settings. The key becomes part of the server's environment, so every Claude Code or Codex agent can use it. Your app's specification is encrypted on the Flux network, so the key is not readable there. Changing it in Deployment Settings restarts the app.
In Paperclip. Open Apps, Connections to connect a Claude or Codex subscription in your browser, or to enter a provider API key. You do not need a shell or a CLI configuration for this. Paperclip runs the subscription sign-in for you.
Keep in mind that an instance-wide key takes precedence in billing: Claude Code reports subscription billing only when it runs without ANTHROPIC_API_KEY, and Codex only without OPENAI_API_KEY. If you want an agent on a subscription, leave that provider's key out of the deploy settings.
Step 3: Bind keys per agent where needed
For more control, store a key as a company secret and bind it only where it is needed:
- Create the secret in Company Settings, Secrets.
- Open the agent's Environment variables, or the project's Env field.
- Add the key name the tool expects, such as
ANTHROPIC_API_KEY, set the source to Secret and pick the stored secret.
Paperclip encrypts secrets at rest with the instance's master key, never returns the decrypted value to the UI, and injects it into the agent's process only when a run starts. Authenticated instances enforce this by default: sensitive variable names such as *_API_KEY must use secret references, not plain values. On Hosting for Paperclip the master key is generated at deploy and kept in your app's encrypted specification.
One honest caveat from Paperclip's own documentation: once a value reaches the agent's process, the agent can read it. Bind each key only to the agents that need it, and rotate it if a transcript might have captured it.
Step 4: Set budgets
Before you hand out real work, set a company budget and, for busy agents, an agent budget. Select Costs in the sidebar and open Budgets, or use the Budget tab on an agent or project. By default a budget warns at 80 percent and stops work at the limit. The full picture of model spending is in what running Paperclip costs.
Checking that it works
Create a test agent, assign it a small task and watch its run. Paperclip's adapter checks report missing authentication or CLI prerequisites in the agent's environment, so a credential problem shows up as a clear message rather than a silent failure. Once runs succeed, the cost page shows the provider, the model and the tokens for each run.
Ready to connect your first agent? See Hosting for Paperclip on Flux, or read how agents keep working around the clock.
Frequently Asked Questions
Which agents run on the server itself?
Claude Code and Codex. Their command-line tools are installed in the image, and Paperclip starts them next to the server when an agent wakes. Agents that run elsewhere, such as OpenClaw, Hermes or an HTTP endpoint, connect over the network instead.
Are Gemini, Kimi or OpenCode agents supported?
Paperclip supports them, but their command-line tools are not included in the image we run, so they cannot run locally on Hosting for Paperclip. HTTP and externally running agents are unaffected.
Can I use my Claude or ChatGPT subscription instead of an API key?
Paperclip can sign in Claude Code or Codex with a subscription from Apps, Connections. Subscription usage is recorded at zero dollars, so budgets do not limit it. Check your provider’s terms for this kind of use.
Where are my API keys stored?
Keys you add inside Paperclip are encrypted at rest with the instance’s master key and are never shown again in the UI. Keys you enter at deploy live in your app’s specification, which is encrypted on the Flux network.
Does a key set at deploy override a subscription?
It can. Paperclip’s docs say Claude Code reports subscription billing only when it runs without ANTHROPIC_API_KEY, and Codex only without OPENAI_API_KEY. If you want agents on a subscription, do not set an instance-wide key for that provider.
Who bills me for model usage?
Your AI provider, directly. Hosting for Paperclip does not resell model usage and adds nothing to it.
Paperclip is open-source software (MIT) by the Paperclip project (https://github.com/paperclipai/paperclip). Flux is not affiliated with or endorsed by the Paperclip project.