GeospatialGeospatial

Satellite Image Analysis API: Clay Foundation and TorchGeo

NASA Prithvi-EO + Clay Foundation + TorchGeo — the three open-source satellite foundation models via one API key.

SciRouter Team
April 11, 2026
13 min read

Every 5 days, the European Copernicus Sentinel-2 satellites image the entire land surface of the Earth at 10-meter resolution. Every 16 days, Landsat does it at 30 meters. Add SAR from Sentinel-1, MODIS, Harmonized Landsat Sentinel, and a growing list of commercial constellations, and Earth observation is now producing petabytes of imagery every year. The question is not whether you have the data. It is how you turn petabytes of pixels into answers.

Three developments in 2024 and 2025 changed the answer. First, open foundation models like Clay and Prithvi-EO made it possible to fine- tune accurate classifiers with hundreds of labeled examples rather than tens of thousands. Second, TorchGeo standardized the preprocessing pipeline. Third, cloud-native data formats like Cloud- Optimized GeoTIFF and STAC catalogs made bulk access tractable.

SciRouter's geospatial API combines all three into a single endpoint. You specify an area of interest and a task; the service fetches the right imagery, runs the right model, and returns the result as GeoJSON, raster, or a vector tile-ready mask.

Note
Copernicus Sentinel and NASA Landsat data are open and free for any use, commercial or otherwise. The API serves them from public mirrors. Commercial imagery (Planet, Maxar, Airbus) requires additional licensing which the API can bridge if your account is provisioned.

Earth observation is a data problem

A single Sentinel-2 granule covers 100 by 100 kilometers in 13 spectral bands at roughly 1 GB per acquisition. Multiply by 500 granules needed to cover a country, times a 5-year time series, and you are quickly past 100 TB for a single project. Setting up the storage, network, and compute to handle that locally is a multi- month project. The cloud-native Earth observation movement solves this by storing imagery in Cloud-Optimized GeoTIFF on object storage, with STAC catalogs for discovery, so you only fetch the pixels you actually need.

The API takes advantage of that infrastructure. When you submit an area of interest, the service queries STAC, downloads only the relevant tiles, and streams them into the model. You never handle gigabytes of imagery yourself.

Clay: the open Earth observation foundation model

Clay Foundation is an open-source foundation model for satellite imagery, analogous to what DINOv2 and MAE did for natural images. It was pretrained on a diverse multi-sensor corpus covering Sentinel-2, Sentinel-1 SAR, Landsat, and MODIS, and the resulting embedding space captures semantic similarity across sensors and seasons.

What makes Clay valuable in practice is few-shot transfer. A classical approach to mapping, say, oil palm plantations in Borneo would require tens of thousands of labeled polygons to train a segmentation model from scratch. With Clay as a backbone, a few hundred labels are often enough to fine-tune an accurate model. That reduces labeling cost from six figures to four, which is the difference between a project that happens and one that does not.

  • Backbone. Vision transformer pretrained with a masked autoencoder objective.
  • Licenses. Open source (Apache-2) with commercial use permitted.
  • Use cases. Land cover classification, change detection, crop mapping, building segmentation, habitat monitoring.

Prithvi-EO: NASA and IBM for Landsat

Prithvi-EO is the geospatial counterpart to Prithvi-WxC (weather and climate). It is a transformer trained on HLS (Harmonized Landsat Sentinel) data and released openly on Hugging Face. Compared to Clay, it is more specialized for Landsat-class sensors and has a particularly strong fine-tuning story for burn scars, flood masks, and agricultural extent.

There is no single right answer for which model to use. The recommended pattern is to run both on a labeled benchmark for your task and pick the better performer. The API exposes both with a single parameter change.

TorchGeo: the plumbing layer

Microsoft's TorchGeo library handles the unglamorous but essential parts of geospatial ML: dataset loading, spatial sampling, coordinate reference system alignment, and batching. It also ships with pretrained classification and segmentation models for many standard tasks. The API wraps TorchGeo so you can call these pretrained models without installing the library.

For custom fine-tuning, TorchGeo provides the backbones and the API provides hosted training runs. You upload labels, pick a backbone (Clay, Prithvi-EO, or a ResNet), and the service returns a fine-tuned model you can call like any other endpoint.

A land use classification call

Here is a typical workflow. You pass an area of interest as GeoJSON, specify the task (land use classification), pick the model, and optionally supply a date range for temporal composites.

landuse-classify.py
import httpx

API_KEY = "sk-sci-..."
BASE = "https://scirouter.ai/v1"

# Area of interest: a bounding box around Iowa farmland
aoi = {
    "type": "Polygon",
    "coordinates": [
        [
            [-93.8, 41.5],
            [-93.2, 41.5],
            [-93.2, 42.0],
            [-93.8, 42.0],
            [-93.8, 41.5],
        ]
    ],
}

response = httpx.post(
    f"{BASE}/geospatial/classify-landuse",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "model": "clay-v1",
        "sensor": "sentinel-2",
        "aoi": aoi,
        "start_date": "2025-06-01",
        "end_date": "2025-08-31",
        "taxonomy": "esa-worldcover",
        "output_format": "geojson",
    },
    timeout=600,
)

result = response.json()
print(f"Classified {result['n_pixels']} pixels")
print(f"Dominant classes: {result['class_histogram']}")
# Download the output as a COG
import rasterio
with rasterio.open(result["raster_url"]) as src:
    landcover = src.read(1)

The call returns a classified raster plus vector polygons for each land cover class. Processing a 30 by 30 km area at 10 m resolution takes about 30 seconds end to end, including the Sentinel-2 download.

Change detection and time series

Many of the most valuable Earth observation applications are about change rather than a single snapshot: deforestation alerts, construction monitoring, reservoir filling, glacier retreat. The API exposes a change detection endpoint that takes two timestamps (or date ranges for composites) and returns a change mask and classification.

Under the hood, change detection uses Clay embeddings for each timestamp plus a lightweight head trained to distinguish real change from seasonal and illumination variation. This is strictly better than the classical difference-of-NDVI approach because it ignores phenology and cloud shadows that would otherwise generate false positives.

Deforestation and forest monitoring

Forest monitoring is one of the flagship use cases. Global Forest Watch, MAAP, and similar initiatives publish deforestation alerts derived from Landsat and Sentinel. The API wraps pretrained deforestation classifiers for Amazon, Congo Basin, and Southeast Asia biomes, each fine-tuned on thousands of labeled events.

For NGOs, government agencies, and commodity supply chain auditors, this means getting near-real-time deforestation alerts without training a model. You call the API with an area and a recent date, and you get back polygons flagging suspected clearing.

Tip
Always overlay deforestation alerts with a cloud mask and check multiple dates before issuing any formal notice. Even the best models generate false positives from undetected clouds, smoke, and shadows. The API returns a per-pixel confidence score that helps filter these out.

Building segmentation and urban mapping

For urban applications (damage assessment after disasters, growth monitoring, population estimation), building segmentation is the core primitive. The API exposes a SpaceNet-trained segmentation model that returns building footprints as vector polygons. Accuracy depends on resolution; 10 m Sentinel-2 gives rough extents while higher-resolution commercial imagery yields individual rooftops.

Disaster response use cases

Earth observation is a go-to tool for disaster response. The API supports several pretrained pipelines:

  • Flood extent. Sentinel-1 SAR segmentation that works through cloud cover, critical for flood monitoring.
  • Wildfire burn scar. Post-fire burn severity mapping using NBR indices plus a learned classifier.
  • Earthquake damage. Before-after change detection for building collapse in urban areas.
  • Oil spill. SAR-based slick detection on the ocean surface.

Each endpoint is tuned for operational latency: you can get a first pass over an area of interest within minutes of new imagery becoming available.

Getting started

The easiest way to explore is through Geospatial Lab, which lets you draw an area of interest on a map, pick a task, and see results overlaid on the imagery. The lab reveals the exact API call so you can drop it into a notebook or a production pipeline once you are satisfied with the output.

For researchers, the combination of free Sentinel and Landsat data, open foundation models, and a hosted API removes most of the friction that used to slow Earth observation projects. What used to be a six-month data engineering effort is now a week.

Open Geospatial Lab →

Frequently Asked Questions

What is Clay Foundation and why does it matter?

Clay is an open-source foundation model for Earth observation trained on a large multi-sensor corpus spanning Sentinel-2, Sentinel-1 SAR, Landsat, and MODIS. Its purpose is to learn a shared embedding space for satellite imagery so downstream tasks (land cover, change detection, deforestation, burned area) need only hundreds of labeled examples instead of tens of thousands. It is distributed under an open license and is rapidly becoming the de facto backbone for new geospatial applications.

How is Prithvi-EO different from Clay?

Prithvi-EO is the NASA and IBM foundation model focused specifically on Landsat and HLS (Harmonized Landsat Sentinel) data. It is a 6-band masked autoencoder trained on roughly 1 TB of global imagery. Clay takes a broader multi-sensor approach, while Prithvi-EO has deeper specialization for Landsat-class sensors. In practice, teams often evaluate both on their particular task and pick whichever gives better accuracy.

What does TorchGeo provide?

TorchGeo is an open-source PyTorch library from Microsoft that standardizes geospatial datasets, samplers, and pretrained models. It handles the tedious plumbing of aligning imagery with labels, sampling patches, and batching for training. The SciRouter API wraps TorchGeo so you can call pretrained segmentation and classification models without setting up the library locally.

Can I run change detection or deforestation alerts through the API?

Yes. The geospatial API exposes dedicated change detection endpoints that take two timestamps for the same area and return a change mask. Under the hood it uses Clay or Prithvi embeddings plus a lightweight Siamese head. For deforestation specifically, there are pretrained classifiers for Amazon and Southeast Asia biomes that work well out of the box.

How does data licensing work with Sentinel and Landsat?

Both Sentinel (Copernicus) and Landsat (NASA and USGS) are open data, free for any use including commercial. The API fetches imagery directly from the Copernicus Data Space Ecosystem and USGS Earth Explorer with your area of interest. You do not need to manage your own satellite data download pipeline.

What resolution and revisit time can I expect?

Sentinel-2 provides 10 m resolution for visible and near-infrared bands with a 5-day revisit cycle at the equator (faster at higher latitudes). Landsat provides 30 m resolution with a 16-day revisit. For higher resolution (sub-meter) you need commercial providers like Planet, Maxar, or Airbus, which are available as paid add-ons through the API if your account is provisioned for them.

Run this yourself — no GPU, no install

Free for researchers. Pick a tool, paste your input, see results in seconds.