API Introduction
Use the API when a team needs to automate uploads, poll analysis status, export reports, or connect MolTrace to existing laboratory systems.
Base URL
Section titled “Base URL”https://api.moltrace.com/v1| Environment | URL |
|---|---|
| Production | https://api.moltrace.com/v1 |
| Sandbox | https://sandbox.api.moltrace.com/v1 |
Authentication
Section titled “Authentication”All requests require an API key in the Authorization header:
curl https://api.moltrace.com/v1/analyses \ -H "Authorization: Bearer mt_sk_live_YOUR_KEY"Never expose API keys in browser-side code. Store them in environment variables or a secure server-side secret manager.
Generate keys from Settings -> API Keys -> Create Key. Server-side automation should read MOLTRACE_API_KEY from the environment or a managed secret store.
Rate limits
Section titled “Rate limits”| Plan | Requests per minute | Max parallel uploads |
|---|---|---|
| Starter | 60 | 2 |
| Pro | 300 | 10 |
| Enterprise | Custom | Custom |
Confirm these values against backend configuration before public release.
Error codes
Section titled “Error codes”| Code | Meaning | Recommended action |
|---|---|---|
400 | Bad request | Check request body, required files, and enum values. |
401 | Invalid API key | Regenerate or rotate the API key. |
422 | Validation failed | Correct field-level validation errors. |
429 | Rate limit exceeded | Wait for reset or request a higher plan limit. |
500 | Server error | Retry with exponential backoff and contact support if repeated. |
Source of truth
Section titled “Source of truth”The OpenAPI 3.1 schema is stored at api-reference/openapi.yaml for published docs and mirrored in the repository at api-reference/openapi.yaml. Every backend pull request that adds or changes an endpoint must update the schema in the same change.
Read first
Section titled “Read first”Write the tutorial and first module guide before relying on the API reference. The API should automate a workflow users already understand.