API 키

오용을 방지하려면 API 키를 안전하게 보관하세요

API 키 사용 방법 자세히 보기 자세히 숨기기

키는 서버에 보관하고 Bearer 토큰으로 전송하세요. 아래는 복사해서 바로 실행할 수 있는 빠른 시작입니다.

  1. 키를 만들고 서버의 시크릿 저장소에 보관하세요. 아래 목록에서 언제든지 다시 복사할 수 있습니다.
  2. 키를 Bearer 토큰으로, 이미지를 multipart 필드에 담아 /api/plant/identify 로 POST 요청을 보내세요.
  3. JSON 응답을 확인하세요. 식물 정보가 최상위에 있고 credit_transaction 과 new_balance 도 함께 반환됩니다.

요청

필드 필수 타입 설명
image 필수 file JPEG, PNG, WebP 또는 GIF, 최대 10 MB.
lang 선택 string 출력 언어: en, zh, es, ja, fr, de, pt, ko, it. 기본값은 en이며 알 수 없는 값은 en으로 처리됩니다. 최대 12자.
context 선택 string 정확도를 높이는 대상 힌트: plant, succulent, leaf, houseplant, poison_ivy. 기본값은 plant. 최대 32자.

요청 예시

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=ko" \
  -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": "ko", "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", "ko");
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());

응답 예시

HTTP 200. 모델이 확신하지 못하면 일부 필드가 없을 수 있으니 모두 선택 항목으로 처리하세요. care_level 은 로컬화된 표시용 라벨이며 고정 enum이 아닙니다.

{
  "success": true,
  "common_name": "몬스테라",
  "scientific_name": "Monstera deliciosa",
  "family": "Araceae",
  "care_level": "쉬움",
  "light": "밝은 간접광",
  "watering": "흙 표면이 마르면 물 주기",
  "pet_safety": "섭취 시 반려동물에게 유독",
  "description": "크게 갈라진 잎을 가진 열대 덩굴 식물입니다.",
  "identification_notes": "갈라진 잎 가장자리와 공중 뿌리가 보입니다.",
  "lookalikes": "몬스테라 아단소니(Monstera adansonii)",
  "next_step": "고른 생장을 위해 일주일에 한 번 화분을 돌려 주세요.",
  "confidence": 0.92,
  "credit_transaction": "PI2026110600001",
  "new_balance": 18
}

오류 응답

400 missing_image 요청에 image 필드가 없습니다.
400 invalid_file_type 이미지가 JPEG, PNG, WebP, GIF 형식이 아닙니다.
400 file_too_large 이미지가 10 MB를 초과합니다.
401 authentication_required API 키가 없거나 유효하지 않거나 비활성 또는 삭제된 상태입니다.
402 insufficient_credits 크레딧이 부족합니다. 차감되지 않습니다.
500 identification_failed 공급자 오류입니다. 차감된 크레딧은 자동으로 환불됩니다.

과금 및 보안

식별에 성공할 때마다 2 크레딧이 차감됩니다. 실패한 요청은 자동으로 환불됩니다.
API 키를 브라우저 JavaScript나 모바일 앱 번들에 넣지 마세요. 노출될 가능성이 있으면 즉시 비활성화하거나 삭제하세요.
불러오는 중…