API Overview

This platform is fully compatible with the OpenAI API format. You can use the official OpenAI SDKs (Python / Node.js / Java / Go, etc.) directly — just change the Base URL and API Key — or send requests with any HTTP library in any language.

Tip: All requests use Bearer Token authentication. Create your API Key on the "API Tokens" page in the console and keep it safe — never share it with anyone.

Authentication

Send your API Key in the Header of every request:

Authorization: Bearer sk-ah-你的密钥

Base URL

Set the following URL as the OpenAI SDK base_url:

https://ldyjs.cn/v1.php
Note: The Base URL must end with /v1.php — do not append /v1. The SDK automatically appends paths such as /chat/completions,/models and so on.

Available Models

Choose the endpoint by type: Text → POST /v1.php/chat/completions; Image → POST /v1.php/images/generations; Video → POST /video.php/videos(async task; then query the result with GET /video.php/videos/{id} ). Price units in the table below: text per 1M tokens, image per image, video per second (or per clip), as annotated in the table.
Product ID (model param)ModelBrandTypeContext LengthInput PriceOutput Price
xl1srglahwx1 deepseek-v4-flash DeepSeek Text 4,096 $0.0245/1M tokens $0.045/1M tokens
2p95hpgqniln qwen3-30b-a3b Qwen Text 4,096 $0.0491/1M tokens $0.184/1M tokens
eg3cmklgez2k openpangu-2.0-pro Huawei Pangu Text 4,096 $0.1125/1M tokens $0.3885/1M tokens
48wu00r8hpxs qwen3-32b Qwen Text 4,096 $0.0491/1M tokens $0.184/1M tokens
fz4uumurq0ls openpangu-2.0-flash Huawei Pangu Text 4,096 $0.0204/1M tokens $0.0409/1M tokens
0so8v1zcu2v0 deepseek-v4-pro DeepSeek Text 4,096 $0.2862/1M tokens $0.5725/1M tokens
akkf2eay2ooi glm-5.2 Zhipu GLM Text 4,096 $0.2045/1M tokens $0.6543/1M tokens
d2s9mea3ofvw kimi-k2.6 Moonshot AI Text 4,096 $0.1533/1M tokens $0.6134/1M tokens
m50uyl25l7vz glm-5.3 Zhipu GLM Text 4,096 $0.8955/1M tokens $3.7313/1M tokens
bificxygqykk doubao-seedance-2.0-260128 Doubao Video - On demand On demand
jezqjbcp572b doubao-seedance-2.0-fast-260128 Doubao Video - On demand On demand
l4fu7l8dy8ch doubao-seedance-2.0-mini-260615 Doubao Video - On demand On demand
sm3t091meunu doubao-seedance-2.5-260628 Doubao Video - On demand On demand
lsdfph68gehw doubao-seedream-5.0-lite Doubao Image - $0.0224/image $0.0224/image
0ndelflcyf86 doubao-seedream-5.0-pro-260628 Doubao Image - $0.0021/image $0.0313/image
zlxxdlzljqfy doubao-seedream-5.0-flash-260915 Doubao Image - On demand $0.0125/image
85ljgxbknmpq doubao-seedance-2.5-国补版 Doubao Video - $0.0746/sec $0.1493/sec
l84i95yqqzyi deepseek-v4.1-flash-1017 DeepSeek Text 4,096 $0.1134/1M tokens $0.4537/1M tokens
2fjddjpugmds deepseek-v4-flash DeepSeek Text 4,096 $0.1134/1M tokens $0.4537/1M tokens
4su9m0ny0dqt deepseek-v4-flash-0731 DeepSeek Text 4,096 $0.1134/1M tokens $0.4537/1M tokens
irau5q7n5o7h deepseek-v4-pro DeepSeek Text 4,096 $0.5104/1M tokens $1.5313/1M tokens
oqos1l9ow7ot deepseek-v4-pro-0813 DeepSeek Text 4,096 $0.5104/1M tokens $1.5313/1M tokens
dhv027mqz5sp Doubao-seed-2.1-lite Doubao Text 4,096 $0.0824/1M tokens $0.2781/1M tokens
rk8b8i96shlh Doubao-Seed-2.1-pro Doubao Text 4,096 $0.6179/1M tokens $3.0896/1M tokens
s8mlu75qhuci Doubao-Seed-2.1-turbo Doubao Text 4,096 $0.309/1M tokens $1.5448/1M tokens
vlu3sbgnld81 fun-asr Alibaba Cloud Text 4,096 $0/1M tokens $0/1M tokens
5prr5kxcf4yb fun-asr-flash-2026-06-15 Alibaba Cloud Text 4,096 $0/1M tokens $0/1M tokens
p1jf1v5838e2 glm-5.3 Zhipu GLM Text 4,096 $0.4657/1M tokens $1.6299/1M tokens
t7vzgcpxc7wq glm-5.3-flash Zhipu GLM Text 4,096 $0.0597/1M tokens $0.209/1M tokens
gu280zjq4mh5 happyhorse-1.0-i2v Tongyi Wanxiang Video - On demand On demand
uzs74m40gk82 happyhorse-1.1-i2v Tongyi Wanxiang Video - On demand On demand
1n305ptsjkcp hy3 Tencent Text 4,096 $0.1496/1M tokens $0.6006/1M tokens
lrpf0lvciijl hy4-preview Tencent Text 4,096 $0.8955/1M tokens $2.6866/1M tokens
c8bp5do0oyus kimi-k3 Moonshot AI Text 4,096 $0.9499/1M tokens $4.7528/1M tokens
zfej39y0o83p kimi-k3.1-pro Moonshot AI Text 4,096 $0.7373/1M tokens $3.8567/1M tokens
fw56to9n3wsn kimi-k3.1-pro-highspeed Moonshot AI Text 4,096 $1.4746/1M tokens $7.7134/1M tokens
4vwv6v8fi899 Kling-3.0 klingai Video - On demand On demand
ok6uk5u8c8vn Kling-3.0-image klingai Image - On demand $0.0212/image
wczeaviqmd95 Kling-3.0-Omni klingai Image - On demand $0.0212/image
l4b6gez6e6rz Kling-01-4K高清 klingai Video - On demand On demand
j7i0zi7huy1w mimo-v2.6-flash xiaomi Text 4,096 $0.1045/1M tokens $0.209/1M tokens
4advr2z76hve mimo-v2.6-pro xiaomi Text 4,096 $0.3134/1M tokens $0.6269/1M tokens
mptaasdrmi1r mimo-v2.6-pro-ultraspeed xiaomi Text 4,096 $4.4776/1M tokens $10.7463/1M tokens
3qr1s4zl64ly MiniMax-M2.5 MiniMax Text 4,096 $0.0991/1M tokens $0.3964/1M tokens
5n43f8omsxxr MiniMax-M2.7 MiniMax Text 4,096 $0.2229/1M tokens $0.8917/1M tokens
ijpvfjbuflvi MiniMax-M3 MiniMax Text 4,096 $0.3699/1M tokens $1.4774/1M tokens
4yi3qwa2uc0k MiniMax-M3.1-Flash MiniMax Text 4,096 $0.1313/1M tokens $0.5254/1M tokens
o2jlsm0mx2l0 qwen3.6-27b Qwen Text 4,096 $0.4153/1M tokens $2.4918/1M tokens
a573brlx50j6 qwen3.6-35b-a3b Qwen Text 4,096 $0.1717/1M tokens $1.0279/1M tokens
mz7kntb56gwr qwen3.6-flash Qwen Text 4,096 $0.1218/1M tokens $0.7337/1M tokens
9c9d8vcssc23 qwen3.6-flash-2026-04-16 Qwen Text 4,096 $0.18/1M tokens $1.0798/1M tokens
gcqhw97su40x qwen3.6-max-preview Qwen Text 4,096 $0.9137/1M tokens $5.4821/1M tokens
mdj021h2u5ii qwen3.6-plus Qwen Text 4,096 $0.2007/1M tokens $1.2182/1M tokens
vtkwt4qvfqkt qwen3.6-plus-2026-04-02 Qwen Text 4,096 $0.3599/1M tokens $2.1665/1M tokens
lyl38b9kx6xa qwen3.7-max Qwen Text 4,096 $1.0391/1M tokens $3.1172/1M tokens
4y9f7z55y9aa qwen3.7-max-2026-05-20 Qwen Text 4,096 $1.0391/1M tokens $3.1172/1M tokens
0z3ql2vjcdhd qwen3.7-plus Qwen Text 4,096 $0.2077/1M tokens $0.8119/1M tokens
olunyzixv5u0 qwen3.8-flash Qwen Text 4,096 $0.0812/1M tokens $0.274/1M tokens
fz8qs6p2dvmh qwen3.8-max Qwen Text 4,096 $1.2179/1M tokens $3.6537/1M tokens
edo5k4z0t00q qwen3.8-max-0902 Qwen Text 4,096 $1.2182/1M tokens $3.6537/1M tokens
b0l8f2ohqqec qwen3-max Qwen Text 4,096 $0.8306/1M tokens $4.1531/1M tokens
vye0dkyakm53 qwen-audio-3.0-asr-flash Qwen Text 4,096 $0/1M tokens $0/1M tokens
aaf0msqv7lds qwen-audio-3.0-asr-flash-filetrans Qwen Text 4,096 $0/1M tokens $0/1M tokens
831k94t6hu4e qwen-flash-character Qwen Text 4,096 $0.0346/1M tokens $0.2769/1M tokens
01eybjn4s59l qwen-image-2.0 Qwen Image - On demand On demand
826p66ii3n31 qwen-image-3.0 Qwen Image - On demand On demand
5f2qcjux5q1b qwen-image-3.0-pro Qwen Image - On demand On demand
m72gff35mzgp qwen-omni-turbo Qwen Text 4,096 $0.0584/1M tokens $0.2254/1M tokens
umn5g54ro00v wan2.7-image Tongyi Wanxiang Image - On demand $0.0218/image
o56rhwekyl8v wan3.0-video Tongyi Wanxiang Video - On demand On demand
h58oaoyo7zxq wan3.0-video-prime Tongyi Wanxiang Video - On demand On demand
bbzlekfwysf5 z-image-turbo Tongyi Wanxiang Image - On demand $0.0109/image
aoj4sxxghbfc glm-5.3-cs Zhipu GLM Text 4,096 $0.8955/1M tokens $4.1791/1M tokens
b3zlgyr9f81o MiniMax-H3 MiniMax Video - On demand $0.0179/sec

Chat Completions

POST /chat/completions — Create a chat completion. The examples below cover six mainstream languages; click the tabs to switch:

Request Example

from openai import OpenAI

client = OpenAI(
    api_key="sk-ah-你的密钥",
    base_url="https://ldyjs.cn/v1.php"
)

resp = client.chat.completions.create(
    model="xl1srglahwx1",
    messages=[
        {"role": "system", "content": "你是一个有用的助手"},
        {"role": "user", "content": "你好,请介绍一下你自己"}
    ],
    temperature=0.7,
    max_tokens=1024
)
print(resp.choices[0].message.content)
print("Token 用量:", resp.usage)

Request Parameters

ParameterTypeRequiredDescription
modelstringYesProduct ID (see the Available Models table above to pin a specific brand/version); a model name may also be used for automatic routing
messagesarrayYesList of conversation messages, each with a role and content
temperaturefloatNoSampling temperature, 0-2, defaults to 1
max_tokensintNoMaximum number of tokens to generate
top_pfloatNoNucleus sampling probability, defaults to 1
streamboolNoEnable streaming output, defaults to false
stopstring/arrayNoStop sequences
presence_penaltyfloatNo-2.0 to 2.0
frequency_penaltyfloatNo-2.0 to 2.0

Response Example

{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "created": 1724313600,
  "model": "xl1srglahwx1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "你好!我是 AI 助手,有什么可以帮你的吗?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 15,
    "total_tokens": 35
  }
}

Model List

GET /models — List thetextmodels accessible to the current token (the returned id is the Product ID and can be passed directly as the model parameter). Image/video products are not returned by this endpoint; refer to the "Available Models" table above.

curl https://ldyjs.cn/v1.php/models \
  -H "Authorization: Bearer sk-ah-你的密钥"

Response:

{
  "object": "list",
  "data": [
    {
      "id": "xl1srglahwx1",
      "object": "model",
      "created": 1724313600,
      "owned_by": "deepseek"
    }
  ]
}

Streaming

Set stream: true to receive a Server-Sent Events (SSE) streaming response, fully compatible with the OpenAI format. Examples in each language:

stream = client.chat.completions.create(
    model="xl1srglahwx1",
    messages=[{"role": "user", "content": "写一首关于编程的诗"}],
    stream=True
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

SSE data format:

data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"你好"},"index":0}]}

data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"!"},"index":0}]}

data: [DONE]

Error Codes

All errors are returned in the standard OpenAI error format:

{
  "error": {
    "message": "错误描述",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
HTTP Status CodetypeDescription
400invalid_request_errorInvalid request parameters (missing model, messages, etc.)
401invalid_api_keyThe API Key is invalid, disabled, or expired
403permission_errorThe token has no access to this model, or the IP is restricted
402insufficient_quotaInsufficient quota — please top up or use another token
404invalid_request_errorThe model does not exist or has been delisted
502upstream_errorThe upstream service request failed
503service_unavailableNo available channel for this model

SDKs & Dependencies

The platform is fully compatible with the OpenAI API — the official OpenAI SDKs are recommended. Java / Go / PHP can also use native HTTP libraries (all examples above are dependency-free). SDK installation per language:

LanguageInstallationDescription
Pythonpip install openaiOfficial OpenAI SDK — just change base_url
Node.jsnpm install openaiOfficial OpenAI SDK — just change baseURL
Javacom.squareup.okhttp3:okhttpNative OkHttp calls; the official OpenAI Java SDK also works
GolangNothing to installStandard library net/http, no extra dependencies
PHPcomposer require guzzlehttp/guzzleGuzzle HTTP client; openai-php/client also works
cURLBuilt into the OSCall directly from the command line — great for quick testing
Tip: Whatever language you use, only two substitutions are needed: base_url to https://ldyjs.cn/v1.php, and your API Key to the token created in the console.

Billing

Fees are calculated based on actual token usage. Formula:

费用(USD) = (输入tokens / 1000 × 输入单价) + (输出tokens / 1000 × 输出单价)
实扣额度(quota) = 费用(USD) × 500000 × 用户分组折扣

Where:

  • Input price / Output price: as annotated in the "Available Models" table — text per 1M tokens, image per image, video per second or per clip
  • 500000: fixed conversion rate, 1 USD = 500,000 quota
  • Group discount: default 1.0, VIP 0.9, SVIP 0.8
  • Image models: billed per image (tokens in the formula above translate to image count);Video models: billed per second or per clip; see the "Video Generation" page in the console for cost estimates

The usage field in every response returns the exact token usage for cost calculation. Non-streaming responses always include usage; for streaming responses it depends on the upstream — some providers include it in the last chunk.

Token quota: Each token can have its own quota. Requests check both the account balance and the token balance; if either is zero, a 402 error is returned.

Ready to get started?

Sign up to get your API Key

Sign Up Free