# Copilot AI โ€” Zapi reference > Microsoft Copilot โ€” chat completion OpenAI-compatible, support streaming SSE **Base URL:** `https://api.zpi.web.id` **Auth:** Send `x-api-key: YOUR_KEY` header on every request. Get a free key at https://zpi.web.id/dashboard/keys. **Response envelope:** `{ status, message, content }` **Rate limit:** 60 req/min on free tier. **Related:** - Detail page: https://zpi.web.id/api/ai/copilot - Endpoint catalog: https://zpi.web.id/category/ai - Concise index: https://zpi.web.id/llms.txt - Full reference: https://zpi.web.id/llms-full.txt --- ## Copilot AI **Category:** ai ยท **Slug:** `copilot` **Detail page:** https://zpi.web.id/api/ai/copilot Microsoft Copilot โ€” chat completion OpenAI-compatible, support streaming SSE **Tags:** ai, copilot, microsoft ### Chat Completion - **Method:** `POST` - **Endpoint:** `https://api.zpi.web.id/v1/ai:copilot/chat` - **Cache TTL:** 600s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `messages` | array | body | yes | OpenAI-format messages array | | `stream` | boolean | body | no | Stream via SSE (OpenAI delta format). Default false | | `mode` | enum(chat|reasoning|smart) | body | no | Gaya jawaban: "chat" = cepat & ringkas (default), "reasoning" = step-by-step terstruktur untuk soal logika/matematika, "smart" = adaptif. Dipetakan ke OpenAI param via field "mode". | **cURL:** ```bash curl -X POST "https://api.zpi.web.id/v1/ai:copilot/chat" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "system", "content": "Kamu adalah Zapi AI, spesialis platform Zapi - Public Rest API" }, { "role": "user", "content": "Halo, perkenalkan dirimu dalam 1 kalimat." } ], "stream": true, "mode": "reasoning" }' ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/ai:copilot/chat", { method: "POST", headers: { "x-api-key": process.env.ZAPI_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ "messages": [ { "role": "system", "content": "Kamu adalah Zapi AI, spesialis platform Zapi - Public Rest API" }, { "role": "user", "content": "Halo, perkenalkan dirimu dalam 1 kalimat." } ], "stream": true, "mode": "reasoning" }) }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.post("https://api.zpi.web.id/v1/ai:copilot/chat", headers={"x-api-key": "YOUR_API_KEY"}, json={ "messages": [ { "role": "system", "content": "Kamu adalah Zapi AI, spesialis platform Zapi - Public Rest API" }, { "role": "user", "content": "Halo, perkenalkan dirimu dalam 1 kalimat." } ], "stream": true, "mode": "reasoning" }) data = r.json() ``` **Example response:** ```json { "id": "chatcmpl-2XU3jZs41hUcZjUseU4Uu", "model": "copilot", "usage": { "total_tokens": 151, "prompt_tokens": 134, "completion_tokens": 17 }, "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Saya adalah Zapi AI, asisten resmi platform Zapi - Public REST API." }, "finish_reason": "stop" } ], "created": 1782118761 } ``` --- _Generated: 2026-08-02T14:22:07.108Z_