Skip to main content
The Chemolytic API exposes every active deployment as two prediction endpoints. Use them to integrate predictions into your LIMS, lab automation, or custom scripts.
API predictions require the allow_api_predict plan feature. Free plans don’t include API access. Upgrade to Pro or higher to enable it.

Endpoints

Both endpoints live under the deployment URL: The full URL appears on the Integration tab of the deployment detail page.

Authentication

All requests need an API key in the Authorization header:
See API keys for how to create one.

JSON endpoint

Use this when you can pre-parse spectra into arrays of numbers (e.g., from your own data pipeline).

Request

Response (200 OK)

For classification models, value is the predicted category as a string.

File endpoint

Use this when you have raw files exported by your spectrometer and don’t want to parse them yourself.

Request

Form fields:

Response

Identical to the JSON endpoint.

Code samples

The Integration tab on the deployment detail page generates ready-to-use snippets. Examples:

Python

JavaScript

cURL (JSON)

cURL (file upload)

Limits

For very large batches, split your spectra across multiple requests.

Errors

Example 400 errors

Example 429 error

Logging and usage

Every API prediction is:
  • Recorded in PredictionLog with the API key, sample count, and timestamp (90-day retention)
  • Aggregated daily in PredictionUsage for quick quota lookups (kept permanently)
You can see your aggregated usage on the deployment detail page under API predictions this month.

Tips

Batch predictions: send 10-50 spectra per request rather than one at a time. Fewer round-trips, lower latency, less quota waste.
Cache the endpoint URL and API key in environment variables: don’t hard-code them in your scripts. Treat the API key like a password.
Handle 429 gracefully: check remaining in the response and pause until the quota resets if needed.