Skip to content

Developer API

Build on SynovAI

Plan retrosynthesis routes programmatically. Submit a target molecule, poll for confidence-scored routes, and pull reaction metadata, literature references, and scores, all over a REST API and a hosted MCP server for agents.

1. Get an API key

API access is included on Professional (with usage limits) and Enterprise (configurable by contract) plans. Signed-in users on those plans can mint keys at Account → API keys. The key is shown once; store it somewhere safe. Authenticate every request with it as a bearer token:

Authorization: Bearer <your-api-key>
# or, equivalently:
X-API-Key: <your-api-key>

Rotating a key. Choose Rotate on the same page to give the key a new secret. Its limits, pricing and usage history are kept. By default the old secret keeps working for 24 hours so you can switch without an outage; if you think a key was exposed, revoke the old secret immediately instead. Keys that SynovAI issued to your account, such as partner keys, are listed there whatever your plan. The key’s owner is emailed whenever a key is rotated, and the email never contains the key.

Additional partner keys. If you hold a partner key, create additional keys from Account → API keys with New key from my partner contract, whatever your plan: they inherit your contract. Each new key carries the contract’s pricing, limits and exclusions, and shares its spend caps, run limits and launch credits with your other keys, so it adds no budget or capacity. If you hold both a production and a sandbox key, choose which one the new key is based on. A contract holds up to 10 active keys; revoke one you no longer use to make room. The owner is emailed for every new key.

Sandbox pricing. Sandbox responses report cost_usd: 0 and would_cost_usd, the production price.

Not on a paid plan yet? See plans or talk to us.

2. Submit and poll

The core workflow is submit-then-poll. POST /execute creates the job and returns an id; poll GET /jobs/{id} until the status is success or error. Set the SYNOVAI_API_KEY environment variable first.

Submit a target

curl https://platform.synovai.net/api/v1/execute \
  -X POST \
  -H "Authorization: Bearer $SYNOVAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "predict_route",
    "params": { "smiles": "CC(=O)Nc1ccc(O)cc1", "num_steps": 4, "temperature": "Standard" }
  }'

Response:

{
  "status": "accepted",
  "job_id": "cltask_01h7x2k0...",
  "poll_url": "/api/v1/jobs/cltask_01h7x2k0...",
  "cost_usd": 5.0
}

num_steps is the route length the search aims for (accepted range 2–8). It bounds what you may send, not what comes back — routes are not strictly capped by it and have been observed longer, so treat it as a guide rather than a guarantee. temperature controls how exploratory the search is: Well-Precedented → Standard → Exploratory → Novel. Run GET /tools for the live list of tools and per-call prices, or POST /forecast to quote a job before running it.

Every response that carries routes includes schema_version, currently "1.0". It versions the route-tree shape — path_dicts and the fields inside each node — not this API. A minor bump is additive and safe to ignore; a major bump changes or removes an existing field. If you parse the tree, pin on the major.

Poll for the result

curl https://platform.synovai.net/api/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer $SYNOVAI_API_KEY"

# while "status" is "running", keep polling. Terminal states: "success" or "error".

The same flow in Python:

import os, time, requests

API = "https://platform.synovai.net/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SYNOVAI_API_KEY']}"}

# 1. Submit a target
submit = requests.post(f"{API}/execute", headers=HEADERS, json={
    "tool": "predict_route",
    "params": {"smiles": "CC(=O)Nc1ccc(O)cc1", "num_steps": 4, "temperature": "Standard"},
}).json()
job_id = submit["job_id"]

# 2. Poll until terminal
while True:
    job = requests.get(f"{API}/jobs/{job_id}", headers=HEADERS).json()
    if job["status"] in ("success", "error"):
        break
    time.sleep(5)

# 3. Use the routes
print(job["status"], job.get("result"))

3. Errors, busy and polling

Every error body is { "status": "error", "error": "…", "code": "…" }. Show error to a person and branch on code, which is stable.

HTTP status codes: real codes by default, the old 200 body on request

Every key gets real HTTP status codes for refusals: 400 bad input, 402 spend cap, 403 not allowed, 404 unknown student, 409 project closed or locked, 422 run limit reached, 429 busy, 500/503 our fault.

curl https://platform.synovai.net/api/v1/execute \
  -X POST \
  -H "Authorization: Bearer $SYNOVAI_API_KEY" \
  -H "SynovAI-Errors: http" \
  -H "Content-Type: application/json" \
  -d '{ "tool": "predict_route", "params": {} }'

HTTP/1.1 400 Bad Request
{ "status": "error", "error": "Missing required parameter: smiles", "code": "invalid_request" }

An older integration that expects every refusal as HTTP 200 with status: "error" in the body can send the header SynovAI-Errors: legacy. A missing or bad key (401), the spend cap (402), busy (429), a failed dispatch (500, SUBMIT_FAILED) and unavailable capacity (503, RESERVE_FAILED) use real codes in both modes.

HTTP/1.1 200 OK
{ "status": "error", "error": "Missing required parameter: smiles", "code": "invalid_request" }

429: busy or rate-limited

busy, class_busy and engine_busy mean the queue is full. Nothing was started or charged. Wait the number of seconds in the Retry-After header, then send the same request again, and back off further if it repeats. rate_limit_exceeded means the key sent more requests this minute than its limit (60 a minute unless your agreement says otherwise); read the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers. Every call counts, polls included.

Polling

Poll GET /jobs/{id} at a steady interval (every 15–30 seconds suits a single run; SuperSampling sweeps take longer) until status is success or error. error covers every unsuccessful end (failed, canceled, no routes); the reason is in error.

SMILES in URLs

Send SMILES in the JSON body. SMILES use characters that mean something in a URL: # starts a fragment, + reads as a space in a query string, and /, \, %, =, @, [ and ] are reserved. If a SMILES ever goes in a query string or a link, percent-encode it (encodeURIComponent in JavaScript, urllib.parse.quote(smiles, safe='') in Python). Build JSON bodies with a JSON library so any backslash is escaped for you.

Read-only keys

For dashboards and CI that only read results, create a read-only key: tick Read-only key when you create a key on Account → API keys, including a new key from your partner contract. A read-only key can read jobs, batches, rankings and exports, but it cannot spend money, submit or move runs, store anything or change settings. Those calls answer 403 with error: "key_scope_read_only" and the header X-Key-Scope: read_only, before anything runs or is charged.

  • Refused: POST /execute, POST /api/v2/batch (inline and chunked), a batch's /targets, /upload, /seal, /pause, /resume, /retry, /cancel and /handoff, PATCH /jobs/{id}, stage, view, template and scoring-profile writes, webhook management, the billed predictions (/conditions, /route-conditions, /patents/check) and /outcomes.
  • Billed reads are refused too: GET /jobs/{id}/analysis, /convergence, /references and /sourcing are charged per molecule, so a read-only key cannot call them.
  • Exports: the synchronous POST /api/v2/batch/{id}/export works; async: true is refused, because it stores the file and queues work.
  • MCP: the key is offered only the read tools. Calling submit_retrosynthesis, predict_conditions or log_outcome returns a JSON-RPC error with error.data.code key_scope_read_only.
  • A read-only key sees what its owner can see, like any key of that owner. The scope is fixed: rotating keeps it, and it cannot be widened. Every operation in the API reference is marked x-key-scope: read or write.

Class chatbot keys

A class with the class WhatSyn add-on can connect a course chatbot. The class owner creates a class key on the class's WhatSyn tab; it is shown once. A class key is not general API access. It can only call POST /execute (predict_route or super_sample, always with on_behalf_of), GET /jobs/{id} for jobs it submitted, and GET /class/projects. Anything else answers 403 class_key_scope. It stops working when the add-on is switched off or closes, or when its creator no longer manages the class.

curl https://platform.synovai.net/api/v1/execute \
  -X POST \
  -H "Authorization: Bearer $CLASS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "super_sample",
    "on_behalf_of": "student@university.edu",
    "class_project": "cm9classproj001",
    "params": { "smiles": "CC(=O)Nc1ccc(O)cc1", "lengths": [2, 4] }
  }'
  • on_behalf_of (required): the student's email. The student must already have joined the class in SynovAI with that email. The run belongs to the student, goes into their group's project, and costs the student nothing.
  • class_project: the project id from GET /class/projects. Optional when exactly one project is open.
  • Route length: params.num_steps (one length) or params.lengths (a list; exactly one entry for predict_route), never both. Every length must be in the class's allowed set. name is optional.
  • callback_url, min_steps, max_steps, precedence, deep_search, exclude_smiles and starting_material are refused; poll the job instead.
  • The accepted response adds view_url (where the student opens the result), project_url, queue_position (1 = next to start; null once it has started), lengths and grid_size. While the job runs, GET /jobs/{id} also returns queue_position and view_url.
  • GET /class/projects?on_behalf_of=… lists the open projects, the allowed run types and lengths, and how many runs the student has left in each project.

Class error codes (real HTTP codes by default)

codeHTTP
invalid_request400
invalid_smiles400
class_project_required400
class_key_scope403
addon_inactive403
key_inactive403
run_type_not_allowed403
lengths_not_allowed403
dangerous_target, compound_blocked403
student_not_enrolled404
project_closed, project_locked409
run_limit_reached422
class_busy, engine_busy429
submit_failed, models_unavailable500, 503

With SynovAI-Errors: legacy, every class refusal answers HTTP 200 except class_key_scope, addon_inactive and key_inactive from the key check (403) and the busy codes (429). Teachers: see Using WhatSyn in your class.

What the API covers

Reference: interactive API reference (try calls with your key), the OpenAPI spec at /api/v1/docs and the downloadable openapi.json.
  • Submit: single and batch. POST /execute submits one target. POST /api/v2/batch submits up to 100 targets in one call and returns a batch job to poll (GET /api/v2/batch/{id}, /result, /cancel). For more, create it with mode "chunked", append chunks of up to 1,000 to /targets, then /seal it. GET /api/v2/batch/{id}/ranked ranks the whole batch under one scoring profile and filters, free, and lists any filter it could not apply.
  • Status and polling, webhooks and callbacks. GET /jobs/{id} to poll. Pass callback_url on a submit for a per-job callback (batches send one per molecule plus a batch.completed event), or register signed webhooks with POST /webhooks.
  • Results: route tree and scored routes. GET /jobs/{id} returns the route tree. GET /jobs/{id}/scored re-ranks under a scoring profile and filters by reaction type, hazard or SMILES pattern. Filtering is free.
  • The metrics bundle. GET /jobs/{id}/analysis (cost per kg, green metrics, scalability, and sourced GHS per material from PubChem with the source named and a verify link, plus a per-route ghs_summary: H-code and hazard-class counts with the steps they are in, the fixed GHS highest-concern codes, and coverage that separates compounds with a record, with none, and not looked up; never a SynovAI hazard assessment, and a compound without a record is not assumed safe), /references, /convergence and POST /patents/check.
  • Sourcing and lab prep. GET /jobs/{id}/sourcing for suppliers and purchasability of a route’s compounds. GET /jobs/{id}/lab-prep for a bench-ready procedure, reagent CSV and shopping list, with hazards_markdown carrying a per-route GHS summary table and coverage line, then sourced GHS per material (as returned by PubChem, source named) and a supplier-SDS pointer, never a SynovAI hazard assessment.
  • Library convergence. POST /library-convergence finds the intermediates shared across many completed jobs.
  • SuperSampling. tool: "super_sample" on /execute sweeps every parameter permutation for one target and merges the unique routes into one job.
  • Usage and launch credits. GET /usage returns usage and spend for your key, with a per-end-user breakdown and launch-credit position where you hold credits.
  • Projects, folders and pipeline stages. Every run is filed in a project: send project_id and folder_id on POST /execute or POST /api/v2/batch (per batch or per target), or it goes in your key’s default project. GET /projects, /projects/{id}/folders and /projects/{id}/stages list where you can file. POST /projects/{id}/stages adds a stage. PATCH /jobs/{id} moves a job by the same rules as the app: a stage that needs approval opens a decision recording the target stage and answers 202 instead of moving it. Approving the decision moves the job (checked again at that point: still in the project, stage not archived, not already there); rejecting or withdrawing leaves it. The project owner, who approves, moves straight in.
  • Key management: rotation and partner keys. Create, rotate and revoke keys under Account → API keys. A rotated key keeps its limits and history. Partners create additional keys from Account → API keys; they inherit your contract. See Rotating a key below.
  • MCP. The same tools over a hosted MCP server at POST /api/v1/mcp.

Limits and queueing

Each plan has a number of concurrent runs. A submit past your concurrency limit is accepted and queued rather than refused: the response carries queued: true and a queue_position (1 = next to start), and the run starts as one of yours finishes. GET /jobs/{id} keeps reporting the position. If the waiting queue for your plan is full you get 429 busy and nothing is charged.

Large batches

Create a batch with mode: "chunked", append targets to /targets in chunks of up to 1,000 (a retried chunk with the same chunk_index is not added twice), check GET /targets for invalid and duplicate rows, then call /seal. Duplicates are matched by exact SMILES string. /seal?dry_run=true returns the run count, the price at your key’s rate and a completion-time range measured from recent runs, or no range when there are too few to measure. Sealing starts as many runs as your queue and spend cap allow; the rest wait as pending and are started automatically as your queue frees, checked every minute. Stateless keys submit inline only.

To send a file instead of JSON, POST /upload a multipart form with file and format (csv, sdf or smi; for CSV, smiles_column if the header is not smiles or canonical_smiles). The file is read in memory and discarded; its rows go through the same validation and duplicate check as /targets, and every record appears in the report, with a reason when it could not be read (an SDF record with no structure is invalid, not skipped). SDF structures are taken from a SMILES field when present, otherwise converted from the molblock. The default limits are 8 MiB and 25,000 rows per file; beyond that, use /targets.

Set spend_cap_cents when you create a chunked batch to cap what that batch can spend. When the next run would pass it, the batch pauses with paused_reason: "spend_cap" and sends a batch.paused webhook; raise the cap with /resume to continue. Your key’s daily and monthly caps still apply: when one is reached the batch waits and carries on when it resets. /pause and /resume stop and restart new runs (runs already started finish), and /retry runs failed molecules again. Only the key that created a batch can change it; your other keys can read it.

Your own catalog

Pass catalog_id (from GET /catalogs) in params on POST /execute (predict_route) or in input on POST /api/v2/batch, with catalog_mode filter (the default) or highlight. The catalog's contents are frozen when you submit, so editing it later does not change that job, and are matched on canonical SMILES when the result is read. filter drops routes with a starting material outside your catalog; highlight drops nothing. Either way the job result carries a catalog object: routes_generated, routes_after_catalog, kept_route_indices and the starting materials found in your catalog. stock_filter (vendor stock) is applied by the model itself and only returns routes whose starting materials are all in that stock, so with both, every returned route already counts as available and none is dropped. Your catalog's SMILES are never sent to the model. A catalog that is not yours or your team's is 404 catalog_not_found; stateless keys get 400 stateless_not_supported, because the filter runs on a stored result.

Partner keys

Partner keys have run limits set to the volume in your agreement, plus spend caps with an alert at 80% of the cap and a hard stop at 100%. Those limits and caps belong to the agreement, not to one key: every key issued under it draws on the same allowance, so adding a key adds no budget and no capacity.

Billing

Billing is per successful run; failed runs are not charged. The metrics bundle (/analysis, /references, /convergence and /patents/check) is billed once per molecule per key per month, however many of those endpoints you call for it. Lab prep and scored-route filters are free. Run GET /tools for live per-call prices.

Endpoints

Base URL https://platform.synovai.net/api/v1. Full request/response schemas are in the interactive reference and the OpenAPI spec.

MethodPath
POST/execute
GET/jobs
GET/api/v2/batch
POST/api/v2/batch/{id}/targets
POST/api/v2/batch/{id}/upload
GET/api/v2/batch/{id}/targets
POST/api/v2/batch/{id}/seal
POST/api/v2/batch/{id}/pause
POST/api/v2/batch/{id}/resume
POST/api/v2/batch/{id}/retry
GET/api/v2/batch/{id}/ranked
GET/api/v2/batch/{id}/convergence
GET/api/v2/batch/compare?a=&b=
GET/api/v2/batch/{id}/pareto
GET/api/v2/batch/{id}/clusters
GET/api/v2/batch/{id}/stream
POST/api/v2/batch/{id}/export
GET/api/v2/batch/{id}/export/{export_id}
POST/api/v2/batch/{id}/handoff
GET/jobs/{id}
GET/jobs/{id}/references
GET/jobs/{id}/scored
GET/views
POST/views
GET/views/{id}
GET/batch-templates
POST/batch-templates
GET/batch-templates/{id}
GET/catalogs
GET/scoring-profiles
POST/scoring-profiles
POST/validate-smiles
POST/forecast
GET/tools
POST/patents/check
GET/usage
POST/webhooks
PATCH/jobs/{id}
GET/projects
GET/projects/{id}/folders
GET/projects/{id}/stages
POST/projects/{id}/stages
GET/class/projects

MCP for agents

For agentic integrations we expose a hosted Model Context Protocol server at /api/v1/mcp (Streamable HTTP, JSON-RPC 2.0). Point any MCP-compatible client (Claude Desktop, Cursor, custom agents) at it with your API key as a bearer token, and the agent can drive retrosynthesis directly. Tools exposed:

  • submit_retrosynthesis
  • get_job_status
  • get_job_references
  • get_job_convergence
  • validate_smiles

See the MCP setup guide for Claude Desktop, Cursor, and direct JSON-RPC config.

Ready to build?

Mint a key and make your first call in a couple of minutes.