APIドキュメント
REST APIで画像をプログラム的に変換します。
概要
ベースURL: https://www.bulkpicconv.com/api/v1
認証:Bearerトークンを Authorization ヘッダーで送信
APIキー形式: sk_ プレフィックス + 48文字の英数字
レート制限:Team 50K/月、Enterprise 無制限
最大アップロードサイズ:1ファイルあたり15 MB
最大画像サイズ:8000万ピクセル(例:8000×10000)
対応入力形式:JPEG、PNG、WebP、GIF、BMP、TIFF、HEIC
APIアクセス:TeamおよびEnterpriseプラン( ダッシュボード からキーを生成)
エンドポイント
| メソッド | エンドポイント | 説明 |
|---|---|---|
| POST | /api/v1/convert | 画像の変換と圧縮 |
| POST | /api/v1/resize | 画像のリサイズ |
| POST | /api/v1/crop | 画像のクロップ |
| POST | /api/v1/watermark | 画像にウォーターマークを追加 |
| POST | /api/v1/optimize | フォーマット変換なしのスマート最適化 |
| POST | /api/v2/batch | ZIP画像の一括変換(非同期) |
| GET | /api/v2/batch/{id}/status | 一括ジョブステータスの照会 |
| GET | /api/v2/batch/{id}/result | 一括結果ZIPのダウンロード |
| GET | /api/v2/usage | APIキーの月間使用量の照会 |
| GET | /api/v2/credits | 利用可能なAPIクレジットの照会 |
| POST | /v1/ai/alt-text | AI代替テキスト生成(Pro/Team) |
| POST | /v1/ai/rename | AI一括リネーム(Pro/Team) |
| POST | /v1/ai/smart-crop | AIスマートクロップ検出(Pro/Team) |
| POST | /v1/ai/enhance | AI画像強化(Pro/Team) |
| POST | /v1/ai/recommend | AIフォーマット推奨(Pro/Team) |
| POST | /api/background-remove | 画像背景の除去 |
| GET/PUT/DEL | /api/user/ai-key | BYOKモデル設定管理 |
/v1/convert画像をWebP、AVIF、JPEG、PNGに変換・圧縮します。
パラメータ(multipart/form-data)
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| image | file | はい | 変換する画像ファイル |
| format | string | いいえ | webp、avif、jpeg、png(デフォルト:webp) |
| quality | number | いいえ | 1-100(デフォルト:75) |
| width | number | いいえ | 出力幅(アスペクト比を維持) |
| height | number | いいえ | 出力高さ |
| fit | string | いいえ | cover、contain、fill、inside、outside |
| grayscale | boolean | いいえ | グレースケールに変換 |
| blur | number | いいえ | ぼかし半径(0.3-100) |
| rotate | number | いいえ | 回転角度(0-360) |
レスポンス
ヘッダー付きバイナリ画像データ:
Content-Type: 画像形式のMIMEタイプContent-Disposition: ファイル名付き添付ファイル(例:converted.webp)X-Input-Size: 元のサイズ(バイト)X-Output-Size: 変換後サイズ(バイト)X-Saved-Percent: 節約率X-RateLimit-Limit: 月間APIコール上限X-RateLimit-Remaining: 今月の残りAPIコール数
/api/v1/resizeアスペクト比を維持して画像をリサイズします。
パラメータ(multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| image | file | はい | 画像ファイル |
| width | number | はい | ターゲット幅(1-10000) |
| height | number | はい | ターゲット高さ(1-10000) |
| fit | string | いいえ | cover/contain/fill/inside/outside(デフォルト:inside) |
/api/v1/crop画像から矩形領域を抽出します。
パラメータ(multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| image | file | はい | 画像ファイル |
| x | number | はい | 水平オフセット(左上) |
| y | number | はい | 垂直オフセット(左上) |
| width | number | はい | クロップ領域の幅 |
| height | number | はい | クロップ領域の高さ |
/api/v1/watermark設定可能な位置にウォーターマークを重ねます。
パラメータ(multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| image | file | はい | ベース画像 |
| watermark | file | はい | ウォーターマーク画像 |
| position | string | いいえ | top-left/top-right/bottom-left/bottom-right/center |
| opacity | number | いいえ | 0-100(デフォルト:100) |
| scale | number | いいえ | ベース幅に対するウォーターマークサイズ(0.01-1) |
/api/v1/optimizeフォーマットを変更せずにファイルサイズを削減するため再エンコードします。
パラメータ(multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| image | file | はい | 画像ファイル |
| quality | number | いいえ | 1-100(デフォルト:75)。元のフォーマットが保持されます。 |
/api/v2/batch非同期一括変換用にZIPアーカイブをアップロードします。ジョブIDを返します。完了までステータスをポーリングします。
パラメータ(multipart/form-data)
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| file | file | はい | 画像のZIPアーカイブ |
| format | string | いいえ | webp、avif、jpeg、png(デフォルト:webp) |
| quality | number | いいえ | 1-100(デフォルト:75) |
GET /api/v2/batch/{id}/status — ジョブステータスをポーリング(キュー待ち → 処理中 → 完了) GET /api/v2/batch/{id}/result — 結果ZIPをダウンロード
AI機能 Pro / Team
GPT-4o VisionによるAI画像分析。すべてのAIエンドポイントはBase64データURIを含むJSONボディを受け付けます。BYOK(Bring Your Own Key)に対応 — 独自のOpenAI互換モデルで無料の無制限アクセス。
/v1/ai/alt-textGenerate SEO-friendly alt text with keywords using GPT-4o Vision.
ボディ(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
| images | string[] | はい | Base64 data URIs (1-10 images) |
| language | string | いいえ | en/zh/es/fr/de/ja/ko/pt/it (default: en) |
| style | string | いいえ | descriptive/concise/seo (default: descriptive) |
| userProvider | object | いいえ | BYOK config (see below) |
/v1/ai/renameGenerate SEO-friendly filenames based on image content.
ボディ(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
| images | object[] | はい | {data, originalName} (1-20 images) |
| rules | object | いいえ | {prefix, includeSequence, style} |
| userProvider | object | いいえ | BYOK config |
/v1/ai/smart-cropDetect subject and generate platform-specific crop recommendations.
ボディ(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
| image | string | はい | Base64 data URI |
| platforms | string[] | いいえ | instagram-square/twitter/facebook/youtube-thumbnail/etc. |
| customRatio | object | いいえ | {width, height} |
| returnCroppedImage | boolean | いいえ | Return cropped result (default: false) |
| userProvider | object | いいえ | BYOK config |
/v1/ai/enhanceUpscale, denoise, or deblur images.
ボディ(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
| image | string | はい | Base64 data URI |
| mode | string | いいえ | upscale/denoise/deblur/auto (default: auto) |
| intensity | number | いいえ | 1=Light, 2=Medium, 3=Strong (default: 2) |
| returnPreview | boolean | いいえ | Return enhanced image (default: true) |
/v1/ai/recommendDeep analysis to recommend optimal format, quality, and compression.
ボディ(application/json)
| Field | Type | Required | Description |
|---|---|---|---|
| images | object[] | はい | {data, filename, width, height, fileSize, mimeType} (1-20) |
| useCase | string | いいえ | web/ecommerce/social-media/print/archive/general |
| userProvider | object | いいえ | BYOK config |
BYOK:userProviderオブジェクト(任意)
独自のモデルを使用する際に任意のAIリクエストに含めます。Proチェックと日次クォータをスキップします。
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| baseUrl | string | はい | OpenAI互換APIベースURL |
| model | string | はい | Visionモデル名 |
| apiKey | string | † | APIキー(ローカルモード、リクエストと一緒に送信) |
| useAccountKey | boolean | † | アカウント保存の暗号化キーを使用 |
† apiKeyまたはuseAccountKeyのいずれかが必要です。
背景除去
/api/background-remove画像の背景を除去します。remove.bg APIとsharpフォールバックを使用。月間クォータ適用(管理者設定)。
パラメータ(multipart/form-data)
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
| image | file | はい | 画像ファイル(最大10 MB) |
| format | string | いいえ | 出力形式:png(デフォルト)、webp |
アカウント管理
/api/user/ai-key保存されたBYOKモデル設定を管理(AES-256-GCMで暗号化)。
GET— 保存された設定を取得(キーはマスク表示、例:sk-12****abcd)PUT— 設定を保存/更新(ボディ:baseUrl、model、apiKey)。マスクされたキーを返します。DELETE— 保存された設定を削除(復元不可)
エラーレスポンス
すべてのエラーはJSONで返されます { "statusCode": 4xx, "statusMessage": "..." }
| コード | エラー | 説明 |
|---|---|---|
| 400 | missing_form_data | リクエストボディはmultipart/form-dataである必要があります |
| 400 | missing_image_file | フォームデータに画像ファイルが見つかりません(フィールド名:"image") |
| 400 | file_too_large | ファイルが15 MBのアップロード制限を超えています |
| 400 | invalid_image_type | ファイルが有効な画像ではありません |
| 400 | invalid_image | 画像が破損または読み取り不能です |
| 400 | image_too_large | 画像が8000万ピクセルを超えています |
| 400 | invalid_params | 無効なパラメータ値(issuesフィールドを参照) |
| 401 | missing_or_invalid_api_key | Authorizationヘッダーが不足または不正な形式 |
| 401 | invalid_or_revoked_api_key | APIキーが見つからないか取り消されています |
| 401 | api_access_not_available | プランにAPIアクセスが含まれていません(Team/Enterpriseのみ) |
| 429 | rate_limited | リクエストが多すぎます(バースト制限:30/分) |
| 429 | monthly_limit_exceeded | 月間APIクォータを使い果たしました |
| 500 | conversion_failed | サーバー側の画像処理エラー |
| AI機能エラー | ||
| 403 | ai_access_denied | Pro/Teamプランが必要(またはBYOKモード:ログインが必要) |
| 429 | ai_daily_limit_exceeded | 日次AIクォータを使い果たしました(プラットフォームモードのみ。BYOKは無制限) |
| 503 | ai_service_unavailable | AIサービスがサーバーで設定されていません |
| 403 | no_saved_ai_key | BYOK:useAccountKey=trueですがアカウントにキーが保存されていません |
| 503 | ai_key_encryption_disabled | サーバーAI_KEY_ENCRYPTION_SECRETが設定されていません |
コード例
curl -X POST https://www.bulkpicconv.com/api/v1/convert \
-H "Authorization: Bearer sk_your_api_key" \
-F "image=@photo.jpg" \
-F "format=webp" \
-F "quality=80" \
-F "width=1920" \
-o converted.webpAI代替テキスト(JSONボディ)
curl -X POST https://www.bulkpicconv.com/v1/ai/alt-text \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"images":["data:image/jpeg;base64,/9j/4AAQ..."],"language":"en","style":"seo"}'BYOK:独自のモデルを使用
curl -X POST https://www.bulkpicconv.com/v1/ai/alt-text \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"images": ["data:image/jpeg;base64,..."],
"userProvider": {
"baseUrl": "https://api.siliconflow.cn/v1",
"model": "Qwen/Qwen3-VL-32B-Instruct",
"apiKey": "sk-your-provider-key"
}
}'試してみる
API変更履歴
- addedPOST /v1/ai/alt-text: AI alt text generation with GPT-4o Vision (Pro/Team or BYOK)
- addedPOST /v1/ai/rename: AI batch rename based on image content
- addedPOST /v1/ai/smart-crop: AI smart crop detection with platform presets
- addedPOST /v1/ai/enhance: AI image enhancement (upscale, denoise, deblur)
- addedPOST /v1/ai/recommend: AI format and quality recommendation
- addedBYOK (Bring Your Own Key): use your own OpenAI-compatible model via userProvider object
- addedGET/PUT/DELETE /api/user/ai-key: manage saved BYOK config (AES-256-GCM encrypted)
- addedPOST /api/background-remove: remove image background
- addedBatch webhook callback: pass `webhook_url` in batch creation to receive POST notifications on completion or failure
- addedAutomatic cleanup of stale batch jobs (30-minute timeout) and result files (24-hour retention)
- addedGET /api/v2/usage: query API key monthly usage and recent calls
- addedGET /api/v2/credits: query available API credits and package details
- addedPOST /api/v2/batch: upload ZIP, async batch conversion
- addedGET /api/v2/batch/{id}/status: query batch job status
- addedGET /api/v2/batch/{id}/result: download result ZIP
- addedPOST /api/v1/resize: resize images via API
- addedPOST /api/v1/crop: crop images via API
- addedPOST /api/v1/watermark: add watermark to images via API
- addedPOST /api/v1/optimize: smart optimization without format conversion
- addedPOST /api/v1/convert: convert images to WebP/AVIF/JPEG/PNG
- addedAPI key authentication with sk_ prefix
- addedRate limiting: 60 requests/min per IP, monthly limits per plan
- addedAPI credits for non-subscription users