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

# POST /api/agent/formulas

`POST /api/agent/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/agent/formulas`
- Auth: HTTP bearer

## 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 `200`

Save a formula. Trade and book-change terms cover the w seconds ending one second before the value's timestamp; book terms are read at the timestamp.

---

[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)
