Render exercise art
Serve an exercise illustration frame from its stable URL, with a silhouette standing in until the drawing is published.
Show the exercise being performed, in the same drawn style as the muscle figures.
Use the image template returned in an exercise record’s frames array and replace
{publishableKey} with the publishable half of your key.
/v1/{publishableKey}/exercises/{id}/{figure}/{frame}.webp <img
src="https://cdn.gymassets.dev/v1/{key}/exercises/myfv/male/start.webp"
alt="Curl with barbell, start position"
/>content-type: image/webp
cache-control: public, max-age=3600
access-control-allow-origin: *
access-control-expose-headers: x-art-status, x-quota-statusPath parameters
| Parameter | Behavior |
|---|---|
publishableKey | Authorizes the image request and assigns it to the Exercise art allowance |
id | The id field of an exercise record: its identity, permanent by design |
figure | male or female |
frame | start or finish |
Formats are webp and png. Any other extension returns 400 unsupported_format
with the supported list, and a path missing one of the segments returns 400 with
the expected shapes.
Silhouette stand-ins
A frame whose drawing is not yet published returns 200 with a neutral silhouette
of the requested figure and this header:
x-art-status: coming-soon
The header is exposed to browser JavaScript. A response without it carries the finished drawing. Finished artwork is published to the same URL, and appears without any change to the requesting page.
The frames array on the exercise record lists only published drawings, and
GET /v1/exercises?drawn=true returns only exercises that have them. An interface
that should not show silhouettes filters there instead of probing image URLs.
Muscle masks
Each drawn frame publishes the mask layers used to highlight the worked muscles on the illustration:
| Leaf | Contents |
|---|---|
{frame}-mask-primary.png | The primary muscles, as an alpha layer aligned to the frame |
{frame}-mask-secondary.png | The secondary muscles — present only when the record lists any |
The record’s frames array carries a template for every mask that exists. A mask
request for an undrawn frame returns 404 not_found — there is no silhouette
stand-in for a mask — and the response names the collection that lists drawn
exercises:
{
"error": "not_found",
"key": "exercises/uqgq/male/start-mask-primary.png",
"exercises": "https://api.gymassets.dev/v1/exercises?drawn=true"
}
Caching
Responses state their window in cache-control. A finished drawing is cacheable
for one hour. A silhouette stand-in is cacheable for five minutes, and a newly
published drawing therefore appears within minutes with no cache to purge.
Allowance
When the Exercise art allowance for the key is crossed, images keep serving and the
response carries x-quota-status: exhausted. An end user never meets a broken
image because of an account limit.