🎯 Need Help?

Get Premium Support

Priority assistance from the developer

More from ANWP

Football Leagues Premium

Complete football/soccer league management for WordPress

Learn more →

AI Writer

Pro Feature

AI Writer is a premium feature that generates professional game reviews and match predictions using artificial intelligence. Whether you need comprehensive post-game analysis or data-driven predictions for upcoming matches, AI Writer streamlines the content creation process.

Overview

AI Writer supports two content types:

  • Game Reviews – Generate comprehensive match analysis for finished games
  • Match Predictions – Create data-driven predictions for upcoming games based on historical data

Each content type works in two modes:

  • Generate AI – Uses OpenAI API to generate content directly within WordPress
  • Export JSON – Export structured game data for use with external AI tools (ChatGPT, Claude, Perplexity, DeepSeek, etc.)

Requirements

RequirementDetails
PHP Version8.2 or higher (required for OpenAI SDK)
Plugin VersionSports Leagues Premium v0.14.0+
OpenAI API KeyRequired only for direct AI generation mode

Getting Started

AI Writer follows a simple three-step workflow:

Step 1: API Setup

  1. Navigate to Sports Leagues > AI Writer in WordPress admin
  2. Enter your OpenAI API key and click Save & Validate
  3. If you prefer using external AI tools, click Skip for now

Tip

You can skip API setup entirely and use Export JSON mode. This lets you paste game data into ChatGPT, Claude, or any AI tool you already have access to.

Step 2: Select Game

  1. Enter a Game ID directly in the input field, or
  2. Click Browse to search and select a game from your database
  3. Click Apply & Continue

Finding a Game ID: Open the Games list in WordPress admin. The Game ID appears in the rightmost column of each row.

Step 3: Generate Review or Prediction

The interface automatically detects whether your selected game is finished or upcoming, and shows the appropriate options.

Game Reviews (Finished Games)

For completed games, AI Writer generates comprehensive match reviews based on game data.

Generate AI Review Mode

  1. Select Generate AI Review mode
  2. Choose which data sections to include (Team Stats, Game Events, Player Stats)
  3. Select an OpenAI model from the dropdown
  4. Customize the prompt to match your writing style
  5. Click Write Game Review
  6. Copy the generated review using the Copy Review button

Game Data Sections

SectionDescriptionRequired
General game dataTeams, score, date, competitionYes
Team statsPossession, shots, passes, foulsOptional
Game eventsGoals, cards, substitutions with timestampsOptional
Player statsIndividual player performance dataOptional

Generated Review Output

After generation completes, you will see token usage statistics and the generated review. Use the Copy Review button to copy the text.

Export JSON Mode

If you prefer using external AI tools or want to avoid API costs:

  1. Select Export JSON Data mode
  2. Choose which data sections to include
  3. Click Export Game Data (JSON)
  4. A JSON file downloads automatically
  5. Open ChatGPT, Claude, or your preferred AI tool
  6. Paste the JSON content and add your custom prompt

Match Predictions (Upcoming Games)

For scheduled games, AI Writer generates predictions based on historical team form and head-to-head data.

Historical Data Configuration

Team Form Data:

  • Select number of recent games to include: 10, 20, or 30
  • Choose data sections: General game data, Team Stats, Game Events

Head-to-Head Data:

  • Select number of H2H games: 5, 10, or 15
  • Choose data sections: General game data, Team Stats, Game Events

Important

Predictions use significantly more tokens than game reviews due to historical data. We recommend using Export JSON mode for predictions to avoid high API costs.

Token Usage Comparison

Content TypeTypical Token Usage
Game Review7,000 – 10,000 tokens
Match Prediction15,000 – 50,000+ tokens

Example Prediction Output

A well-crafted prediction includes probability assessments, key factors, predicted scoreline, and betting insights based on historical patterns.

Using External AI Tools

The Export JSON mode works with any AI tool that accepts text input. Here is an example using Claude:

Benefits of Export JSON mode:

  • No OpenAI API key required
  • Use your existing AI subscriptions (ChatGPT Plus, Claude Pro, etc.)
  • Better cost control with flat subscription pricing
  • Flexibility to choose different AI models and providers
  • Ability to refine prompts and regenerate without additional costs

Example Prediction Prompt

Use this comprehensive prompt template for professional match predictions:

You are an experienced sports journalist and betting analyst writing a comprehensive game preview/prediction article.

## Article Structure (1000-1500 words)

1. **Introduction & Match Context** (150-200 words)
   - Fixture significance, competition, date, kickoff, venue
   - Betting odds context with implied probabilities
   - What's at stake

2. **Home Team Form Analysis** (200-250 words)
   - W/D/L record, goals for/against
   - Home vs away form split, trajectory, scoring patterns
   - xG, possession style, shot conversion (if stats available)

3. **Away Team Form Analysis** (200-250 words)
   - Same depth as home team
   - Focus on away form specifically
   - Attacking threats, defensive vulnerabilities

4. **Statistical Deep Dive** (150-200 words)
   - xG comparison, possession styles, defensive metrics
   - Set piece threat, discipline/cards per game

5. **Injuries and Team News** (100-150 words)
   - List missing players, analyze impact of each absence

6. **Head-to-Head Analysis** (150-200 words)
   - Historical record, recent meetings detail
   - Venue patterns, key moments

7. **Key Factors & Match Deciding Elements** (100-150 words)
   - 3-5 decisive factors: form, home advantage, injuries

8. **Prediction & Betting Insights** (200-250 words)
   - Probabilities for all three outcomes (must sum to 100%)
   - Predicted scoreline with reasoning
   - Additional betting angles: Over/Under, BTTS, cards
   - Confidence level: High / Medium / Low

## Output Format

End with formatted prediction box:

**PREDICTION**
- **Most Likely Outcome:** [Home Win / Draw / Away Win]
- **Probability:** Home Win X% | Draw X% | Away Win X%
- **Predicted Score:** [X-X]
- **Confidence:** [High / Medium / Low]

Important: Make It Your Own
This example prompt is a starting point only. Modify it significantly to create unique content that stands out. Add your site’s personality, preferred terminology, specific sections you want (or don’t want), and any unique angles that differentiate your coverage from competitors.

OpenAI API Setup

Getting an API Key

  1. Create an account at platform.openai.com
  2. Add billing credit (minimum $5 recommended)
  3. Navigate to the API Keys section
  4. Click Create new secret key
  5. Copy the key (it starts with sk-)

Available Models

ModelContext WindowBest For
gpt-4o128,000 tokensBest quality, higher cost
gpt-4o-mini128,000 tokensGood balance of quality and cost
gpt-4-turbo128,000 tokensPrevious generation GPT-4
gpt-3.5-turbo16,385 tokensMost affordable option

Tip

Use gpt-4o-mini for most tasks. It provides excellent quality at approximately 95% lower cost than gpt-4o.

Changing Your API Key

After initial setup, you can change your API key at any time:

  1. Select any game to proceed to Step 3
  2. Click the Change API Key link in the top right corner
  3. Enter your new key in the modal dialog
  4. Click Save & Validate

Customizing Prompts

The quality of AI-generated content depends heavily on your prompts. Customize them to match your site’s voice and style.

Prompt Best Practices

  • Never use default prompts as-is – identical prompts generate similar content structures across sites
  • Match your publication’s voice – specify tone, style, and target audience
  • Be specific about format – define length, structure, and focus areas
  • Save custom prompts – use the “save prompt” link to reuse across games
  • Reset when needed – use “reset to default” to start fresh

Example Review Prompt

You are a professional sports journalist. Based on the game data provided,
write a compelling 300-400 words match recap that captures the essence of
the game. The recap should include a detailed analysis of player
performances, highlighting the standout performer from the match.

Do not use the default prompt. Instead, modify it to be more descriptive
in order to meet your needs, and then click on "Save Prompt".

Cost Optimization Tips

  1. Use gpt-4o-mini instead of gpt-4o for 95% cost savings
  2. Use Export JSON mode for predictions (external AI tools often have flat subscription pricing)
  3. Select only needed data sections – skip player stats if you will not reference them
  4. Reduce historical data range – use 10 games instead of 30 for team form

Troubleshooting

API Key Validation Failed

Solutions:

  • Verify the key starts with sk-
  • Ensure the key was copied completely (not truncated)
  • Check that billing is set up on your OpenAI account
  • Try generating a new key from OpenAI dashboard

Generation Request Failed

Solutions:

  • Check OpenAI service status at status.openai.com
  • Verify your API key has available credit
  • Try a different model
  • Reduce data sections to lower token count

PHP Version Error

If the AI Writer page shows a PHP version warning, upgrade to PHP 8.2 or higher. This is required for the OpenAI SDK.

Note

The PHP 8.2 requirement only applies to the direct AI generation mode. Export JSON mode works on any PHP version supported by the plugin.