Developer Tutorial: Run OpenAI SDKs, Claude Code & Codex on FLOP Testnet
With runtime specVersion 1014042, always use @flop-labs/cli@0.10.5+ and @flop-labs/sdk@0.14.0+ (or Docker image ghcr.io/flop-labs/flop-core/cli:v0.1.544) so runtime version checks pass cleanly.
Option 1: Local OpenAI-Compatible Proxy (flop-openai-router)
If your agent uses the standard Python/TypeScript openai SDK, LangChain, CrewAI, Cline, Continue, or Cursor, run joachimber/flop-openai-router locally on http://127.0.0.1:8787/v1:
git clone https://github.com/joachimber/flop-openai-router.git
cd flop-openai-router
npm install
export FLOP_KEY_PASSWORD="your-keystore-password"
# Defaults to FLOP_INDEXER_URL=https://flopmesh.com and --max-flop 9.5 (auto-clamps smaller wallets)
npx flop-openai-router --keystore ./agent.json
Then call it from Python with zero code changes:
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="flop-local")
resp = client.chat.completions.create(
model="qwen/qwen2.5-coder-7b-instruct",
messages=[{"role": "user", "content": "Write a lock-free ring buffer in Rust."}],
max_tokens=384,
)
print(resp.choices[0].message.content)
print("Settled tx:", resp.model_extra.get("x_flop"))
Option 2: flop launch claude / codex Wallet Channel Mode
@flop-labs/cli@0.10.5 includes native long-session wallet mode that opens a signed standing-offer channel via --indexer https://flopmesh.com and tops up escrow automatically as you code:
read MINER ENDPOINT MODEL < <(curl -fsSL https://flopmesh.com/live | jq -r '.miners[0] | "\(.miner) \(.endpoint) \(.model)"')
FLOP_KEY_PASSWORD="..." npx @flop-labs/cli@0.10.5 --network testnet \
--keystore ./agent.json --password-env FLOP_KEY_PASSWORD \
launch claude --pay wallet --indexer https://flopmesh.com \
--miner "$MINER" --endpoint "$ENDPOINT" --model "$MODEL" \
--budget-flop 50 --max-channel-flop 9.9 --top-up-flop 3.5