Cloudinary
Cloudinary 兼容接口
SDK 配置与支持范围。
用官方 Cloudinary SDK 管理一个素材库。只需以下三项配置;API Key 作为 Bearer 凭据发送。
https://api.deepraxis.ai/cloudinary/v1_1/{library_id}
| 配置 | 值 |
|---|---|
| cloud_name | library_id |
| oauth_token | API Key |
| upload_prefix | https://api.deepraxis.ai/cloudinary |
Node.js
npm install cloudinary@2import { v2 as cloudinary } from "cloudinary";
cloudinary.config({
cloud_name: process.env.LIBRARY_ID,
oauth_token: process.env.PRAXIS_API_KEY,
upload_prefix: "https://api.deepraxis.ai/cloudinary",
});Python
python -m pip install cloudinaryimport os
import cloudinary
import cloudinary.uploader
import cloudinary.api
cloudinary.config(
cloud_name=os.environ["LIBRARY_ID"],
oauth_token=os.environ["PRAXIS_API_KEY"],
upload_prefix="https://api.deepraxis.ai/cloudinary",
)支持矩阵
| 操作 | 支持 |
|---|---|
| GET /v1_1/{library_id}/resources/visual_search | 支持 |
| POST /v1_1/{library_id}/resources/visual_search | 支持 |
| POST /v1_1/{library_id}/{resource_type}/upload | 支持 |
| POST /v1_1/{library_id}/{resource_type}/destroy | 支持 |
| POST /v1_1/{library_id}/{resource_type}/rename | 支持 |
| POST /v1_1/{library_id}/{resource_type}/tags | 支持 |
| POST /v1_1/{library_id}/{resource_type}/context | 支持 |
| POST /v1_1/{library_id}/{resource_type}/explicit | 支持 |
| GET /v1_1/{library_id}/resources/search | 支持 |
| POST /v1_1/{library_id}/resources/search | 支持 |
| GET /v1_1/{library_id}/resources | 支持 |
| GET /v1_1/{library_id}/resources/{resource_type} | 支持 |
| GET /v1_1/{library_id}/resources/{resource_type}/upload | 支持 |
| GET /v1_1/{library_id}/resources/{asset_id} | 支持 |
| GET /v1_1/{library_id}/resources/by_asset_ids | 支持 |
| GET /v1_1/{library_id}/resources/by_asset_folder | 支持 |
| GET /v1_1/{library_id}/resources/{resource_type}/tags/{tag} | 支持 |
| GET /v1_1/{library_id}/resources/{resource_type}/context | 支持 |
| GET /v1_1/{library_id}/resources/{resource_type}/upload/{public_id} | 支持 |
| POST /v1_1/{library_id}/resources/by_asset_ids | 支持 |
| POST /v1_1/{library_id}/resources/{resource_type}/upload/{public_id} | 支持 |
| PUT /v1_1/{library_id}/resources/{resource_type}/upload/{public_id} | 支持 |
| DELETE /v1_1/{library_id}/resources/{resource_type}/upload | 支持 |
| DELETE /v1_1/{library_id}/resources/{resource_type}/tags/{tag} | 支持 |
| GET /v1_1/{library_id}/tags/{resource_type} | 支持 |
| GET /v1_1/{library_id}/folders | 支持 |
| GET /v1_1/{library_id}/folders/{folder} | 支持 |
| POST /v1_1/{library_id}/folders/{folder} | 支持 |
| PUT /v1_1/{library_id}/folders/{folder} | 支持 |
| DELETE /v1_1/{library_id}/folders/{folder} | 支持 |
| GET /v1_1/{library_id}/ping | 支持 |
| GET /v1_1/{library_id}/usage | 部分支持 |
| GET /v1_1/{library_id}/usage/{date} | 部分支持 |
usage 只返回当前存储字节数与素材数,日期不选择历史统计。
不支持的操作
| 端点 | HTTP |
|---|---|
| upload_presets | 400 |
| metadata_fields | 400 |
| transformations | 400 |
| streaming_profiles | 400 |
| upload_mappings | 400 |
| triggers | 400 |
| derived_resources | 400 |
| relations | 400 |
| restore | 400 |
| backups | 400 |
| text | 400 |
| sprite | 400 |
| multi | 400 |
| explode | 400 |
| generate_archive | 400 |
| create_slideshow | 400 |
| download_backup_asset | 400 |
| folders/search | 400 |
上述端点错误消息含 is not supported;private 与 authenticated 交付类型也返回 400。
上传参数
| 参数 | 支持 |
|---|---|
| file | 支持 |
| public_id | 支持 |
| public_id_prefix | 支持 |
| display_name | 支持 |
| asset_folder | 支持 |
| use_filename | 支持 |
| unique_filename | 支持 |
| use_filename_as_display_name | 支持 |
| filename_override | 支持 |
| overwrite | 支持 |
| tags | 支持 |
| context | 支持 |
| auto_tagging | 部分支持 |
| resource_type | 支持 |
| eager | 不支持 |
| eager_async | 不支持 |
| eager_notification_url | 不支持 |
| async | 不支持 |
| notification_url | 不支持 |
| upload_preset | 不支持 |
| moderation | 不支持 |
| detection | 不支持 |
| ocr | 不支持 |
| raw_convert | 不支持 |
| background_removal | 不支持 |
| categorization | 不支持 |
| transformation | 不支持 |
| responsive_breakpoints | 不支持 |
| proxy | 不支持 |
| backup | 不支持 |
| return_delete_token | 不支持 |
| access_control | 不支持 |
| access_mode | 不支持 |
| metadata | 不支持 |
| face_coordinates | 不支持 |
| custom_coordinates | 不支持 |
| regions | 不支持 |
| quality_analysis | 不支持 |
| accessibility_analysis | 不支持 |
| cinemagraph_analysis | 不支持 |
| media_metadata | 不支持 |
| phash | 不支持 |
| colors | 不支持 |
| faces | 不支持 |
| image_metadata | 不支持 |
| exif | 不支持 |
| invalidate | 不支持 |
| type | 不支持 |
不支持的上传参数返回 400,消息为 Unsupported upload parameter: 参数名。