-
Notifications
You must be signed in to change notification settings - Fork 2
Guide CLIProxyAPI Computing Provider
Turn a ChatGPT account into a Swan Chain computing provider in five minutes — no GPU required.
The computing-provider forwards inference requests to any OpenAI-compatible HTTP endpoint listed in models.json. CLIProxyAPI turns a ChatGPT OAuth session into exactly that — a local OpenAI-compatible server serving gpt-5.5, gpt-5.4, and gpt-5.4-mini.
Neither binary needs modification. The integration is two config files.
swan-inference
│ WebSocket dispatch
▼
computing-provider
│ POST /v1/chat/completions
▼
CLIProxyAPI :8317 ← no GPU, no weights
│ ChatGPT OAuth
▼
gpt-5.5 / gpt-5.4 / gpt-5.4-mini
Clone and build CLIProxyAPI, authenticate with your ChatGPT account, then start the server:
# config.yaml
port: 8317
auth-dir: ~/.cli-proxy-api
api-keys:
- sk-swan-local./CLIProxyAPI serveVerify it lists models:
curl http://localhost:8317/v1/models \
-H "Authorization: Bearer sk-swan-local"You should see gpt-5.5, gpt-5.4, gpt-5.4-mini in the response.
# Sign up
curl -X POST http://localhost:8100/api/v1/user/signup \
-H "Content-Type: application/json" \
-d '{"email":"cliproxy@example.com","password":"YourPass1","display_name":"CLIProxy Provider"}'
# Upgrade — note the sk-prov-* key in the response
TOKEN="<token from signup>"
curl -X POST http://localhost:8100/api/v1/user/upgrade-to-provider \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"CLIProxy Provider"}'Initialize a new config directory:
computing-provider --repo ./cp-cliproxy init --node-name cliproxy-provider --port 9086Edit cp-cliproxy/config.toml — update the [Inference] block:
[Inference]
Enable = true
WebSocketURL = "ws://localhost:8081" # no /ws suffix
ApiKey = "sk-prov-<your-key>"
Models = ["gpt-5.5", "gpt-5.4", "gpt-5.4-mini"]Create cp-cliproxy/models.json:
{
"gpt-5.5": {
"endpoint": "http://localhost:8317",
"api_key": "sk-swan-local",
"category": "text-generation"
},
"gpt-5.4": {
"endpoint": "http://localhost:8317",
"api_key": "sk-swan-local",
"category": "text-generation"
},
"gpt-5.4-mini": {
"endpoint": "http://localhost:8317",
"api_key": "sk-swan-local",
"category": "text-generation"
}
}Note —
local_modelfor name-prefixed deployments: Some swan-inference deployments register models with a vendor prefix (e.g.openai/gpt-5.5) in the marketplace. CLIProxyAPI doesn't recognise that prefix — it only servesgpt-5.5. Add alocal_modelfield to rewrite the model name before the request is forwarded:{ "openai/gpt-5.5": { "endpoint": "http://localhost:8317", "api_key": "sk-swan-local", "category": "text-generation", "local_model": "gpt-5.5" } }Without this, inference requests and benchmarks will silently fail (CLIProxyAPI returns a model-not-found error). The file is watched for changes — no restart required.
computing-provider --repo ./cp-cliproxy runExpected log output:
Connected to Swan Inference
Registration successful: registered successfully
Model gpt-5.5 health changed: unknown -> healthy
Model gpt-5.4 health changed: unknown -> healthy
Model gpt-5.4-mini health changed: unknown -> healthy
End-to-end test through the marketplace:
curl http://localhost:8100/v1/chat/completions \
-H "Authorization: Bearer sk-swan-localtest" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4-mini",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 20
}'| Feature | Detail |
|---|---|
| Models in marketplace |
gpt-5.5, gpt-5.4, gpt-5.4-mini
|
| Health monitoring | computing-provider polls GET /v1/models every 30s |
| Streaming | SSE streaming works end-to-end |
| Hot-reload | Edit models.json to add/remove models without restart |
| Dashboard |
http://localhost:9086 — provider metrics UI |
Rate limits — a single ChatGPT account has per-minute caps. For higher throughput, run multiple CLIProxyAPI instances (each with its own account) and register them as separate providers.
Model verification — swan-inference's deterministic/logprob challenges expect a local model checkpoint. Disable verification in dev_mode or use the external endpoint registration path if your deployment enforces it.
Latency — ChatGPT adds ~200–800 ms round-trip vs a local server. Suitable for development and low-volume production.
| Symptom | Fix |
|---|---|
Registration failed: invalid API key |
Check ApiKey in config.toml matches the sk-prov-* from your provider signup |
Models stay unknown health |
Confirm CLIProxyAPI is running and GET /v1/models returns 200 |
WebSocketURL connection refused |
Confirm swan-inference is running on port 8081; URL must not have /ws suffix |
| Requests return wrong model / benchmarks score 0% | Add local_model to models.json if the marketplace model name has a prefix (e.g. openai/gpt-5.5) that CLIProxyAPI doesn't recognise |
permission denied on docker.sock at startup |
You are in the docker group but the session hasn't picked it up. Run sg docker -c "computing-provider --repo $CP run" to activate the group for the subprocess, or re-login |