B2B Quickstart

Custom F1 League in 5 Minutes

This guide walks you through creating a custom Formula 1 fantasy league with your own scoring rules using the Chikoh B2B API.

1Provision a tenant

curl -X POST https://chikoh.com/api/v1/b2b/tenants \
  -H "Authorization: Bearer YOUR_PROVISIONING_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My F1 League App", "tier": "developer" }'

Response (save these keys — shown only once):

{
  "tenant_id": "uuid...",
  "sk_live": "sk_live_...",
  "sk_test": "sk_test_..."
}

2Create a league with scoring rules

curl -X POST https://chikoh.com/api/v1/leagues \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "F1 Championship 2026",
    "sport": "f1",
    "entity_type": "driver",
    "roster_slots": { "DRIVER": 5, "TEAM": 1 },
    "scoring_rules": [
      { "stat": "finish_position", "operator": "exact", "value": 1, "points": 25 },
      { "stat": "finish_position", "operator": "exact", "value": 2, "points": 18 },
      { "stat": "finish_position", "operator": "range", "value": [3, 10], "points": 12 },
      { "stat": "is_fastest_lap", "operator": "boolean", "value": true, "points": 1 },
      { "stat": "laps_completed", "operator": "threshold", "value": 1, "points": 0.1 }
    ]
  }'

3Send a scoring event

curl -X POST https://chikoh.com/api/v1/events/ingest \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "entity_id": "max_verstappen",
    "event_type": "race_result",
    "value": {
      "finish_position": 1,
      "is_fastest_lap": true,
      "laps_completed": 57
    },
    "timestamp": "2026-03-15T15:30:00Z",
    "period_id": "round_3"
  }'

That's it. Chikoh evaluates your rules asynchronously and writes a score_breakdown.

Next steps