Introduction
The CPMCheats API wraps the real CPM, CPM2, Garage and Traffic Racer game integrations behind a signed, rate-limited, observable HTTP surface. Every write is authenticated by an HMAC signature; responses are signed too, so a client can verify integrity end to end — not just that a server answered, but that this server did, with these exact bytes.
Quick Start
- Create an API client and key in the owner dashboard.
- Store the public token, private token and HMAC secret shown once.
- Sign each request (see below) and call an endpoint under
/v1.
In a hurry? The Python SDK below does the signing, retries and job-streaming for you.
SDKs & Client Libraries
An official async Python client covers all 88 endpoints across every game — request and response signing, idempotency, retry on 429/5xx, and live job streaming, built in.
pip install httpx
pip install -e sdk/pythonimport asyncio
from cpmcheats import AsyncClient
async def main():
async with AsyncClient(BASE_URL, PUBLIC_TOKEN, HMAC_SECRET) as api:
await api.cpm.set_money(token, 50_000_000)
job = await api.cpm.unlock_all_cars(token)
async for ev in job.stream(): # live per-car progress, no polling
print(ev["type"], ev["data"].get("current_step"))
asyncio.run(main())No SDK for your language yet? The full surface is described in api/openapi.yaml — generate a typed client with any OpenAPI generator, or implement the signer directly: it's one HMAC-SHA256 call, laid out in Request Signing below.
Request Signing
Build the canonical request and HMAC-SHA256 it with your secret:
canonical =
"v1" \n
METHOD \n
PATH \n
NORMALIZED_QUERY \n
TIMESTAMP \n
NONCE \n
SHA256_HEX(BODY)
signature = HMAC_SHA256(hmac_secret, canonical)Send these headers:
X-API-Key: cpm_pk_live_…
X-Timestamp: 1790000000
X-Nonce: 550e8400-e29b-41d4-a716-446655440000
X-Signature: <hex>Query normalization percent-encodes keys/values (encodeURIComponent rules) and sorts by key then value. Timestamps must be within ±300s; nonces are single-use for that window.
Scopes
Every key is granted a set of games and scopes. A scope follows {game}:{resource}:{action}, and a request is rejected with SCOPE_NOT_ALLOWED unless the key holds the exact scope its endpoint requires — grant the narrowest set a key actually needs.
cpm:account:readcpm:account:writecpm:money:writecpm:coins:writecpm:cars:readcpm:cars:writecpm2:account:readcpm2:account:writecpm2:money:readcpm2:money:writecpm2:coins:readcpm2:coins:writecpm2:cars:readcpm2:cars:writegarage:account:readgarage:account:writegarage:player:writegarage:cars:writegarage:tools:writetraffic:account:readtraffic:account:writetraffic:player:writeExclusive design functions: whole-car skins, images per panel (hood, doors, sides) and image liveries (/v1/studio).
studioError Codes
The full, stable catalog — every code the API can return, and the HTTP status it comes with.
| Code | Status | Meaning |
|---|---|---|
| VALIDATION_ERROR | 400 | The request body or a field failed validation. |
| AUTH_REQUIRED | 401 | No credentials, or the session/key could not be authenticated. |
| TOTP_REQUIRED | 401 | Username and password are correct; the account has 2FA enabled and a TOTP code is required to finish signing in. |
| INVALID_PRIVATE_TOKEN | 401 | The private token did not match the public token. |
| INVALID_SIGNATURE | 401 | HMAC signature verification failed. |
| REPLAY_DETECTED | 401 | The nonce was already used, or the timestamp is outside the allowed skew. |
| GAME_NOT_ALLOWED | 403 | The key is not granted this game. |
| SCOPE_NOT_ALLOWED | 403 | The key is missing the scope this endpoint requires. |
| IP_NOT_ALLOWED | 403 | The caller's IP is outside the key's allowlist. |
| KEY_REVOKED | 403 | The key has been revoked. |
| KEY_DISABLED | 403 | The key is currently disabled. |
| NOT_FOUND | 404 | The resource (job, key, client) doesn't exist or isn't visible to this key. |
| IDEMPOTENCY_CONFLICT | 409 | The same Idempotency-Key was reused with a different request body. |
| RATE_LIMITED | 429 | A per-key rate limit was exceeded — check Retry-After. |
| CONCURRENCY_LIMITED | 429 | Too many concurrent requests or jobs in flight for this key. |
| GAME_ERROR | 422 | The upstream game rejected the operation (e.g. invalid account state). |
| JOB_FAILED | 422 | An async job ran and failed — see the job record's error_message. |
| MAINTENANCE_ACTIVE | 503 | The game is in scheduled maintenance. |
| UPSTREAM_TIMEOUT | 504 | The upstream game server didn't respond in time. |
| UPSTREAM_UNAVAILABLE | 502 | The upstream game server is unreachable (circuit breaker open). |
| CPM_SESSION_FAILED | 502 | Couldn't establish a CPM session with the supplied token. |
| CPM2_SESSION_FAILED | 502 | Couldn't establish a CPM2 session with the supplied token. |
| INTERNAL_ERROR | 500 | An unexpected server error — the request_id is safe to share when reporting it. |
Async Jobs & Feedback
Long operations (mass clone, farm, full unlock, bulk car mod, hunt, body-kit/FSO-all) return 202 with a follow-up envelope — you're never left waiting on a request with no idea what's happening:
{ "job_id": "…",
"status": "queued",
"status_url": "/v1/jobs/{id}",
"events_url": "/v1/jobs/{id}/events" }Poll GET /v1/jobs/{id} for the live record, or stream GET /v1/jobs/{id}/events (SSE) for per-step progress — e.g. "Transferring car 12345 (3 of 50)" — until a terminal event. Only the key/client that created a job can read it.