Quickstart

Get your first narrative ad running in 5 minutes. This guide covers the minimum integration — 3 API calls.

Step 1: Get Your API Key

Register as a developer on the Scrya dashboard and generate an API key. All requests use Bearer token authentication:

Authorization: Bearer sk_live_your_api_key_here

Step 2: Enable Placements

Tell Scrya your game accepts ads:

curl -X POST https://api.scrya.com/api/ads/placements/my_game_id \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "creator_id": "your_user_id",
    "placement_types": ["narrative_hook"],
    "revenue_share_pct": 70,
    "max_ads_per_session": 5
  }'

Step 3: Match an Ad

When generating a scene, ask Scrya for the best matching ad:

curl -X POST https://api.scrya.com/api/ads/match \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "game_id": "my_game_id",
    "user_id": "player_123",
    "player_geo": {"country_code": "US"},
    "game_context": {
      "theme_id": "1",
      "category": "simulation",
      "narrative": "The president faces a difficult decision",
      "mood_tags": ["tense"]
    },
    "session_id": "sess_abc"
  }'

Response (200):

{
  "campaign_id": "camp_abc123",
  "creative_id": "crt_def456",
  "narrative_hook": "A familiar logo on the briefing folder catches your eye...",
  "creative_type": "narrative_hook",
  "brand_name": "Acme Corp",
  "biased_pipeline": {
    "lighting": "warm golden hour",
    "effects": "cinematic widescreen, film grain"
  },
  "cpm_bid_cents": 200
}

If no ads match, you get 204 No Content — just proceed normally.

Step 4: Display the Hook

Insert the narrative_hook into your game's dialogue or narration. The hook is pre-written by the advertiser to sound natural in your game's context.

Optionally apply biased_pipeline values to your scene renderer for visual influence (lighting, effects, location).

Step 5: Record the Impression

After the player sees the ad-influenced content, record it:

curl -X POST https://api.scrya.com/api/ads/impressions \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "camp_abc123",
    "creative_id": "crt_def456",
    "game_id": "my_game_id"
  }'

That's it. The advertiser is charged, and you earn your revenue share.

What's Next?