Guide to connecting BytePlus ModelArk models via standard OpenAI API format.
APIDY AI Gateway is 100% compatible with official OpenAI SDKs (`openai` Python package, `openai` npm module). Simply install the standard OpenAI library and update your Base URL.
from openai import OpenAI
# Instant BytePlus GLM-5.2 integration via APIDY AI Gateway
client = OpenAI(
base_url="https://apidy.org/api/v1",
api_key="sk-bp-your-api-key" # API Key from APIDY Console
)
response = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Hello! Write a 15s TikTok Ads script for a new product."}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")All HTTP requests to APIDY Gateway must include the Authorization header:
You can create and manage your API Keys inside the Console Dashboard.
Select your preferred AI coding tool or chatbot interface below to view setup instructions and screenshots.
Apidy provides drop-in compatibility. Simply change your Base URL and API Key to start coding with any AI agent.
https://apidy.org/api/v1Use Dola-Seed-2.1-Turbo or GLM-5.2 for code generation, refactoring, and debugging in Cursor.
Open Cursor Settings
Nhấn phím Ctrl + Shift + J (Windows) hoặc Cmd + Shift + J (Mac) và chọn tab Models.
Enable OpenAI API Key & Override URL
Bật công tắc OpenAI API Key, bấm Override OpenAI Base URL và dán:
Enter Apidy API Key
Dán khóa API Key của bạn (định dạng sk-bp-...) lấy từ mục Console Keys.
Add Model Names
Trong mục Model Names, bấm + Add Model và thêm các mã sau:
/v1/chat/completionsText completions & LLM reasoning using `dola-seed-2.1-turbo`, `dola-seed-2.0-mini`, `dola-seed-2.0-lite`, `glm-5.2`. Supports `stream: true` for Server-Sent Events.
/v1/images/generationsSeedreamHigh-definition AI image generation from text prompt or reference images (Image-to-Image / Style Transfer) using `seedream-5.0-lite` or `seedream-4.5`. Supports URLs or Base64.
/v1/videos/generationsSeedanceShort AI video generation with automated audio matching for TikTok (Model: `seedance-2.0-mini`, `seedance-1.5-pro`). Supports Text-to-Video, Image-to-Video (First & Last Frame), and Video-to-Video (Motion Transfer).
/api/v1/videos/enhancementsByteDance AIUpscale and enhance video quality with AI Super-Resolution (de-noising, facial restoration, studio detail reconstruction) to 720p HD or 1080p Full HD. Use your standard APIDY API Key directly via server scripts, curl, or through the Apidy MCP Server.
~$0.020 per 60 seconds of video.
~$0.050 per 60 seconds of video.
# 1. Gửi video qua JSON link:
curl -X POST https://apidy.org/api/v1/videos/enhancements \
-H "Authorization: Bearer sk-bp-your-api-key" \
-H "Content-Type: application/json" \
-d '{"video_url": "https://media.apidy.org/sample.mp4", "resolution": "1080p"}'
# 2. Hoặc upload trực tiếp file video:
curl -X POST https://apidy.org/api/v1/videos/enhancements \
-H "Authorization: Bearer sk-bp-your-api-key" \
-F "file=@/path/to/video.mp4" \
-F "resolution=1080p"
# 3. Kiểm tra tiến độ & nhận link kết quả:
curl https://apidy.org/api/v1/videos/enhancements/{task_id} \
-H "Authorization: Bearer sk-bp-your-api-key"/api/studio/uploadStorage R2Upload local image or video files to Cloudflare R2 storage to obtain permanent public URLs for image and video generation APIs.
APIDY AI Gateway fully supports advanced multimodal generation techniques: Image-to-Image, Image-to-Video (First Frame & Last Frame), Video-to-Video (Motion Reference), and direct Cloudflare R2 file upload API.
Recommended. Pass direct public image/video URLs from any CDN, S3, R2, or storage bucket.
Embed `data:image/png;base64,...` string directly in payload. The gateway mirrors it to R2 automatically.
Use `POST /api/studio/upload` to upload local files and receive a permanent public URL.
Provide a static initial image (First Frame). The AI preserves the character/product identity and animates smooth motion with context-matched ambient audio.
| Field | Type | Required? | Description |
|---|---|---|---|
| first_frame_image | string | Recommended | Starting image URL or Base64 data URI. Aliases: `image_url`, `reference_image_url`. |
| last_frame_image | string | Optional | Ending image URL. Creates a morphing transition from first frame to last frame. |
| prompt | string | Required | Describes movement, camera motion, and desired atmospheric audio. |
| duration | number | Optional | Video duration: 4 to 16 seconds (default: 5s). |
| generate_audio | boolean | Optional | Defaults to `true`. AI automatically synthesizes sound effects & ambient music. |
curl https://apidy.org/api/v1/videos/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-bp-your-api-key" \
-d '{
"model": "seedance-1.5-pro",
"prompt": "Sản phẩm xoay 360 độ từ từ, hiệu ứng ánh sáng neon chuyển động huyền ảo",
"first_frame_image": "https://media.apidy.org/faces/sample-first-frame.jpg",
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"generate_audio": true
}'| Public Model ID | Provider | Category | APIDY Retail Price |
|---|---|---|---|
| dola-seed-2.1-turboPopular | ByteDance | LLM Text | $0.6500 / per 1M tokens |
| dola-seed-2.0-miniFast & Cheap | ByteDance | LLM Text | $0.1966 / per 5s video 720p |
| dola-seed-2.0-liteCost-Effective | ByteDance | LLM Text | $0.3250 / per 1M tokens |
| glm-5.2Verified Live | Z.AI | LLM Text | $1.8200 / per 1M tokens |
| seedream-5.0-liteNew | ByteDance | AI Image | $0.0455 / per image |
| seedream-4.5HD Quality | ByteDance | AI Image | $0.0520 / per image |
| seedream-5.0-pro2K Cinematic | ByteDance | AI Image | $0.0780 / per 2K image |
| seed-2.0-codeBest for Code | ByteDance | LLM Text | $0.6500 / per 1M tokens |
| deepseek-v3.2128K Context | DeepSeek | LLM Text | $0.1820 / per 1M tokens |
| deepseek-v4-flashFlash Reasoning | DeepSeek | LLM Text | $0.0910 / per 1M tokens |
| seedance-1.5-proDeprecated | ByteDance | AI Video | $0.3370 / per 5s video 720p |
| seedance-2.0-fastUltra Fast 2.0 | ByteDance | AI Video | $0.5946 / per 5s video 720p |
| seedance-2.0-miniNext-Gen 2.0 | ByteDance | AI Video | $0.1966 / per 5s video 720p |
| seedance-2.5Flagship 2.5 | ByteDance | AI Video | $1.5023 / per 5s video 720p |
| video-enhancer720p / 1080p | ByteDance | AI Video | $0.000333 (720p) - $0.000833 (1080p) / sec |