Selenium API

Route-search docs for agents

Give this page to an AI agent after creating a B12 API key. It can read the REST reference, download the OpenAPI schema, install the Codex skill, and run asynchronous synthesis route searches without manual setup.

REST API OpenAPI Codex skill
OpenAPI JSON

Machine-readable API schema for custom clients and agent tool generation.

REST reference

Quote, submit, poll, fetch routes, credits, capabilities, and errors.

Codex skill

Drop-in skill package for agents that support Codex-style skill installation.

Quickstart

What to give your agent

Read the B12 Selenium Route Search API docs:
https://b12-labs.com/docs/selenium-route-search/

Use this API base URL:
https://api.b12-labs.com

Use the B12 API key I provide in your secret store. Quote first, submit with a stable Idempotency-Key, poll using retry_after_seconds, then fetch /routes and summarize the route families.

Workflow

Agent loop

  1. Read the docs and OpenAPI schema.
  2. Store the B12 API key as a secret.
  3. Call /v1/capabilities and /v1/credits.
  4. Quote with /v1/route-searches/quote.
  5. Submit with an idempotency key.
  6. Poll using retry_after_seconds.
  7. Fetch /v1/route-searches/{job_id}/routes.

Guardrails

Keep it clean

  • Never paste API keys into prompts or logs.
  • Quote before submitting paid work.
  • Use stable idempotency keys for retries.
  • Show route-family summaries, solved status, feasibility, and commercial leaves.
  • Avoid exposing internal ids unless debugging support asks for them.

REST API

Minimal request sequence

Quote

curl -X POST "$SELENIUM_API_URL/v1/route-searches/quote" \
  -H "Authorization: Bearer $B12_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"smiles":"CC(=O)Oc1ccccc1C(=O)O","tier":"standard"}'

Submit

curl -X POST "$SELENIUM_API_URL/v1/route-searches" \
  -H "Authorization: Bearer $B12_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: aspirin-standard-001" \
  -d '{"smiles":"CC(=O)Oc1ccccc1C(=O)O","name":"aspirin","tier":"standard"}'

Poll

curl "$SELENIUM_API_URL/v1/route-searches/$JOB_ID" \
  -H "Authorization: Bearer $B12_API_KEY"

Fetch routes

curl "$SELENIUM_API_URL/v1/route-searches/$JOB_ID/routes" \
  -H "Authorization: Bearer $B12_API_KEY" \
  -o selenium-routes.json