# Spend your Max or Team Claude API credits

URL: https://insidetheloop.dev/guides/claude-api-credits-max-team

Created: 2026-10-10T23:21:00Z

Updated: 2026-10-10T23:57:32Z

Verified: 2026-10-10. Checked Messages API, Managed Agents, Agent SDK and claude -p with Haiku 5.5 on macOS; setup prompt v3 also tested on macOS.

anthropic now gives Max subscribers API credits every month. $100 on Max 5x, $200 on Max 20x. they expire at the end of each billing cycle, so i spent a night working out what they're actually good for.

[Anthropic announced it on X on 2026-10-07](https://x.com/ClaudeDevs/status/2107895957933408429). Team gets credits too: $20 per Standard seat and $100 per Premium seat, pooled up to $500. the [support article has the terms](https://support.claude.com/en/articles/17154008-monthly-api-credits-for-max-and-team-plans), checked on 2026-10-11.

first, the catch. these don't cover interactive Claude Code. typing into your normal terminal session still runs on your plan when you're signed in with that plan. the credits don't extend its limits.

to use them for API work, link a Console organisation in claude.ai under Settings > Billing, then use a key from that organisation. on Team, an Owner or Primary Owner does the linking under Organisation settings > Billing. everyone with a key in the linked organisation spends from the same balance.

there are three ways i tried.

## Messages API

raw calls to the model from your own scripts. summarize a folder, classify tickets, put a small job on a cron schedule. this is the simplest one. i would start here if i already knew what text to send and what i wanted back.

i used [Anthropic's Python SDK](https://platform.claude.com/docs/en/api/sdks/python) and asked Haiku 5.5 for a fixed reply. it cost a fraction of a cent. nothing bit me in the call itself; the Python example worked. the thing to get right is which process receives the key. this client reads `ANTHROPIC_API_KEY` from its environment, so i run the saved script through the `claude-api-python` wrapper from the setup prompt below.

```python
import anthropic

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY from the environment
msg = client.messages.create(
    model="claude-haiku-5-5",
    max_tokens=30,
    messages=[{"role": "user", "content": "Reply with exactly: Credits connected!"}],
)
print(msg.content[0].text)
```

My output: `Credits connected!`

## Managed Agents

[Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) lets Anthropic run the agent for you in its cloud, with a sandbox and tools. you create an environment, an agent and a session, then talk to it through events. i'd use this for a longer job where i wanted Anthropic to handle the running agent and its environment.

two things bit me. the [budget field is in cents](https://platform.claude.com/docs/en/managed-agents/budgets), so `"10"` means 10 cents, not $10. and deleting the session isn't the whole cleanup. the agent and environment are still there until you archive and delete them. i checked all three afterwards.

the block below keeps the creation and teardown calls from my run. run it in Bash with the key scoped to that process. after each create call, save the returned id as `ENV_ID`, `AGENT_ID`, then `SESSION_ID` before continuing. send your task to the session using the events flow in the docs, before running the final three lines. my greeting cost a fraction of a cent, including runtime.

```bash
api() { # api METHOD PATH [JSON]
  curl -sS -X "$1" "https://api.anthropic.com$2" \
    -H @<(printf 'x-api-key: %s\n' "$ANTHROPIC_API_KEY") \
    -H "Content-Type: application/json" \
    -H "anthropic-version: 2023-06-01" \
    -H "anthropic-beta: managed-agents-2026-04-01" \
    ${3:+-d "$3"} -w '\nHTTP %{http_code}\n'
}
api POST /v1/environments '{
    "name": "itl-poc-env",
    "config": {
      "type": "cloud",
      "networking": { "type": "limited", "allow_package_managers": true, "allow_mcp_servers": true }
    }
  }'
api POST /v1/agents '{
    "name": "itl-poc-agent",
    "model": "claude-haiku-5-5",
    "system": "Reply politely and concisely.",
    "tools": []
  }'
api POST /v1/sessions "{
    \"agent\": \"$AGENT_ID\",
    \"environment_id\": \"$ENV_ID\",
    \"title\": \"itl-poc-session\",
    \"budget\": {
      \"type\": \"limit\",
      \"max_list_cost\": { \"currency\": \"USD\", \"amount\": \"10\" }
    }
  }"
echo "== delete session";      api DELETE /v1/sessions/$SESSION_ID
echo "== archive agent";       api POST /v1/agents/$AGENT_ID/archive
echo "== delete environment";  api DELETE /v1/environments/$ENV_ID
```

My message-test output: `Hello, it's great to meet you!`

## Agent SDK

[the Agent SDK](https://github.com/anthropics/claude-agent-sdk-python) gives you Claude Code's agent loop as a library inside your own app. it can run tools. i'd use this when the job needs to decide what to do next, call a tool, read the result and keep going.

my test asked it to run `date -u` with Bash and report the output. that also cost a fraction of a cent, but getting there took two fixes. pass the prompt as `query(prompt=...)`; a positional prompt throws `TypeError` before making a call. and `max_turns=1` stopped my tool test with `error_max_turns`. it needed a turn to call Bash and another to answer. i used `max_turns=3` for the successful run.

this is the shortened function from that run, with `anyio` and the SDK's `query`, `ClaudeAgentOptions`, `SystemMessage` and `ResultMessage` already imported. run the file through `claude-api-python`.

```python
async def main():
    options = ClaudeAgentOptions(
        model="claude-haiku-5-5",
        allowed_tools=["Bash"],      # pre-approve the one tool the agent needs
        max_turns=3,                 # tool call + reply fits in 2; hard stop at 3
        max_budget_usd=0.05,         # hard spend cap for this run
    )
    async for m in query(prompt="Run `date -u` with Bash and tell me the output in one line.", options=options):
        if isinstance(m, SystemMessage) and m.subtype == "init":
            print("init:", {k: m.data.get(k) for k in ("model", "apiKeySource", "claude_code_version", "session_id")})
        elif isinstance(m, ResultMessage):
            print("result.result:", m.result)

anyio.run(main)
```

My output: `Sat Oct 10 23:08:42 UTC 2026`

`claude -p` with the linked key bills the same way, as Agent SDK usage. i got `ok` from that test too. once the setup prompt has made the wrapper, its one-call smoke test is:

```bash
claude-api -p --model claude-haiku-5-5 --max-budget-usd 0.05 --output-format json "Reply with: ok"
```

## The shell-profile mistake

the mistake i almost made was putting the key in my `.zshrc`. then every normal Claude Code session would inherit it and bill the key instead of my plan. interactive Claude Code is the thing these credits don't cover. Anthropic's [authentication guidance](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan) confirms that the environment key takes priority.

so the setup prompt keeps it in Keychain on macOS, or a private file you create on Linux, and gives only the API wrappers access at run time. removing an export doesn't fix sessions already open. start a new shell and Claude Code session, then check `/status` for the plan login.

## What my test runs cost

all 16 runs in the original test batch came to about 2 cents, including failures and setup experiments. the later setup-prompt v3 retest is separate. these are the recorded dollar amounts, with API costs calculated from usage at [Anthropic's list prices](https://platform.claude.com/docs/en/about-claude/pricing).

| Test | Cost in USD |
| --- | ---: |
| Messages API, Python | $0.0000062 |
| Messages API, curl | $0.0000062 |
| Managed Agents greeting, including runtime | $0.0001095 |
| Agent SDK, successful Bash call | $0.00213743 |
| Agent SDK, turn-limit failure | $0.000584615 |
| `claude -p`, original key-authenticated test | $0.000845845 |
| Setup tests and wrapper checks | $0.01639921 |
| Interactive `!` experiment, excluded from credits | $0.0034185 |
| Total, including zero-cost failures | $0.0235075 |

i tested these small calls and the setup on macOS; Linux coverage stops at key storage, Node coverage at CommonJS imports, and i didn't check the Console balance for credit deduction.

Paste this into Claude Code

```
Set up this machine so my Claude API key (from the Console org linked to my Max or Team plan) is used only for API work. Install exactly these and nothing else: Python SDK, Agent SDK, Node SDK. Work only in my home directory.
1. Never ask me to paste the key into this chat. Never write it to a shell profile or any file you create. The only plain-text copy allowed is the Linux key file I create in step 3.
2. Check if the key is stored. macOS: `security find-generic-password -s anthropic-api-key -w >/dev/null`. Linux: `test -s ~/.config/anthropic/api-key`. If it is, go to step 4.
3. If not, give me the one command to run, then stop until I say done:
   - macOS: copy the key from the Console, then type `! security add-generic-password -U -a "$USER" -s anthropic-api-key -w "$(pbpaste)" && pbcopy </dev/null`
   - Linux, in another terminal running bash (`read -s` needs bash): `mkdir -p ~/.config/anthropic && (umask 077; read -rsp 'Key: ' k; printf '%s\n' "$k" > ~/.config/anthropic/api-key)`. This creates a file only I can read.
4. Do not export ANTHROPIC_API_KEY globally. If it is set, interactive Claude Code bills the key, and the credits don't cover interactive Claude Code. Remove any such export from my shell profiles and tell me what you removed. If ~/.claude/settings.json sets an apiKeyHelper or ANTHROPIC_API_KEY, tell me; don't change it.
5. Create executable bash wrappers in ~/.local/bin. Each reads the key at run time (the step 2 command with `-w` printing it, or `cat` of the file). If the read fails or the key is empty, it prints an error and exits 1 without starting anything. Otherwise it sets ANTHROPIC_API_KEY only for the process it starts:
   - `claude-api`: runs `claude "$@"`, for `claude-api -p ...`
   - `claude-api-python`: runs the venv's python, if a Python package is on my list
   - `claude-api-node`: runs `node "$@"` with NODE_PATH set to the install's node_modules, if the Node SDK is on my list. This supports CommonJS `require()` only; for ESM `import`, install the SDK in that project.
   If ~/.local/bin is not on PATH, add only that PATH line to my shell profile.
6. Install only what is on my list: `anthropic` and `claude-agent-sdk` into a venv at ~/.local/share/claude-api/venv; `@anthropic-ai/sdk` with npm into ~/.local/share/claude-api/node.
7. Smoke test, one call: `claude-api -p --model claude-haiku-5-5 --max-budget-usd 0.05 --output-format json "Reply with: ok"`. Print `result` and `total_cost_usd`. For each installed package, only check it imports through its wrapper.
8. Finish with: the wrappers you made, what you installed, and the smoke test's `total_cost_usd`. Say you cannot see billing, and ask me to check the linked org's Billing page myself (platform.claude.com/settings/billing).
9. If you removed an export in step 4, tell me it still applies to shells and Claude Code sessions that are already open. Tell me to start a new shell and a new Claude Code session, then check the credential source: `/status` in interactive Claude Code should show my plan login, not an API key; `claude-api -p --model claude-haiku-5-5 --max-budget-usd 0.05 --output-format stream-json --verbose "Reply with: ok" | head -1` should show `"apiKeySource":"ANTHROPIC_API_KEY"`.
```


## Sources

- [ClaudeDevs monthly API credits announcement, 2026-10-07](https://x.com/ClaudeDevs/status/2107895957933408429) (read 2026-10-11)
- [Monthly API credits for Max and Team plans](https://support.claude.com/en/articles/17154008-monthly-api-credits-for-max-and-team-plans) (read 2026-10-11)
- [Use Claude Code with your Pro or Max plan](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan) (read 2026-10-11)
- [Python Messages SDK](https://platform.claude.com/docs/en/api/sdks/python) (read 2026-10-11)
- [Managed Agents overview](https://platform.claude.com/docs/en/managed-agents/overview) (read 2026-10-11)
- [Managed Agents budgets](https://platform.claude.com/docs/en/managed-agents/budgets) (read 2026-10-11)
- [Python Agent SDK](https://github.com/anthropics/claude-agent-sdk-python) (read 2026-10-11)
- [Claude API pricing](https://platform.claude.com/docs/en/about-claude/pricing) (read 2026-10-11)
