Skip to content

Agents and bots ​

The API is open and needs no key, so scripts, CI jobs and AI agents can call it directly. A few habits keep that working for everyone.

Identify your client ​

Send a User-Agent that names your project and a way to reach you:

sh
curl -A 'my-dex-bot/1.2 (+https://example.com; ops@example.com)' https://api.stxer.xyz/...
ts
await fetch(url, { headers: { 'User-Agent': 'my-dex-bot/1.2 (+https://example.com)' } })

Generic agents (python-requests, curl/8, an unnamed headless browser) are hard to tell apart from abuse.

Back off on errors ​

  • 409 with simulation_busy: — another submit to the same session is still running. Wait and retry the same request; do not open a new session.
  • 410 with simulation_outdated: — start a new session.
  • 429 or any 5xx — retry with exponential backoff and jitter (for example 1 s, 2 s, 4 s … up to a minute), and cap the number of retries.
  • 400 — the request is wrong; retrying will not help. The body says why.

Keep volume reasonable ​

  • Reuse one session for related steps instead of creating a session per step.
  • Use skip_tracing: true when you do not need traces (test suites); it is cheaper and faster.
  • Use instant simulation for a one-transaction preview.
  • Contract ASTs from GET /contracts/{id} are served with a long-lived cache-control; cache them.
  • Run steps for one session sequentially.

For large or sustained volume, talk to us first: [contact email]. See Limits.