F1 RAG API REFERENCE

View Live Site

API Deployment Addresses

Use the following base URLs depending on whether you are querying the live production app or testing on your local development machine.

Production Base URL https://f1.alkile.dev
Local Base URL http://localhost:8000

NVIDIA NIM Key Configuration

Follow this tutorial to get your own NVIDIA API key and configure it in the application.

How to Get your Key

  1. Go to the official NVIDIA NIM API Catalog.
  2. Log in or register for a free Developer Account.
  3. Select any Large Language Model, such as google/diffusiongemma-26b-a4b-it.
  4. Click "Get API Key" or "Generate Key" to generate your unique credential.
  5. Copy the generated key (it always starts with the prefix nvapi-).

How to Apply it

Paste your copied key into the NVIDIA NIM AI Settings card on the left sidebar of the Dashboard UI and click "Save API Key". The dashboard will automatically reload and use your credentials to generate F1 predictions and execute RAG chats.

Programmatic API Header

When querying the backend REST APIs directly via fetch or curl, you can supply your custom API key using the HTTP request header:

X-NVIDIA-API-Key: nvapi-your-key-here
GET /api/f1/standings

Retrieves the current Driver standings and Constructor standings of the ongoing 2026 World Championship.

SAMPLE CURL
curl -X GET "https://f1.alkile.dev/api/f1/standings"
JSON RESPONSE
{
  "drivers": [
    {
      "position": "1",
      "points": "171",
      "wins": "2",
      "Driver": { "driverId": "antonelli", "code": "ANT", "givenName": "Andrea Kimi", "familyName": "Antonelli" },
      "Constructors": [{ "constructorId": "mercedes", "name": "Mercedes" }]
    }
  ],
  "constructors": [
    {
      "position": "1",
      "points": "302",
      "wins": "3",
      "Constructor": { "constructorId": "mercedes", "name": "Mercedes", "nationality": "German" }
    }
  ]
}
GET /api/f1/schedule

Retrieves the complete 2026 race calendar schedule including GP dates, city locations, tracks, and session start times.

SAMPLE CURL
curl -X GET "https://f1.alkile.dev/api/f1/schedule"
GET /api/f1/results

Retrieves the complete details and finishing results for all completed races of the 2026 season.

SAMPLE CURL
curl -X GET "https://f1.alkile.dev/api/f1/results"
GET /api/f1/news

Returns the latest F1 news scraped from Autosport and Motorsport.com RSS feeds.

SAMPLE CURL
curl -X GET "https://f1.alkile.dev/api/f1/news"
GET /api/f1/predict

Returns next race win probabilities (weighted standing points, recent form, team strength), world championship win projections, and a RAG-infused AI report explaining the news and details.

Request Headers

Header Type Required Description
X-NVIDIA-API-Key string Yes Your custom NVIDIA API key (starts with nvapi-).
SAMPLE CURL
curl -X GET "https://f1.alkile.dev/api/f1/predict" \
  -H "X-NVIDIA-API-Key: nvapi-your-key-here"
JSON RESPONSE
{
  "upcoming_race": { "raceName": "British Grand Prix", "date": "2026-07-05", "Circuit": { "circuitName": "Silverstone Circuit" } },
  "next_race_probabilities": [
    { "driver_name": "Andrea Kimi Antonelli", "team_name": "Mercedes", "probability": 23.2 }
  ],
  "drivers_championship_probabilities": [
    { "driver_name": "Andrea Kimi Antonelli", "probability": 21.6 }
  ],
  "ai_analysis": "## AI Prediction Report...\nSilverstone is a high speed track which suits..."
}
POST /api/chat

Streams real-time, context-grounded SSE responses for chatbot interactions.

Request Headers

Header Type Required Description
X-NVIDIA-API-Key string Yes Your custom NVIDIA API key (starts with nvapi-).

Request Body

Name Type Required Description
message string Yes User query text.
top_k integer No (default: 3) Number of matching context chunks to retrieve.
FETCH EXAMPLES (SSE STREAMING)
const response = await fetch("https://f1.alkile.dev/api/chat", {
  method: "POST",
  headers: { 
    "Content-Type": "application/json",
    "X-NVIDIA-API-Key": "nvapi-your-key-here"
  },
  body: JSON.stringify({ message: "Who won Monaco GP?", top_k: 3 })
});

const reader = response.body.getReader();
// Decode and parse the SSE chunks on the "content" data lines...
POST /api/ingest

Launches a background thread task to sync live standings and schedules from Jolpica-F1 API, scrape news articles, and update vector store embeddings.

SAMPLE CURL
curl -X POST "https://f1.alkile.dev/api/ingest"
POST /api/upload

Uploads custom documents (`.txt` or `.md` format) to the server to instantly chunk, embed, and index into the RAG vector search.

Multipart Form Params

Name Type Required Description
file file Yes Text or Markdown document.