https://api.lingyiwanwu.com/v1 yi-lightning 지속적인 안정성을 위해 클라이언트에서 대체 엔드포인트 설정을 권장합니다
curl https://api.lingyiwanwu.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "yi-lightning",
"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="yi-lightning",
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: "yi-lightning",
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": "yi-lightning"
}