API Integration Guide

Ecomdy API Documentation

Guide to connecting BytePlus ModelArk models via standard OpenAI API format.

1. Quickstart Guide

Ecomdy API 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.

Standard OpenAI SDK Integration
from openai import OpenAI

# Instant BytePlus GLM-5.2 integration via Ecomdy API Gateway
client = OpenAI(
    base_url="https://ecomdy-api.vercel.app/v1",
    api_key="sk-bp-testkey"  # API Key from Ecomdy 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="")

2. API Key Authentication

All HTTP requests to Ecomdy API must include the Authorization header:

Authorization: Bearer sk-bp-xxx

You can create and manage your API Keys inside the Console Dashboard.

3. API Endpoints Reference

POST/v1/chat/completions

Text completions & LLM reasoning using `dola-seed-2.1-turbo`, `dola-seed-2.0-mini`, `glm-5.2`. Supports `stream: true` for Server-Sent Events.

POST/v1/images/generationsSeedream

High-definition AI image generation using `seedream-5.0-lite` or `seedream-4.5` models.

POST/v1/videos/generationsSeedance 1.5 Pro

Short AI video generation with automated audio matching for TikTok (Model: `seedance-1.5-pro`).

4. Available BytePlus Models & Pricing

Public Model IDProviderCategoryEcomdy Retail Price
dola-seed-2.1-turboByteDanceLLM Text$0.65 / 1M tokens
dola-seed-2.0-miniByteDanceLLM Text$0.195 / 1M tokens
glm-5.2Z.AILLM Text$1.82 / 1M tokens
seedream-5.0-liteByteDanceAI Image$0.0455 / image
seedream-4.5ByteDanceAI Image$0.0520 / image
seedance-1.5-proByteDanceAI Video$0.0780 / 5s video