# Calling models on a Baidu AI Cloud Token Plan

A Token Plan is a monthly allowance on Baidu AI Cloud, bought through FluxA.
Requests go to Baidu directly. FluxA is not in the request path, does not meter
these calls, and cannot see them.

If you do not have a key yet, buying one is a different document. In USDC,
which you can set up yourself and the plan owner approves:
https://agentmarket.fluxapay.xyz/marketplace/tokenplans/agent-topup.md
By FluxA Agent Card Payment, the card linked in the wallet:
https://agentmarket.fluxapay.xyz/marketplace/tokenplans/topup.md

## Get the key

The plan owner reads it in the AgentMarket console at https://agentmarket.fluxapay.xyz/console/tokenplans, under their plan, by clicking Reveal.

An agent can also fetch it with the FluxA wallet CLI: run `fluxa-wallet market tokenplan list` for the plan id, then `fluxa-wallet market tokenplan key <id>` for the key and base URL. Treat it as a live credential.

## Base URLs

Two protocols, two different base URLs. The same key works on both.

| Protocol | Base URL | Endpoint it appends |
|---|---|---|
| OpenAI | `https://api.baiduqianfan.ai/v2/tokenplan/team` | `/chat/completions` |
| Anthropic | `https://api.baiduqianfan.ai/anthropic/tokenplan/team` | `/v1/messages` |

Set the base url exactly as written above. A client appends its own endpoint
path.

## Call it

```bash
curl -sS https://api.baiduqianfan.ai/v2/tokenplan/team/chat/completions \
  -H "Authorization: Bearer $TOKEN_PLAN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.2","messages":[{"role":"user","content":"hello"}]}'
```

Anthropic protocol uses a different auth header:

```bash
curl -sS https://api.baiduqianfan.ai/anthropic/tokenplan/team/v1/messages \
  -H "x-api-key: $TOKEN_PLAN_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.2","max_tokens":256,"messages":[{"role":"user","content":"hello"}]}'
```

## Coding tools

Point any tool that takes a custom endpoint at the matching base URL.

```bash
# Anthropic-protocol tools, Claude Code among them
export ANTHROPIC_BASE_URL="https://api.baiduqianfan.ai/anthropic/tokenplan/team"
export ANTHROPIC_AUTH_TOKEN="$TOKEN_PLAN_KEY"
export ANTHROPIC_MODEL="glm-5.2"

# OpenAI-protocol tools
export OPENAI_BASE_URL="https://api.baiduqianfan.ai/v2/tokenplan/team"
export OPENAI_API_KEY="$TOKEN_PLAN_KEY"
```

Per-tool setup pages are listed at https://agentmarket.fluxapay.xyz/marketplace/tokenplans/llms.txt. They are Baidu's own pages and are written in Chinese.

## Models

- `glm-5.1`
- `glm-5.2`
- `glm-5.3`
- `deepseek-v4.1-flash-1017`
- `deepseek-v4-flash-0731`
- `deepseek-v4-pro-0813`
- `deepseek-v4-pro`

Anything else answers with an error. The live list is what the plan endpoint
reports; this page is generated from it.

## Spending

Token Plan Credits are drawn per call by Baidu. Usage is shown in the console at https://agentmarket.fluxapay.xyz/console/tokenplans, and plan details are at https://agentmarket.fluxapay.xyz/marketplace/tokenplans/llms.txt. There is no FluxA balance behind this and no FluxA spend limit: the allowance is enforced by Baidu.

The allowance does not roll over. Renewing a plan extends it and keeps the same
key, so nothing needs reconfiguring afterwards.

You can hold more than one plan. Each has its own key and its own allowance,
and they do not pool: a call is billed to the key that made it. Buying another
is also how you get a bigger allowance, since a plan's tier does not change.
