AI Integration Guide

Build a fitness GPT
with a real exercise API

Turn ChatGPT, Claude or your own chatbot into a fitness assistant that pulls real exercises, animated GIFs and structured workouts from the WorkoutX API — with a copy-paste Actions schema and system prompt.

verified Published by the WorkoutX team — builders of the exercise GIF API used by fitness app developers. Learn more ·

Build a Fitness GPT with an Exercise API Cover Image - WorkoutX Blog
bolt Quick Summary (TL;DR)

To build a fitness GPT, create a WorkoutX API key, add a Custom GPT Action with API-key auth on the X-WorkoutX-Key header, paste an OpenAPI schema for endpoints like /v1/exercises/bodyPart/{bodyPart}, /v1/exercises/exercise/{id} and /v1/workout/generate, and give the GPT a system prompt that tells it when to call each one. Lookups work on the Free plan; workout generation needs Pro or Ultra. The same endpoints work as tools for Claude or any function-calling LLM.

What you will build

A fitness GPT is a custom ChatGPT (or any LLM assistant) that answers training questions using real exercise data instead of whatever the model happens to remember. In this guide you connect a Custom GPT to the WorkoutX Exercise API through GPT Actions, so it can look up exercises by body part, pull step-by-step instructions and an animated gifUrl for any exercise, suggest equipment alternatives, and generate a complete workout session with one call.

The same setup works for a custom GPT workout generator, an AI fitness chatbot inside your own app, or an agent built on Claude or another model with tool calling. The API does the data work; the model handles the conversation.

Which plan do you need?

Exercise lookup endpoints (by body part, by ID, alternatives) work on every plan, including Free (500 requests/month, 30 requests/minute, up to 10 results per request, no credit card). The AI Workout Generator (/v1/workout/generate) requires Pro ($15.99/mo) or Ultra ($24.99/mo). The multi-week program generator (/v1/workout/program) is Ultra only. Calling a plan-gated endpoint with a lower-tier key returns 403.

Step 1 — Create your API key

Register on the WorkoutX Developer Portal and copy your key (it starts with wx_). Every request authenticates with the X-WorkoutX-Key header against the base URL https://api.workoutxapp.com/v1. Test it before wiring up the GPT:

terminal
curl 'https://api.workoutxapp.com/v1/exercises/bodyPart/chest?limit=5' \
  -H "X-WorkoutX-Key: wx_your_key_here"

Step 2 — Add a Custom GPT Action

In ChatGPT, open the GPT editor, go to Configure → Actions → Create new action. Set Authentication to API Key, auth type Custom, header name X-WorkoutX-Key, and paste your key. Then paste a schema. The minimal OpenAPI 3 spec below covers four real endpoints and is enough for a useful fitness GPT:

workoutx-actions.yaml
openapi: 3.1.0
info:
  title: WorkoutX Exercise API
  version: "1.0"
servers:
  - url: https://api.workoutxapp.com
paths:
  /v1/exercises/bodyPart/{bodyPart}:
    get:
      operationId: getExercisesByBodyPart
      summary: List exercises for a body part
      parameters:
        - name: bodyPart
          in: path
          required: true
          schema:
            type: string
            enum: [back, cardio, chest, lower arms, lower legs, neck,
                   shoulders, upper arms, upper legs, waist]
        - name: limit
          in: query
          schema: { type: integer, default: 10 }
  /v1/exercises/exercise/{id}:
    get:
      operationId: getExerciseById
      summary: Get one exercise with instructions and gifUrl
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
  /v1/exercises/{id}/alternatives:
    get:
      operationId: getExerciseAlternatives
      summary: Same target muscle, different equipment
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
        - name: equipment
          in: query
          schema: { type: string }
  /v1/workout/generate:
    get:
      operationId: generateWorkout
      summary: Generate a structured workout session (Pro and Ultra plans)
      parameters:
        - name: goal
          in: query
          schema:
            type: string
            enum: [muscle_gain, strength, fat_loss, endurance, mobility]
        - name: duration
          in: query
          schema: { type: integer, minimum: 20, maximum: 120, default: 45 }
        - name: level
          in: query
          schema: { type: string, enum: [beginner, intermediate, advanced] }
        - name: split
          in: query
          schema: { type: string }
        - name: equipment
          in: query
          description: Comma-separated, e.g. dumbbell,body weight
          schema: { type: string }
components:
  schemas: {}
  securitySchemes:
    WorkoutXKey:
      type: apiKey
      in: header
      name: X-WorkoutX-Key
security:
  - WorkoutXKey: []

Want every endpoint (target muscle, equipment, search, calories, similar exercises, supplements, programs)? The full, maintained spec is published at https://workoutxapp.com/openapi.json. Importing it gives the GPT more options, but a trimmed spec with clear summary lines usually leads to more reliable action selection.

Plan note: if your key is on Free or Basic, remove generateWorkout from the schema so the GPT doesn't call an endpoint that will return 403.

Step 3 — Paste a ready system prompt

Put this in the GPT's Instructions field. It tells the model when to call each action and how to present the results:

instructions.txt
You are a friendly strength and conditioning assistant.
Always use the WorkoutX actions for exercise data. Never invent exercises.

When a user asks for a workout:
1. Ask for goal, time available, experience level and equipment if missing.
2. Call generateWorkout with goal, duration, level and equipment.
3. Present warmup, exercises (sets x reps, rest) and cooldown as a clean list.

When a user asks how to do an exercise:
- Call getExerciseById (or getExercisesByBodyPart to find it) and summarise
  the instructions in 3-5 short steps. Show the gifUrl image so they can
  check their form.

When a user cannot use a piece of equipment:
- Call getExerciseAlternatives with the exercise id and their equipment.

If an action returns 429, tell the user the limit was reached and to try
again shortly. If it returns 403, explain the feature needs a higher plan.
Remind users you are not a medical professional when they mention pain or injury.

Add a few conversation starters such as "Build me a 30-minute beginner fat-loss workout with dumbbells" or "How do I do a Romanian deadlift?" and test in the preview pane. You should see ChatGPT ask to call the WorkoutX action, then render a structured session.

Step 4 — The same idea for Claude and other LLMs

You don't need ChatGPT to build an AI fitness chatbot. Claude, and most modern LLM APIs, support tool (function) calling: you describe a tool with a JSON schema, the model returns a tool call with arguments, your server calls WorkoutX, and you pass the JSON result back. A tool definition for the workout generator looks like this:

tool-definition.json
{
  "name": "generate_workout",
  "description": "Generate a structured workout session (warmup, exercises with sets/reps/rest, cooldown) via the WorkoutX API. Requires a Pro or Ultra key.",
  "input_schema": {
    "type": "object",
    "properties": {
      "goal": { "type": "string", "enum": ["muscle_gain", "strength", "fat_loss", "endurance", "mobility"] },
      "duration": { "type": "integer", "minimum": 20, "maximum": 120 },
      "level": { "type": "string", "enum": ["beginner", "intermediate", "advanced"] },
      "equipment": { "type": "string", "description": "Comma-separated equipment list" }
    },
    "required": ["goal", "level"]
  }
}

And the server side that executes it keeps your key out of the client:

run-tool.js
// Your server runs the tool call the model asks for
async function runTool(name, input) {
  if (name === "generate_workout") {
    const qs = new URLSearchParams(input).toString();
    const res = await fetch(`https://api.workoutxapp.com/v1/workout/generate?${qs}`, {
      headers: { "X-WorkoutX-Key": process.env.WORKOUTX_KEY }
    });
    if (res.status === 429) return { error: "rate_limited", retry: true };
    return await res.json(); // send this back to the model as the tool result
  }
}

Define similar tools for exercise lookup by body part, exercise by ID and alternatives, and reuse the system prompt from Step 3. The field names differ slightly between providers (for example input_schema vs parameters), but the pattern is identical. For a deeper walkthrough of the generator endpoint, see our AI workout generator API guide.

Production tips

Frequently asked questions

Can I build a Custom GPT that uses an exercise API?

Yes. Create an Action in the GPT editor, set API Key authentication with the custom header X-WorkoutX-Key, and paste an OpenAPI schema for the WorkoutX endpoints you want. The full spec is available at https://workoutxapp.com/openapi.json.

Which WorkoutX plan do I need for a custom GPT workout generator?

Exercise lookup endpoints work on every plan, including Free. The /v1/workout/generate endpoint requires the Pro ($15.99/mo) or Ultra ($24.99/mo) plan, and the multi-week /v1/workout/program endpoint requires Ultra.

Does this work with Claude or other LLMs, not just ChatGPT?

Yes. Any model that supports tool or function calling can use the same endpoints. Describe each endpoint as a tool with a JSON schema, execute the call on your server with the X-WorkoutX-Key header, and return the JSON result to the model.

How do I show exercise demonstrations in the chatbot?

Every WorkoutX exercise object includes a gifUrl field pointing to an animated demonstration. Instruct the assistant to display that image alongside the exercise instructions.

What happens when my fitness GPT hits the rate limit?

The API returns HTTP 429 when a per-minute rate limit or monthly quota is exceeded. Cache repeat lookups, watch the X-RateLimit-Remaining and X-Quota-Remaining response headers, and have the assistant ask the user to retry shortly.

bolt

Give your GPT real exercise data

Get a free API key in under a minute, test the lookup endpoints, and upgrade to Pro when you want AI workout generation.

Get free API key arrow_forward