API 參考
NanoPhoto.AI API 文件 - 將 AI 影片和圖片生成整合到你的應用中。
概述
NanoPhoto.AI 提供 REST API,用於將 AI 生成能力整合到你的應用中。
基礎 URL:https://nanophoto.ai
認證
所有 API 請求需要透過 API Key 進行認證,以 Bearer token 形式放在 Authorization 請求標頭中。
Authorization: Bearer YOUR_API_KEY取得 API Key
- 登入 nanophoto.ai
- 進入 設定 > API Keys
- 建立新的 API Key
重要
請妥善保管你的 API Key。不要公開分享或提交到版本控制系統。
速率限制
- 預設速率限制:每個 API Key 每小時 100 次請求
- 如需更高限制,請聯繫 support@nanophoto.ai
超出速率限制時,API 回傳 429 狀態碼:
{
"success": false,
"error": "API key rate limit exceeded. Default: 100 requests/hour. Contact support@nanophoto.ai for higher limits.",
"errorCode": "API_KEY_RATE_LIMIT_EXCEEDED"
}通用錯誤碼
| errorCode | HTTP 狀態碼 | 描述 |
|---|---|---|
LOGIN_REQUIRED | 401 | 需要認證 |
API_KEY_RATE_LIMIT_EXCEEDED | 429 | 超出速率限制 |
INVALID_INPUT | 400 | 缺少必要參數 |
INTERNAL_ERROR | 500 | 內部伺服器錯誤 |
NanoPhoto.AI文檔