{
  "openapi": "3.1.1",
  "info": {
    "title": "Easing Curve \u0026 Frame Spacing API",
    "version": "1.0.0",
    "summary": "See where a CSS or Lottie easing lands on every animation frame.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://fliplineeasingcurve.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "See where a CSS or Lottie easing lands on every animation frame.",
        "description": "Enter a CSS timing function such as ease-in-out, cubic-bezier(0.34, 1.56, 0.64, 1) or steps(4, jump-end), a transition length in frames and the start and end values. Get the value on every frame, the spacing between frames, overshoot and peak speed, a graph with an animator’s spacing chart, and CSS and Lottie handles.\n\nMethodology:\n- A cubic-bezier(x1, y1, x2, y2) curve runs from (0, 0) to (1, 1). Time x is solved for the curve parameter by 30 bisection steps (x is monotonic because x1 and x2 lie in 0–1); progress is the curve’s y at that parameter. Keywords use the CSS control points: ease (0.25, 0.1, 0.25, 1), ease-in (0.42, 0, 1, 1), ease-out (0, 0, 0.58, 1), ease-in-out (0.42, 0, 0.58, 1).\n- steps(n, position) follows the CSS step algorithm: jump-start and jump-both jump at time 0, jump-end and jump-both at the end, jump-none never; hold stays at the start value until the last frame.\n- A transition of N frames has N + 1 samples: frame 0 is the start key and frame N the end key, as in Flipline Motion Desk. Value = start + (end − start) × progress; spacing is the change since the previous frame. Peak speed compares the largest spacing with even (linear) spacing.\n- Y handles from −2 to 3 allow anticipation and overshoot. Lottie handles map o = (x1, y1) on the start key and i = (x2, y2) on the end key; steps have no Lottie handle form. Values are rounded to six decimals.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_easing_curve",
        "x-owner-app": "flipline",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineEasingCurveInput"
              },
              "examples": {
                "example1": {
                  "summary": "Slow in and slow out over twelve frames",
                  "value": {
                    "easing": "ease-in-out",
                    "frames": 12,
                    "from": 0,
                    "to": 100
                  }
                },
                "example2": {
                  "summary": "An overshooting pop from 0 to 240 pixels",
                  "value": {
                    "easing": "cubic-bezier(0.34, 1.56, 0.64, 1)",
                    "frames": 10,
                    "from": 0,
                    "to": 240
                  }
                },
                "example3": {
                  "summary": "Four held steps for a limited-animation blink",
                  "value": {
                    "easing": "steps(4, jump-end)",
                    "frames": 8,
                    "from": 0,
                    "to": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineEasingCurveResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FliplineEasingCurveInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "easing": {
            "title": "Easing (CSS timing function)",
            "type": "string",
            "maxLength": 200,
            "default": "ease-in-out"
          },
          "frames": {
            "title": "Transition length (frames)",
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "default": 12
          },
          "from": {
            "title": "Start value",
            "type": "number",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "default": 0
          },
          "to": {
            "title": "End value",
            "type": "number",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "default": 100
          }
        },
        "required": []
      },
      "FliplineEasingCurveResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "css",
              "controls",
              "lottie",
              "minProgress",
              "maxProgress",
              "overshoots",
              "peakSpeed",
              "peakFrame",
              "firstMove",
              "settle",
              "samples",
              "csv",
              "svg"
            ],
            "properties": {
              "css": {
                "type": "string"
              },
              "controls": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "number"
                }
              },
              "lottie": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "o",
                  "i"
                ],
                "properties": {
                  "o": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "x",
                      "y"
                    ],
                    "properties": {
                      "x": {
                        "type": "number"
                      },
                      "y": {
                        "type": "number"
                      }
                    }
                  },
                  "i": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "x",
                      "y"
                    ],
                    "properties": {
                      "x": {
                        "type": "number"
                      },
                      "y": {
                        "type": "number"
                      }
                    }
                  },
                  "h": {
                    "type": "integer"
                  }
                }
              },
              "minProgress": {
                "type": "number"
              },
              "maxProgress": {
                "type": "number"
              },
              "overshoots": {
                "type": "boolean"
              },
              "peakSpeed": {
                "type": "number"
              },
              "peakFrame": {
                "type": "integer"
              },
              "firstMove": {
                "type": "integer"
              },
              "settle": {
                "type": "integer"
              },
              "samples": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "frame",
                    "t",
                    "progress",
                    "value",
                    "delta"
                  ],
                  "properties": {
                    "frame": {
                      "type": "integer"
                    },
                    "t": {
                      "type": "number"
                    },
                    "progress": {
                      "type": "number"
                    },
                    "value": {
                      "type": "number"
                    },
                    "delta": {
                      "type": "number"
                    }
                  }
                }
              },
              "csv": {
                "type": "string"
              },
              "svg": {
                "type": "string"
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}