PlayKit.ai

Core Concepts

Key concepts for integrating with the PlayKit platform

Core Concepts

Game ID

Every application registered on PlayKit has a unique Game ID. It scopes all AI calls, player data, and billing to your specific game. You configure it once during SDK setup — it is not a secret.

Tokens

PlayKit uses two types of tokens:

TypeScopeWho uses itHow to obtain
Developer Tokendeveloper:fullYour machine, your CIDashboard or device auth flow
Player Tokenplayer:playPlayer's sessionDevice auth flow, Steam, JWT exchange, or code verification

Developer Tokens are global — they are not tied to a specific game and work across all your games. They are intended for development, testing, and server-to-server calls. Never ship them in production builds.

Player Tokens are scoped to the player and game. They authorize AI calls on behalf of the authenticated player, and costs are deducted from the player's balance.

Developer Tokens give full access to your developer account. Keep them out of version control and production deployments.

Authentication Flows

The standard way for players to authenticate. The SDK handles this automatically when no developer token is present.

  1. SDK initiates a device auth session and receives an auth_url
  2. Player opens the URL in a browser and logs in (email or phone verification)
  3. SDK polls for completion and receives a player token
  4. Token is stored locally and reused on subsequent launches

This flow is PKCE-based and works in browser, desktop, and mobile environments.

Steam Authentication

For games distributed on Steam. The SDK exchanges the player's Steam session ticket for a PlayKit player token via PlayKit_SteamAuthManager (Unity) or Steamworks integration.

JWT Exchange

If you have your own authentication system, sign a JWT with your game's private key and exchange it for a PlayKit player token via the /api/external/exchange-jwt endpoint. This lets you bind PlayKit accounts to your existing identity system.

Verification Code Flow

Players authenticate directly with a phone number or email address via a one-time code. Used internally by the device auth flow browser page.

Credits

PlayKit uses a unified credit system denominated in USD.

Player Billing

By default, AI calls in production are charged to the player's wallet. Players accumulate credits through:

  • Daily credit refresh (a small amount added automatically each day)
  • In-app purchases (via Steam IAP or other channel integrations)

Developer Billing

During development, when you use a Developer Token, all AI calls are charged to your developer account. This lets you test without requiring players to have a balance.

Some games choose to keep developer billing enabled in production, effectively making the game "free to play" for players. This is configured per-game on the dashboard.

Channels

Credits are scoped by distribution channel:

  • standalone — Default channel for direct distribution
  • steam — Players on Steam have a Steam-specific wallet
  • ios, android, xbox, playstation, nintendo, epic — Platform-specific wallets

A player's credits in one channel do not carry over to another.

Model Aliases

Rather than hardcoding specific model names, the SDK supports default model aliases that automatically resolve to the best available model for that category:

AliasCategory
default-chat-modelGeneral-purpose text generation
default-chat-fastFast, low-latency text generation
default-image-modelImage generation
default-3d-model3D model generation
default-transcription-modelSpeech-to-text

Using aliases instead of specific model names means your game automatically benefits from model upgrades without code changes. You can override these with a specific model name in the SDK configuration or per-request.

Content Moderation

PlayKit applies automatic content moderation to AI inputs and outputs based on your game's configuration. Moderation categories include illicit content, sexual content, hate speech, and violence. You can configure the moderation policy for your game on the dashboard.

Next Steps