FencingAI API
Documentation

Joints from video, in one request.

Upload a clip, pick the athlete, get the 3D position of every joint in every frame as JSON. The fastest way to use it is to give your AI agent the skill; the raw HTTP API is below it.

Quickstart with an agent

  1. Create an account and make an API key. Save it: it is shown once.
  2. Download the skill and unzip it where your agent keeps skills (Claude Code: .claude/skills/). Agents without skills can read its SKILL.md as plain instructions.
  3. Put your key in the skill's .env file:
POSE_API_URL=https://api.fencingai.org
POSE_API_KEY=fai_your_key_here

Then ask your agent something like "get the 3D joints from lunge.mp4 and tell me my front knee angle at the deepest point."

The two models

mediapipefencingai
In shortFast and reliable, but not as accurate.Real-world 3D space, gravity aligned, tracks the person you choose. Needs more time, higher quality.
Joints3324
SpaceBody-relative: origin at the hips every frameWorld: floor at y = 0, the athlete moves through it
Distance, speed across the floor, jump heightNoYes
Cost1 token per second of video5 tokens per second of video

Tokens

Every account has a token budget, shared by all its keys. A video costs seconds of video × the model's rate, rounded up. A job that fails is refunded. Check your balance on the Usage page or with GET /v1/usage. Try ideas on short clips with MediaPipe, and spend FencingAI tokens on the clips that matter.

HTTP API

Base URL https://api.fencingai.org. Send your key on every request: Authorization: Bearer fai_...

1. See who is in the video (free)

curl https://api.fencingai.org/v1/people \
  -H "Authorization: Bearer $POSE_API_KEY" \
  -F video=@clip.mp4 -F t=0

Returns each person numbered left to right with the target to use for them, and a picture of the frame with the numbers drawn on it (image_jpeg_base64).

2. Send the video

curl https://api.fencingai.org/v1/pose3d \
  -H "Authorization: Bearer $POSE_API_KEY" \
  -F video=@clip.mp4 -F model=fencingai \
  -F 'target={"x":0.18,"y":0.55,"t":0}'
{"job_id": "4be1c0…", "status": "queued", "jobs_ahead": 1,
 "tokens_charged": 60, "tokens_remaining": 1140}

Fields: video (mp4, mov or webm, up to 60 s and 200 MB), model, target (largest, or a point from step 1), static_cam (true if the camera is on a tripod; FencingAI model only).

3. Poll for the result

curl https://api.fencingai.org/v1/jobs/4be1c0… -H "Authorization: Bearer $POSE_API_KEY"
{"status": "done", "result": {
  "model": "fencingai",
  "video": {"fps": 30, "frame_count": 360, "width": 1280, "height": 720},
  "coordinate_system": {"units": "meters", "axes": {"y": "up, aligned with gravity"}, …},
  "joint_names": ["pelvis", "left_hip", …],
  "skeleton": [[0, 1], [0, 2], …],
  "frames": [{"i": 0, "t": 0.0, "detected": true,
              "joints": [[x, y, z], …],        // meters
              "joints_2d": [[u, v], …]}, …]    // pixels, for drawing on the video
}}

Poll every 2 to 5 seconds. One FencingAI job and two MediaPipe jobs can run per account at a time.

Other calls

GET /v1/modelsWhich models are available right now, their limits and token rates
GET /v1/usageYour budget, tokens used and tokens left

Errors

401Missing or wrong key
402Not enough tokens for this video
400Video too long, unreadable, or a bad target
429You already have a job of that model running, or you are polling too fast
503The models are offline. They run during events.

Good footage

What this is not

Results are measurements of movement, not medical advice. Treat anything injury-related as "worth a look", never a diagnosis. And an API account does not include the fencingai.org app: see fencingai.org access.