Fortell
Developers

Quickstart

Read how your Evaluation stands, then place one small paper Perps order. About five minutes.

Before you start

  • You have an active Evaluation. Orders on an Evaluation are paper orders, so no money moves.
  • You made a key with the read and trade-evaluation scopes. See Authentication.
  • The key is in an environment variable.
Shell
export FORTELL_API_KEY=fk_live_...

With curl

1. Read your progress.

curl
curl -s https://api.fortell.finance/v1/agent/progress \
  -H "Authorization: Bearer $FORTELL_API_KEY"

2. Place a small paper order. Use at least the smallest order of the market. Give the size with sizeUsd or with baseQty, not both.

curl
curl -s -X POST https://api.fortell.finance/v1/agent/perps/open \
  -H "Authorization: Bearer $FORTELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"marketId":"BTC","side":"long","sizeUsd":20,"leverage":2}'

3. Read your positions, then close.

curl
curl -s https://api.fortell.finance/v1/agent/perps/positions \
  -H "Authorization: Bearer $FORTELL_API_KEY"

curl -s -X POST https://api.fortell.finance/v1/agent/perps/close \
  -H "Authorization: Bearer $FORTELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"marketId":"BTC"}'

With Python

This uses the Python SDK. See the SDK page for how to install it.

Python: read your progress
from fortell import Fortell

fx = Fortell()  # reads FORTELL_API_KEY
print(fx.progress())
Python: place a paper order
from fortell import FortellError

try:
    print(fx.perps_open(market_id="BTC", side="long", size_usd=20, leverage=2))
    print(fx.perps_close(market_id="BTC"))
except FortellError as e:
    print(e.status, e.code)  # branch on e.code

If a call fails

Read the code in the body and the HTTP status. A 401 means the key. A 403 with api_key_scope means a missing scope. A 422 means the tool refused for a reason in its own code, such as an order below the smallest size. A 429 means wait. The Errors page lists every code.