Skip to main content
Qyren is a server-to-server REST API. Your game backend calls Qyren; your game client never does. This page walks through the three endpoints you need to wire up: ingest events, request a recommendation, and report feedback.

Base URL and authentication

Every request needs a bearer token in the Authorization header:
Two key prefixes:
  • qyr_test_… — sandbox. Events validate and store but never affect billing or production models. Recommendations come from a deterministic seed so your tests are repeatable.
  • qyr_live_… — production. Real events, real recommendations, billable.
Get keys from the dashboard. Never check them into source control. Never ship them in your game client.

Endpoint 1: Ingest events

Stream every meaningful gameplay, economy, and monetization event to this endpoint. It’s the foundation of everything else — dashboards, alerts, and recommendations are all derived from what you send here.

Request

Batching

  • Up to 100 events per request.
  • Up to 10 KB per event.
  • Flush every 2–5 seconds, or whenever you reach ~50 buffered events, whichever comes first. Don’t wait for the batch to fill — latency hurts model quality more than a few extra HTTP calls cost you.

Response codes

Partial acceptance example

event_index is the position in the array you sent. Use it to find the offending event in your local buffer, fix it, and retry just that one. Full schema details are in Event Schema.

Endpoint 2: Request a recommendation

Call this whenever a player hits a trigger where you’d consider showing an offer — shop opened, level cleared, login bonus, end-of-battle screen.

Request

context is optional but strongly encouraged. The more you tell Qyren about the player’s current state, the better the picks.

Response

If no offers are eligible after filtering and pacing, offers is an empty array and you should fall back to your default. When you actually show offers on screen, log an offer_impression event for each one. This is non-negotiable — without impressions, Qyren can’t compute conversion rates and recommendations get worse over time.

Latency and timeouts

  • p95 under 150ms for /v1/recommend.
  • Set a client-side timeout of around 500ms.
  • If the call times out or fails, fall back to a default offer list. Never block gameplay waiting on Qyren.
For triggers in tight loops (end-of-battle popup that fires every 30 seconds), pre-fetch at session start and cache for a few minutes. Re-fetch when the player’s state changes meaningfully (level up, large purchase, currency milestone).

Endpoint 3: Report feedback

Tell Qyren what happened after a recommendation was shown. This is how the AI engine learns and improves over time.

Request

outcome values: If you’re already sending purchase and offer_impression events on /v1/ingest, Qyren can derive most of this automatically — but explicit feedback closes the loop faster and is recommended for your highest-value placements.

Putting it together

A typical session looks like:
  1. Player opens the game → log session_start to /v1/ingest.
  2. Player opens the shop → call /v1/recommend, get an ordered list, render it, log offer_impression for each rendered offer.
  3. Player taps an offer → log offer_click.
  4. Player completes purchase → log purchase. Optionally also send a converted feedback event.
  5. Player closes the game → log session_end.
That’s the whole loop. Everything else — dashboards, economy health, alerts — falls out of these calls automatically.