API Reference
Essential API endpoints for retrosynthesis analysis.
Authentication
All requests require the X-API-KEY
header.
Main Endpoints
POST /api/retrosynthesis: Perform retrosynthesis analysis on a target molecule.
POST /api/partial_rerun: Rerun retrosynthesis from a specific step with new parameters.
POST /api/rerun_retrosynthesis: Rerun complete retrosynthesis with same or updated parameters.
Utility Endpoints
GET /api/health: Check API server health and status.
POST /api/clear_molecule_cache: Clear cached results for a specific molecule.
Model Configuration
Available LLM Models:
Model |
Identifier |
Internal Name |
---|---|---|
Claude 3 Opus |
|
|
Claude 3.7 Sonnet |
|
|
Claude 4 Sonnet |
|
|
DeepSeek-R1 |
|
|
Available AiZynthFinder Models:
Model Version |
Description |
---|---|
|
Standard USPTO database (free, default) |
|
25% Pistachio database coverage |
|
50% Pistachio database coverage |
|
100% Pistachio database coverage |
|
Enhanced Pistachio coverage |
Error Handling
HTTP Status Codes:
Code |
Status |
Description |
---|---|---|
200 |
OK |
Request successful |
400 |
Bad Request |
Invalid parameters or SMILES |
401 |
Unauthorized |
Invalid or missing API key |
404 |
Not Found |
Endpoint not found |
500 |
Internal Error |
Server error |
Error Response Format:
1{
2 "status": "error",
3 "error": {
4 "code": "INVALID_SMILES",
5 "message": "The provided SMILES string is invalid",
6 "details": "Could not parse SMILES: 'invalid_smiles'"
7 }
8}
Common Error Codes:
Error Code |
Description |
---|---|
|
SMILES string cannot be parsed |
|
API key is invalid or missing |
|
Specified model is not available |
|
Retrosynthesis analysis failed |
|
Too many requests in time window |
Rate Limiting
API requests are rate-limited to ensure fair usage:
Limit Type |
Restriction |
---|---|
Requests per minute |
60 requests/minute per API key |
Concurrent requests |
5 simultaneous requests per API key |
Daily requests |
10,000 requests/day per API key |
When rate limits are exceeded, the API returns HTTP 429 with:
1{
2 "status": "error",
3 "error": {
4 "code": "RATE_LIMIT_EXCEEDED",
5 "message": "Rate limit exceeded. Please try again later.",
6 "retry_after": 60
7 }
8}