TOZPIEĐang tải...
Google's most capable Gemini model. Use it for complex software engineering, long agentic coding tasks, and document-heavy work.
Khuyên dùng cho: Phù hợp cho các tác vụ Complex Software Engineering, Agentic Coding, Long Document Work, 1M Context, Vision, Reasoning và triển khai production chịu tải cao.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "aig_live_YOUR_API_KEY",
baseURL: "https://api.tozpie.net/v1"
});
async function main() {
const completion = await client.chat.completions.create({
model: "Gemini 4 Carbon",
messages: [{ role: "user", content: "Hãy giới thiệu năng lực của bạn." }],
stream: true,
});
for await (const chunk of completion) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}
}
main();| Tham số | Kiểu dữ liệu | Mặc định | Mô tả |
|---|---|---|---|
| model | string | bắt buộc | Định danh mô hình mục tiêu (ví dụ: claude-3-7-sonnet, gpt-5, deepseek-r1, gemini-2.5-pro). (e.g. "Gemini 4 Carbon"). |
| messages | array | bắt buộc | Mảng các đối tượng tin nhắn chứa role (system, user, assistant) và content. |
| stream | boolean | false | Kích hoạt truyền luồng dữ liệu từng đoạn qua Server-Sent Events (SSE). |
| temperature | number | 1.0 | Độ biến thiên ngẫu nhiên của phản hồi (từ 0.0 đến 2.0). |
| max_tokens | integer | null | Số lượng tokens tối đa tạo ra trong kết quả phản hồi. |