Skip to main content
Use the creator API to deploy from your own tool or CI. Use the SDK inside a game for player sessions, scores and multiplayer.

Choose an API

For the CLI, CI or your own deployment tool.
  • Base URL: your internal origin plus /api/v1
  • Authentication: a creator token in Authorization: Bearer …
  • Start with: the CLI quickstart, or your first request below
Creator access is internal. Set the origin the team supplied. Deploy and creator-tooling routes return 404 with not_found where the platform is disabled. An account without internal access gets 403 with not_member, and a suspended or deleted account gets 403 with account_inactive. Analytics, audience and embed endpoints have their own access rules; check the endpoint’s authentication and response descriptions.
Creator tokens belong in your deployment tool, never in the game bundle. Send them only to the creator API. The SDK handles the separate game session token. In a hosted game, the injected SDK starts the session handshake while the game’s scripts load. Subscribe to og.player.onChange to apply the player’s name and OG as they arrive. Call og.init() before tracking events and og.ready() when the game is playable. The player’s handle, OG number and avatar depend on their Show my OG in games setting. Check og.capabilities for the services available to this session. Game sessions and creator access are separate. A signed-in member can receive a player session on a live game even when creator routes are disabled. The game API provides scores, events, achievements and country lookup. Multiplayer uses the broker. Games on runtime contracts from 2027-03 onward can also call external HTTPS APIs and use WSS connections, subject to the game policy.

Make your first request

The quickest account check is opengame whoami --json. To call the API directly, set these in your process environment: Save this as whoami.mjs. It needs Node.js 18.17 or later.
whoami.mjs
Run it:
The origin check matches the CLI’s requirement for HTTPS, or HTTP on an exact localhost address for development, without credentials, a path, query or fragment. Redirects fail before the token can be sent to another destination. A successful response has HTTP status 200 and includes apiVersion, handle, ogNumber, avatar and credential. Check the credential’s scopes and game restriction before you deploy. Never log the token or put its value in a command argument.

Set up tokens for CI

opengame login uses browser approval and creates a token with read, deploy and submit scopes. Tokens created in the browser can have fewer scopes and can be restricted to one game. Give a job only the scopes it needs: a CI job that only makes previews needs deploy, and only a job that submits releases needs submit. A token from opengame login lapses after 90 days without a request, and you then run opengame login again. A token made in settings does not lapse. Revoke either kind in settings, or run opengame token revoke --id <id> to open that page, and every later request with it fails. A token can revoke itself through POST /api/v1/auth/logout. Creating, listing or revoking other tokens needs a signed-in browser. Store a CI token in your runner’s secret store and expose it as OPENGAME_TOKEN. The CLI also accepts --token-stdin. Keep credentials out of build output, source control and logs. The CLI reference lists every command option.

Deploy a private preview

Most integrations should call the CLI, which builds, validates, packages and resumes uploads. A direct ZIP integration makes these calls in order:
1

Create the operation

Send POST /api/v1/deploys with the archive’s size, file count, SHA-256 and manifest. Include an Idempotency-Key. Save the operation ID and the Idempotency-Key before uploading.
2

Upload the archive

The response includes an upload with a presigned URL and the required headers. PUT the archive bytes to that URL with those headers. Leave your creator token off this request; it goes only to the creator API.
3

Confirm the upload

Send PUT /api/v1/operations/{id}/upload. The server verifies the stored object and queues its checks. If the storage upload was interrupted, a POST to the same path returns another upload URL, or uploaded: true if the upload completed.
4

Read the result

Poll GET /api/v1/operations/{id} until the operation reaches ready, failed or expired. A ready release can be played in its private preview. Submission and certification are separate actions.
Bootstrap currently returns capabilities.incrementalUpload: false, so the CLI uses ZIP uploads for ordinary builds. Use POST /api/v1/deploys/files only when the server advertises that capability. Explicit large-asset plans use POST /api/v1/deploys/external-assets; Unity plans can also use /api/v1/deploys/unity-assets. The CLI accepts a plan file or --external-assets auto, uploads and confirms the missing files, then completes the operation. Kaigen and large-game-v1 plans require an account grant, and Kaigen also requires acceptance of its publication statement. The boot archive retains its ordinary limits. Internal servers support per-file processing. On Vercel, processing also requires an enabled compute price contract. If large-asset processing is unavailable, keep the export and retry when the service is available; use a ZIP only if the complete export fits its limits. OpenGame accepts static browser exports from any engine. The scan records detected engine metadata and thread use; it selects an isolated runtime contract for threaded builds. See Engine support for exporter recognition, starters and tested deployments. A large-asset plan still needs the account grant described above.

Open the preview

Open the returned previewUrl while signed in to the creator account. The page requests a preview grant through POST /api/v1/games/{id}/preview, which requires a browser session. Creator tokens can deploy and read status, but cannot issue that grant. Preview sessions withhold player profile details. Scores stay in the preview, and preview events are excluded from public analytics. Achievements require a published game session. A release that declares peer-to-peer multiplayer can use preview rooms when the broker is configured. To test with another browser profile, sign in to the same creator account there; rooms are isolated from published games and other releases. Each endpoint page gives the request schema, the response schemas and the authentication it needs. Those pages are generated from packages/api-schema and compared with the route definitions. Packaging covers the required game files, and the repair loop explains failed checks.

Handle errors and retries

Creator API errors are JSON with a stable error code and a human-readable message, and most say whether a retry can help:
Branch on error and show message. An error can also carry these fields:

Device login

The device-token endpoint follows the OAuth device flow. It answers a pending or ended approval with the code in error: authorization_pending, slow_down, expired_token or access_denied.
  • A slow_down from polling too often also carries interval, the seconds to wait between polls from now on.
  • A slow_down sent because too many requests came from one place has status 429 and a message, like the rest of the API.
  • An access_denied that was not a person pressing Deny carries reason: not_member or account_inactive.

Unknown paths and methods

A path under /api/v1 that is not a creator API route, such as a mistyped /api/v1/game, gets 404 with not_found in the same JSON shape. That holds for GET, HEAD, POST, PUT, PATCH, DELETE and OPTIONS. A method a real route does not take, such as DELETE on /api/v1/limits, gets 405 with no JSON body. Check the status before you parse.

Recover from common failures

Deploys are limited to 30 per hour per account and per token. Read current limits and remaining usage with opengame limits --json. Make one Idempotency-Key per deploy and reuse it for that deploy’s retries; a new key starts a new operation.

Where next

Read the agent guide

Handle approval, structured output and retry guidance.

Enter a jam

Submit a release, pick a track and certify it.

Update a live game

Reuse the game ID and keep edits made on the website.

Read the SDK reference

Look up every SDK export and its signature.