Documentation

Build against the CPMCheats API

Signed requests and responses, replay protection, per-key scopes and limits, async jobs with live progress, and realtime — across CPM, CPM2, Garage and Traffic Racer.

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

  1. Create an API client and key in the owner dashboard.
  2. Store the public token, private token and HMAC secret shown once.
  3. 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.

bash
pip install httpx
pip install -e sdk/python
python
import 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.

Authentication

Each key has three credentials, shown once at creation:

  • cpm_pk_live_… — public token, identifies the key (sent as X-API-Key).
  • cpm_sk_live_… — private token, authenticates non-signed keys.
  • cpm_hmac_live_… — HMAC secret, signs requests and responses. Never sent over the wire.

Request Signing

Build the canonical request and HMAC-SHA256 it with your secret:

http
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:

bash
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.

Response Signing

Responses carry a signature over the exact bytes returned, so a client can detect tampering or a wrong server:

http
X-Request-ID: …
X-Response-Timestamp: …
X-Response-Nonce: …
X-Response-Signature: HMAC_SHA256(secret,
  "v1" \n REQUEST_ID \n STATUS \n TS \n NONCE \n SHA256(BODY))

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.

Car Parking Multiplayer
cpm:account:readcpm:account:writecpm:money:writecpm:coins:writecpm:cars:readcpm:cars:write
Car Parking Multiplayer 2
cpm2:account:readcpm2:account:writecpm2:money:readcpm2:money:writecpm2:coins:readcpm2:coins:writecpm2:cars:readcpm2:cars:write
CPM Garage
garage:account:readgarage:account:writegarage:player:writegarage:cars:writegarage:tools:write
CPM Traffic Racer
traffic:account:readtraffic:account:writetraffic:player:write
CPMCheats Studio (exclusive)

Exclusive design functions: whole-car skins, images per panel (hood, doors, sides) and image liveries (/v1/studio).

studio

Errors

All errors use one shape and a typed, stable code:

http
{ "error": { "code": "INVALID_SIGNATURE",
             "message": "Signature verification failed",
             "request_id": "…" } }

request_id is safe to share when reporting an issue — it never contains request contents, only a correlation id.

Error Codes

The full, stable catalog — every code the API can return, and the HTTP status it comes with.

CodeStatusMeaning
VALIDATION_ERROR400The request body or a field failed validation.
AUTH_REQUIRED401No credentials, or the session/key could not be authenticated.
TOTP_REQUIRED401Username and password are correct; the account has 2FA enabled and a TOTP code is required to finish signing in.
INVALID_PRIVATE_TOKEN401The private token did not match the public token.
INVALID_SIGNATURE401HMAC signature verification failed.
REPLAY_DETECTED401The nonce was already used, or the timestamp is outside the allowed skew.
GAME_NOT_ALLOWED403The key is not granted this game.
SCOPE_NOT_ALLOWED403The key is missing the scope this endpoint requires.
IP_NOT_ALLOWED403The caller's IP is outside the key's allowlist.
KEY_REVOKED403The key has been revoked.
KEY_DISABLED403The key is currently disabled.
NOT_FOUND404The resource (job, key, client) doesn't exist or isn't visible to this key.
IDEMPOTENCY_CONFLICT409The same Idempotency-Key was reused with a different request body.
RATE_LIMITED429A per-key rate limit was exceeded — check Retry-After.
CONCURRENCY_LIMITED429Too many concurrent requests or jobs in flight for this key.
GAME_ERROR422The upstream game rejected the operation (e.g. invalid account state).
JOB_FAILED422An async job ran and failed — see the job record's error_message.
MAINTENANCE_ACTIVE503The game is in scheduled maintenance.
UPSTREAM_TIMEOUT504The upstream game server didn't respond in time.
UPSTREAM_UNAVAILABLE502The upstream game server is unreachable (circuit breaker open).
CPM_SESSION_FAILED502Couldn't establish a CPM session with the supplied token.
CPM2_SESSION_FAILED502Couldn't establish a CPM2 session with the supplied token.
INTERNAL_ERROR500An unexpected server error — the request_id is safe to share when reporting it.

Rate Limits

Limits are per key across seconds/minutes/hours/days/months, enforced in Redis so they hold across instances. Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset; a 429 includes Retry-After.

Idempotency

Important writes accept an Idempotency-Key header. The same key with a different payload is rejected with IDEMPOTENCY_CONFLICT; the same key and payload simply replays the stored result — safe to retry a timed-out request without double-applying 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:

http
{ "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.

Realtime

The owner dashboard subscribes to /v1/realtime/sse for live requests, jobs, workers, security events and metrics. The public status page uses /v1/status/events. Both are push-only — no polling, ever — and every frame is a named SSE event carrying a typed data payload.

CPM

47 endpoints under /v1/cpm/*: auth (login, register, change password/email), account and player data, money/coins, unlocks and rank, friends, cars (list, unlock, mod, headlights, speed, designs), the store (listings, buy, hunt), and backup/restore plus cloning between accounts.

CPM2

24 endpoints under /v1/cpm2/*: auth, money/coins, cars (list, buy, air/siren, features, FSO, body kits, vinyls — single car or every car at once), king rank, daily tasks, coin farming and account creation.

Garage

10 endpoints under /v1/garage/*: auth (login, signup), account (read profile, change password, change email, delete account), player data, cars, tools, and a full hack that runs player + cars + tools together.

Traffic Racer

7 endpoints under /v1/traffic/*: auth (login, signup, anonymous), account (read profile, change password, change email), and a hack for money, gold, level, and nitro & turbo boosters.

Webhooks

Register a webhook to receive job.completed, job.failed and job.cancelled with an independent HMAC signature in X-Webhook-Signature — the same canonical-request scheme as regular requests, so verifying a webhook uses the exact code you already wrote for signing.