API Keys
Keep your API key secure to prevent misuse
How to use your API key Show details Hide details
Keep your key on your server and send it as a Bearer token. Everything below is a copy-paste quick start.
- Create a key and store it in your server secret store. You can copy it again from the list below at any time.
- Send a POST request to /api/plant/identify with your key as a Bearer token and the image in a multipart field.
- Read the JSON response: plant details at the top level, plus credit_transaction and new_balance.
Request
| Field | Required | Type | Description |
|---|---|---|---|
image |
Required | file |
JPEG, PNG, WebP or GIF, up to 10 MB. |
lang |
Optional | string |
Output language: en, zh, es, ja, fr, de, pt, ko, it. Defaults to en; unknown values fall back to en. Max 12 characters. |
context |
Optional | string |
Subject hint for better accuracy: plant, succulent, leaf, houseplant, poison_ivy. Defaults to plant. Max 32 characters. |
Example request
curl -X POST https://api.plantidentify.org/api/plant/identify \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/plant.jpg;type=image/jpeg" \
-F "lang=en" \
-F "context=houseplant"
import requests
with open("plant.jpg", "rb") as f:
r = requests.post(
"https://api.plantidentify.org/api/plant/identify",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"image": ("plant.jpg", f, "image/jpeg")},
data={"lang": "en", "context": "houseplant"},
timeout=90,
)
print(r.status_code, r.json())
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("image", new Blob([await readFile("plant.jpg")], { type: "image/jpeg" }), "plant.jpg");
form.append("lang", "en");
form.append("context", "houseplant");
const res = await fetch("https://api.plantidentify.org/api/plant/identify", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY" },
body: form,
});
console.log(res.status, await res.json());
Example response
HTTP 200. Fields may be missing when the model is unsure — treat every field as optional. care_level is a localized display label, not a fixed enum.
{
"success": true,
"common_name": "Monstera",
"scientific_name": "Monstera deliciosa",
"family": "Araceae",
"care_level": "Easy",
"light": "Bright indirect light",
"watering": "Water when the top soil is dry",
"pet_safety": "Toxic to pets if eaten",
"description": "A tropical climber with large split leaves.",
"identification_notes": "Split leaf edges and aerial roots.",
"lookalikes": "Monstera adansonii",
"next_step": "Rotate the pot weekly for even growth.",
"confidence": 0.92,
"credit_transaction": "PI2026110600001",
"new_balance": 18
}
Error responses
400 missing_image |
No image field in the request. |
400 invalid_file_type |
Image is not JPEG, PNG, WebP or GIF. |
400 file_too_large |
Image exceeds 10 MB. |
401 authentication_required |
Missing, invalid, inactive or deleted API key. |
402 insufficient_credits |
Not enough credits. Nothing is charged. |
500 identification_failed |
Provider error. Charged credits are refunded automatically. |
Billing and safety
Each successful identification costs 2 credits. Failed requests are refunded automatically.
Never ship an API key in browser JavaScript or a mobile app bundle. Deactivate or delete a key as soon as it may be exposed.
Loading...