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://www.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
s9kxcc17lb1a deepseek-v4-pro-0428 DeepSeek Text 4,096 $0.7463/1M tokens $3.7313/1M tokens
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
5xr1fwnx8gno seedance-2.5 5.8元 720P 30秒 Other Video - On demand $0.8657/item

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://www.ldyjs.cn/v1.php"
)

resp = client.chat.completions.create(
    model="s9kxcc17lb1a",
    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": "s9kxcc17lb1a",
  "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://www.ldyjs.cn/v1.php/models \
  -H "Authorization: Bearer sk-ah-你的密钥"

Response:

{
  "object": "list",
  "data": [
    {
      "id": "s9kxcc17lb1a",
      "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="s9kxcc17lb1a",
    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://www.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