---
# System prepended metadata

title: AI Cards API (Sportsbook v3)

---

# AI Cards API (Sportsbook v3)

## Validations

- Feature flag for Ai Cards is enabled (Configurator)
- Bet has been settled after a configured date (Configurator)
- Bet is settled as won

## Display CTA

This will be implemented as an extra field `displayAiCards` in the bet history response for each settled bet in the Sportsbook v3 - Betting API

## Response status values

- `1 - NotFound` - There are no generated images or cards for this bet (On Boarding),
- `2 - PendingImageGeneration` - Image generation is in progress (Image Loader),
- `3 - CompletedImageGeneration` - Image generation is completed and user must select an image (Select card),
- `4 - PreviewCards` - User selected an image and previews the generated cards (Final cards),
- `5 - PendingVideoGeneration` - Video generation is in progress (Video Loader),
- `6 - CompletedVideoGeneration` - Video generation is completed and user can share the video (Final video)
- `7 - PendingNFTMinting` - NFT Minting is in progress (Loader) (Not live yet)
- `8 - CompletedNFTMinting` - NFT Minting is completed and user can see the NFT details (Not live yet)

## Generate images

Request
```
POST /api/ai-cards

{
    "betId": 123
}
```

Success Response

_See response with status 2 in [Get result](#Get-result)_


## Create cards

Request
```
POST /api/ai-cards/{betId}/cards

{
    "selectedImageId": "id"
}
```

Success Response

_See response with status 4 in [Get result](#Get-result)_


## Create video

Request
```
POST /api/ai-cards/{betId}/video

{
    "hideAmounts": true
}
```

Success Response

_See response with status 5 in [Get result](#Get-result)_


## Mint NFT (Not live yet)

Request
```
POST /api/ai-cards/{betId}/nft
```

Success Response

_See response with status 7 in [Get result](#Get-result)_


## Get result

Request
```
GET /api/ai-cards/{betId}
```

Success Response (Status 1 - No generated images)
```
200 OK

{
    "status": 1
}
```

Success Response (Status 2 - Image generation pending)
```
200 OK

{
    "status": 2,
    "loaderRemainingSecs": 30
}
```

Success Response (Status 3 - Image generation still pending after loader completed)
```
200 OK

{
    "status": 3,
    "numberOfImagesToGenerate": 2,
    "generatedImages": [],
    "defaultImages": [
        {
            "id": "1",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_01fa9f07-b968-4d60-9a22-70505f75b4e5_thumb.jpeg"
        },
        {
            "id": "2",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_031dc4e5-13e7-4830-b7fb-d33926b8753d_thumb.jpeg"
        },
        {
            "id": "3",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_2052acf3-da14-450b-a9a0-f033e9d5ce07_thumb.jpeg"
        }
    ]
}
```

Success Response (Status 3 - Image generation partially completed)
```
200 OK

{
    "status": 3,
    "numberOfImagesToGenerate": 2,
    "generatedImages": [
        {
            "id": "52",
            "url": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/2500071341_1_455b88d4093c43fc8b200063ba8b274f_thumb.jpg"
        }
    ],
    "defaultImages": [
        {
            "id": "1",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_01fa9f07-b968-4d60-9a22-70505f75b4e5_thumb.jpeg"
        },
        {
            "id": "2",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_031dc4e5-13e7-4830-b7fb-d33926b8753d_thumb.jpeg"
        },
        {
            "id": "3",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_2052acf3-da14-450b-a9a0-f033e9d5ce07_thumb.jpeg"
        }
    ]
}
```

Success Response (Status 3 - Image generation completed)
```
200 OK

{
    "status": 3,
    "numberOfImagesToGenerate": 2,
    "generatedImages": [
        {
            "id": "53",
            "url": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/2500071341_1_455b88d4093c43fc8b200063ba8b274f_thumb.jpg"
        },
        {
            "id": "52",
            "url": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/2500071341_1_2eca4584f64d4146953c6e40ee5b6c08_thumb.jpg"
        }
    ],
    "defaultImages": [
        {
            "id": "1",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_01fa9f07-b968-4d60-9a22-70505f75b4e5_thumb.jpeg"
        },
        {
            "id": "2",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_031dc4e5-13e7-4830-b7fb-d33926b8753d_thumb.jpeg"
        },
        {
            "id": "3",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_2052acf3-da14-450b-a9a0-f033e9d5ce07_thumb.jpeg"
        }
    ]
}
```

Success Response (Status 4 - Cards generation completed)
```
200 OK

{
    "status": 4,
    "numberOfImagesToGenerate": 2,
    "generatedImages": [
        {
            "id": "52",
            "url": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/2500071341_1_455b88d4093c43fc8b200063ba8b274f_thumb.jpg"
        },
        {
            "id": "53",
            "url": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/2500071341_1_2eca4584f64d4146953c6e40ee5b6c08_thumb.jpg"
        }
    ],
    "defaultImages": [
        {
            "id": "1",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_01fa9f07-b968-4d60-9a22-70505f75b4e5_thumb.jpeg"
        },
        {
            "id": "2",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_031dc4e5-13e7-4830-b7fb-d33926b8753d_thumb.jpeg"
        },
        {
            "id": "3",
            "url": "https://staging-cards.gmlinteractive.com/default/betano-202311/_2052acf3-da14-450b-a9a0-f033e9d5ce07_thumb.jpeg"
        }
    ],
    "previewCards": [
        "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/f5b6099cb4279aa9d285d06ae8444c57_00.svg",
        "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/f5b6099cb4279aa9d285d06ae8444c57_01.svg",
        "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/f5b6099cb4279aa9d285d06ae8444c57_02.svg"
    ]
}
```

Success Response (Status 5 - Video generation pending)
```
200 OK

{
    "status": 5,
    "loaderRemainingSecs": 10,
    "rarityOddRanges": [
        {
            "color": "#9d9d9d",
            "name": "COMMON",
            "minOdds": "2.00",
            "maxOdds": "99.99",
            "nft": false (not live yet)
        },
        {
            "color": "#0070dd",
            "name": "RARE",
            "minOdds": "100.00",
            "maxOdds": "999.99",
            "nft": false (not live yet)
        },
        {
            "color": "#a335ee",
            "name": "EPIC",
            "minOdds": "1000.00",
            "maxOdds": "9999.99",
            "nft": false (not live yet)
        },
        {
            "color": "#ff8000",
            "name": "LEGENDARY",
            "minOdds": "10000.00",
            "maxOdds": "∞",
            "nft": true (not live yet)
        }
    ]
}
```

Success Response (Status 6 - Video generation completed)
```
200 OK

{
    "status": 6,
    "finalCard": "https://staging-cards.gmlinteractive.com/0025/0007/2500071341/f5b6099cb4279aa9d285d06ae8444c57...mp4",
    "isEligibleForNFT": true (Not live yet)
}
```

Success Response (Status 7 - NFT Minting Pending, Not live yet)
```
200 OK

{
    "status": 7,
    "loaderRemainingSecs": 20
}
```

Success Response (Status 8 - NFT Minting Completed, Not live yet)
```
200 OK

{
    "status": 8,
    "nftUrl": "....."
}
```