https://api.lingyiwanwu.com/v1 01-ai/Yi-Coder-1.5B 安定運用のためにクライアント側でリトライやフォールバックを設定推奨
curl https://api.lingyiwanwu.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "01-ai/Yi-Coder-1.5B",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}' from openai import OpenAI
client = OpenAI(
base_url="https://api.lingyiwanwu.com/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="01-ai/Yi-Coder-1.5B",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in response:
content = chunk.choices[0].delta.content or ""
print(content, end="", flush=True) import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.lingyiwanwu.com/v1",
apiKey: "YOUR_API_KEY"
});
const stream = await client.chat.completions.create({
model: "01-ai/Yi-Coder-1.5B",
messages: [{ role: "user", content: "Hello!" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
} {
"apiProvider": "openai",
"openAiBaseUrl": "https://api.lingyiwanwu.com/v1",
"openAiApiKey": "YOUR_API_KEY",
"openAiModelId": "01-ai/Yi-Coder-1.5B"
}