---
title: "POST /api/v1/formulas"
method: POST
path: "/api/v1/formulas"
tags: ["formulas"]
---

# POST /api/v1/formulas

`POST /api/v1/formulas`

## Request

- Base URL: `https://api.blackforge.so` (the document declares no server; this is the origin it was published from)
- URL: `https://api.blackforge.so/api/v1/formulas`
- Auth: API key in header `x-api-key`

## Request body

- CreateFormulaDto
  - `expr` string, required: The formula source, e.g. `mid(binance:BTCUSDT) - mid(okx:BTC-USDT)`. Trade and book-change terms cover the w seconds ending one second before the value's timestamp; book terms are read at the timestamp.
  - `interval` number: Update interval in whole seconds, 1 to 60. Default 1.
  - `name` string, required: A name you choose, 1 to 80 characters.
  - `ephemeral` boolean: Keep it for one hour only, outside your saved-formula count. For "watch this for a minute".

## Response `201`

Saves a formula. Values are computed server-side every interval while it is streamed or behind an active notification, charged 1 row per referenced pair per evaluation. Trade and book-change terms cover the w seconds ending one second before the value's timestamp; book terms are read at the timestamp. Ultra only; any other plan gets 403 {"error":{"code":"plan_required","plan":"ultra","upgrade":"https://blackforge.so/pricing"}}.

---

[API](https://skmtc.dev/blackforge/apis/blackforge-data-api.md) · [All operations](https://skmtc.dev/blackforge/apis/blackforge-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/blackforge/apis/blackforge-data-api/revisions/04eadd230b1b?raw)
