Skip to content

Search bFLOPS

Pages, GPUs on the list, your machines and actions.

Language中文

REST API

Rent GPU machines from your own code over plain HTTP and JSON.

View as Markdown

The REST API does everything the site does for machines: list, price, start, watch, extend and stop. Every request needs an API key.

Base URL

https://bflops.com/api/v1

Authentication

Send your key in the Authorization header:

On your computer
curl https://bflops.com/api/v1/balance \
  -H "Authorization: Bearer bf_..."

x-api-key: bf_... works too. A missing or wrong key gets 401 with the code unauthorized.

Rent a machine in four calls

Find a machine

curl "https://bflops.com/api/v1/machines?model=RTX%204090&limit=1" \
  -H "Authorization: Bearer $BFLOPS_KEY"

Take id from the first entry of data. See Machines.

Get a quote

curl https://bflops.com/api/v1/quotes \
  -H "Authorization: Bearer $BFLOPS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"offer_id": "s4821"}'

Take quote.id. It is good for 60 seconds. See Quotes.

Start it

curl https://bflops.com/api/v1/rentals \
  -H "Authorization: Bearer $BFLOPS_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-run-001" \
  -d "{\"quote_id\": \"q_...\", \"ssh_key\": \"$(cat ~/.ssh/id_ed25519.pub)\", \"ttl_hours\": 4}"

Take rental.id. Its status is starting. See Rentals.

Wait, then connect

Read GET /rentals/{id} every 10 seconds until status is running, then run its ssh command. Stop it with POST /rentals/{id}/stop.

Conventions

  • JSON in and out, field names in snake_case. Send Content-Type: application/json with a body; a body is at most 16 KiB.
  • Money is a string of US dollars, such as "0.44" or "12.075031". Parse it as a decimal, never as a float.
  • Times are ISO 8601 in UTC, such as "2026-11-27T09:30:00.000Z".
  • Prices are always yours, with our fee in them.
  • Lists come in data, newest or cheapest first.

Rate limits

Each key may make 120 reads and 30 changes a minute. Quotes, starts, stops and extends are changes. Over that, you get 429 with a Retry-After header in seconds: wait that long, then retry.

Safe retries

POST /rentals and POST /rentals/{id}/extend take an Idempotency-Key header: 8 to 64 letters, digits, _ or -. Send the same key again within 24 hours and you get the first answer back, with the header Idempotent-Replayed: true, and nothing starts twice. Use a new key for each new start.

Endpoints

MethodPathWhat it does
GET/machinesMachines on the list, with filters
GET/machines/{id}One machine
GET/clustersClusters on the list
GET/clusters/{id}One cluster
POST/quotesYour price, held 60 seconds
POST/rentalsStart what a quote priced
GET/rentalsYour rentals
GET/rentals/{id}One rental with its events
POST/rentals/{id}/stopStop it; billing ends at once
POST/rentals/{id}/extendMore time before it stops by itself
GET/balanceYour balance and how to top it up

Errors are listed in Errors. The whole API is in English.