Image Diagnosis APIs

Computer Vision for Crop Image Diagnosis

Authenticated HTTP APIs for crop image diagnosis across cassava, maize, rice, and tomato. Use the user upload gateway for multipart image submission, or the server workflow for staged-image diagnosis, then combine ranked predictions with visual evidence and supporting knowledge.

4 Crops · User Upload Gateway · Server Raw-Key Flow · AI focus areas + Knowledge Support

curl · /api/v1/diagnose
# User-facing upload gateway
curl -X POST \
  "https://api.fildra.ai/api/v1/diagnose?plant=maize&top_k=3" \
  -H "X-Api-Key: YOUR_USER_KEY" \
  -F "image=@maize_leaf.jpg"

# Example response shape
{
  "success": true,
  "predictions": [
    {
      "disease": "grey_leaf_spot",
      "confidence": 0.94
    }
  ],
  "plant": "maize",
  "gateway": {
    "job_id": "...",
    "uploaded_s3_key": "uploads/diagnose/..."
  }
}

Solution Overview

Research-Based Vision APIs

This page introduces the image diagnosis APIs at a high level. The detailed developer documentation can then describe endpoint behavior, authentication, request flow, and response fields in depth.

Vision Diagnosis CV

Image Diagnosis with AI focus areas and Supporting Knowledge

We provide authenticated HTTP endpoints for image diagnosis. User-facing requests upload files through a multipart gateway, while server-side workflows can send an internal storage key. Across the diagnosis stack, predictions can be paired with AI focus area evidence and supporting diagnosis knowledge to improve interpretation.

4 Crops User + Server Flows Multipart Upload Raw-Key Inference Localized Responses
Current Crop Coverage
Maize (7 conditions)
  • Common Rust
  • Fall Armyworm
  • Grey Leaf Spot
  • Leaf Blight
  • Lethal Necrosis
  • Streak Virus
  • Healthy
Tomato (10 conditions)
  • Bacterial Spot
  • Early Blight
  • Late Blight
  • Leaf Mold
  • Septoria Leaf Spot
  • Spider Mites
  • Target Spot
  • Mosaic Virus
  • Yellow Curl Virus
  • Healthy
Rice (10 conditions)
  • Bacterial Leaf Blight
  • Brown Spot
  • Leaf Blast
  • Leaf Scald
  • Narrow Brown Spot
  • Neck Blast
  • Rice Hispa
  • Sheath Blight
  • Tungro
  • Healthy
Cassava (5 conditions)
  • Bacterial Blight
  • Brown Streak
  • Green Mite
  • Mosaic Disease
  • Healthy

Quickstart

Standard HTTP Integration

No SDK is required. Use authenticated HTTP requests from your client, backend, or mobile application depending on your integration path.

User Upload Gateway

Recommended for end users. Send a multipart image to the diagnosis gateway and let the server handle storage and diagnosis.

# User-facing upload flow
curl -X POST \
  "https://api.fildra.ai/api/v1/diagnose?plant=maize&top_k=3" \
  -H "X-Api-Key: YOUR_USER_KEY" \
  -F "image=@leaf_sample.jpg"
Python HTTP Client

Use the Python requests library for multipart upload. This is standard HTTP integration, not a product SDK.

import requests

url = "https://api.fildra.ai/api/v1/diagnose"
params = {"plant": "rice", "top_k": 3}
headers = {"X-Api-Key": "YOUR_USER_KEY"}

with open("leaf.jpg", "rb") as f:
    response = requests.post(
        url,
        params=params,
        headers=headers,
        files={"image": f},
    )

result = response.json()
JavaScript FormData

Browser or Node.js applications can use FormData and fetch to call the upload gateway directly.

const formData = new FormData();
formData.append("image", fileInput.files[0]);

const response = await fetch(
  "https://api.fildra.ai/api/v1/diagnose?plant=tomato",
  {
    method: "POST",
    headers: { "X-Api-Key": "YOUR_USER_KEY" },
    body: formData
  }
);

const result = await response.json();
Server Raw-Key Flow

For internal or server-side workflows, send a staged storage key to the diagnosis endpoint instead of uploading the file again.

curl -X POST \
  "https://api.fildra.ai/api/v1/image_diagnosis/infer/basic" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_SERVER_KEY" \
  -d '{
    "plant": "rice",
    "job_id": "server-job-001",
    "locale": "en-us",
    "raw_key": "uploads/diagnose/example/rice/example.jpg",
    "top_k": 3,
    "country": "zambia"
  }'
Knowledge-Enriched Flow

Use the knowledge-backed endpoint when you want diagnosis output plus filtered profile content for follow-up guidance, evidence, or look-alike comparison.

curl -X POST \
  "https://api.fildra.ai/api/v1/image_diagnosis/infer/with_knowledge" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_SERVER_KEY" \
  -d '{
    "plant": "tomato",
    "raw_key": "uploads/diagnose/example/tomato/example.jpg",
    "locale": "en-us",
    "top_k": 2,
    "sections": ["visual_profile", "lookalikes", "decision_support"],
    "lookalikes": true
  }'

Endpoint Notes

Primary User Upload Endpoint

The gateway below is the main user-facing entry point. Internal and server-side diagnosis endpoints are documented separately in the deeper developer documentation.

POST /api/v1/diagnose

User Upload Gateway

Accepts a multipart image upload, stages the image through server-controlled storage, and runs image diagnosis. This is the recommended endpoint for user-facing applications that should not handle internal storage keys directly.

Query Parameters

  • plant REQUIRED

    Plant type. Current support includes cassava, maize, rice, and tomato.

  • top_k

    Number of ranked predictions to return. Valid range: 1 to 10. Default: 3.

  • locale

    Response locale. The request can also use Accept-Language when appropriate.

Request Body (multipart/form-data)

image: Image file (JPG, JPEG, PNG, WEBP, HEIC)
       Maximum size: 10MB

Headers

X-Api-Key: YOUR_USER_KEY
# or
Authorization: Bearer YOUR_USER_KEY

Response Shape

{
  "success": true,
  "job_id": "2ae7df30-3e3b-4d7b-b89d-6626a3d08b02",
  "predictions": [
    {
      "label": "grey_leaf_spot",
      "class_index": 4,
      "confidence": 0.94,
      "gradcam_url": "https://signed-url.example/pred_1.png"
    }
  ],
  "plant": "maize",
  "gateway": {
    "request_id": "...",
    "job_id": "...",
    "uploaded_s3_key": "uploads/diagnose/...",
    "timestamp": "2026-03-07T..."
  }
}
POST /api/v1/image_diagnosis/infer/basic

Server Raw-Key Inference

JSON request for backend workflows that already staged the image object. The response includes the same prediction core, Grad-CAM URLs, result manifest URLs, and supported locale metadata.

JSON Body

{
  "plant": "rice",
  "raw_key": "uploads/diagnose/example/rice/example.jpg",
  "locale": "en-us",
  "job_id": "server-job-001",
  "top_k": 3,
  "country": "zambia"
}
POST /api/v1/image_diagnosis/infer/with_knowledge

Knowledge-Enriched Diagnosis

Extends raw-key inference with a knowledge object on each prediction. Use sections or alias flags such as lookalikes to keep responses lean and purpose-specific.

JSON Body

{
  "plant": "tomato",
  "raw_key": "uploads/diagnose/example/tomato/example.jpg",
  "locale": "en-us",
  "top_k": 2,
  "sections": ["visual_profile", "lookalikes", "decision_support"],
  "lookalikes": true
}

What Developers Get

Practical Building Blocks for Diagnosis Workflows

The current solution is designed around authenticated HTTP endpoints, staged-image processing, and diagnosis support flows rather than a packaged SDK.

Coverage

Focused Crop Support

Current image diagnosis support covers cassava, maize, rice, and tomato under the models you have already integrated.

Gateway

User Upload Path

End users upload files to the API gateway, and the server handles storage transfer on their behalf to reduce client-side storage coupling.

Server Flow

Raw-Key Inference Path

Internal and server-side workflows can call the diagnosis API directly with a staged object key instead of re-uploading the image payload.

Visual Evidence

AI Focus Area Support

Diagnosis workflows are designed to pair ranked predictions with visual evidence so model outputs are easier to inspect and explain.

Knowledge

Supporting Diagnosis Knowledge

Knowledge-backed diagnosis endpoints can complement model predictions with structured profile content for interpretation and follow-up guidance.

Integration

Standard HTTP, No SDK Claim

Integration is done through documented HTTP endpoints and API keys. We do not currently advertise a dedicated SDK on this page.

Building with Image Diagnosis?

Request developer access and we can guide you to the right integration path, whether you need user uploads through the gateway or server-side diagnosis workflows.