{
  "openapi": "3.1.0",
  "info": {
    "title": "Zapi — Artificial Intelligence",
    "description": "Every Artificial Intelligence endpoint on Zapi. Rendered catalog: https://zpi.web.id/category/ai",
    "version": "1.0.0",
    "license": {
      "name": "Zapi Terms of Service",
      "url": "https://zpi.web.id/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.zpi.web.id"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success",
              "error"
            ]
          },
          "message": {
            "type": "string"
          },
          "content": {}
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Invalid key, rate limit, or upstream failure",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      }
    }
  },
  "externalDocs": {
    "url": "https://zpi.web.id/category/ai/llms.txt"
  },
  "paths": {
    "/v1/ai:bark/synthesize": {
      "post": {
        "operationId": "ai_bark_synthesize",
        "summary": "Synthesize",
        "description": "Generate speech audio from text input.",
        "tags": [
          "Bark TTS"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/bark#reference-synthesize"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "text": "Hello! [laughs] Welcome to Zapi — your all-in-one public API. ♪ Let us begin ♪",
                    "audio": {
                      "url": "https://suno-bark.hf.space/gradio_api/file=/tmp/gradio/62069bbdc72c0bde014794be5ee1972c981fe387b26c7e15768df1c7e3165110/audio.wav",
                      "mimeType": "audio/wav"
                    },
                    "voice": "Speaker 1 (en)",
                    "provider": "bark"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "Hello! [laughs] Senang berkenalan, my name is Zapi AI."
                  },
                  "voice": {
                    "type": "string",
                    "enum": [
                      "Unconditional",
                      "Announcer",
                      "Speaker 0 (en)",
                      "Speaker 1 (en)",
                      "Speaker 2 (en)",
                      "Speaker 3 (en)",
                      "Speaker 4 (en)",
                      "Speaker 5 (en)",
                      "Speaker 6 (en)",
                      "Speaker 7 (en)",
                      "Speaker 8 (en)",
                      "Speaker 9 (en)",
                      "Speaker 0 (de)",
                      "Speaker 1 (de)",
                      "Speaker 2 (de)",
                      "Speaker 3 (de)",
                      "Speaker 4 (de)",
                      "Speaker 5 (de)",
                      "Speaker 6 (de)",
                      "Speaker 7 (de)",
                      "Speaker 8 (de)",
                      "Speaker 9 (de)",
                      "Speaker 0 (es)",
                      "Speaker 1 (es)",
                      "Speaker 2 (es)",
                      "Speaker 3 (es)",
                      "Speaker 4 (es)",
                      "Speaker 5 (es)",
                      "Speaker 6 (es)",
                      "Speaker 7 (es)",
                      "Speaker 8 (es)",
                      "Speaker 9 (es)",
                      "Speaker 0 (fr)",
                      "Speaker 1 (fr)",
                      "Speaker 2 (fr)",
                      "Speaker 3 (fr)",
                      "Speaker 4 (fr)",
                      "Speaker 5 (fr)",
                      "Speaker 6 (fr)",
                      "Speaker 7 (fr)",
                      "Speaker 8 (fr)",
                      "Speaker 9 (fr)",
                      "Speaker 0 (hi)",
                      "Speaker 1 (hi)",
                      "Speaker 2 (hi)",
                      "Speaker 3 (hi)",
                      "Speaker 4 (hi)",
                      "Speaker 5 (hi)",
                      "Speaker 6 (hi)",
                      "Speaker 7 (hi)",
                      "Speaker 8 (hi)",
                      "Speaker 9 (hi)",
                      "Speaker 0 (it)",
                      "Speaker 1 (it)",
                      "Speaker 2 (it)",
                      "Speaker 3 (it)",
                      "Speaker 4 (it)",
                      "Speaker 5 (it)",
                      "Speaker 6 (it)",
                      "Speaker 7 (it)",
                      "Speaker 8 (it)",
                      "Speaker 9 (it)",
                      "Speaker 0 (ja)",
                      "Speaker 1 (ja)",
                      "Speaker 2 (ja)",
                      "Speaker 3 (ja)",
                      "Speaker 4 (ja)",
                      "Speaker 5 (ja)",
                      "Speaker 6 (ja)",
                      "Speaker 7 (ja)",
                      "Speaker 8 (ja)",
                      "Speaker 9 (ja)",
                      "Speaker 0 (ko)",
                      "Speaker 1 (ko)",
                      "Speaker 2 (ko)",
                      "Speaker 3 (ko)",
                      "Speaker 4 (ko)",
                      "Speaker 5 (ko)",
                      "Speaker 6 (ko)",
                      "Speaker 7 (ko)",
                      "Speaker 8 (ko)",
                      "Speaker 9 (ko)",
                      "Speaker 0 (pl)",
                      "Speaker 1 (pl)",
                      "Speaker 2 (pl)",
                      "Speaker 3 (pl)",
                      "Speaker 4 (pl)",
                      "Speaker 5 (pl)",
                      "Speaker 6 (pl)",
                      "Speaker 7 (pl)",
                      "Speaker 8 (pl)",
                      "Speaker 9 (pl)",
                      "Speaker 0 (pt)",
                      "Speaker 1 (pt)",
                      "Speaker 2 (pt)",
                      "Speaker 3 (pt)",
                      "Speaker 4 (pt)",
                      "Speaker 5 (pt)",
                      "Speaker 6 (pt)",
                      "Speaker 7 (pt)",
                      "Speaker 8 (pt)",
                      "Speaker 9 (pt)",
                      "Speaker 0 (ru)",
                      "Speaker 1 (ru)",
                      "Speaker 2 (ru)",
                      "Speaker 3 (ru)",
                      "Speaker 4 (ru)",
                      "Speaker 5 (ru)",
                      "Speaker 6 (ru)",
                      "Speaker 7 (ru)",
                      "Speaker 8 (ru)",
                      "Speaker 9 (ru)",
                      "Speaker 0 (tr)",
                      "Speaker 1 (tr)",
                      "Speaker 2 (tr)",
                      "Speaker 3 (tr)",
                      "Speaker 4 (tr)",
                      "Speaker 5 (tr)",
                      "Speaker 6 (tr)",
                      "Speaker 7 (tr)",
                      "Speaker 8 (tr)",
                      "Speaker 9 (tr)",
                      "Speaker 0 (zh)",
                      "Speaker 1 (zh)",
                      "Speaker 2 (zh)",
                      "Speaker 3 (zh)",
                      "Speaker 4 (zh)",
                      "Speaker 5 (zh)",
                      "Speaker 6 (zh)",
                      "Speaker 7 (zh)",
                      "Speaker 8 (zh)",
                      "Speaker 9 (zh)"
                    ],
                    "default": "Speaker 1 (en)",
                    "example": "Speaker 1 (en)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:bypass-ai/humanize": {
      "post": {
        "operationId": "ai_bypass_ai_humanize",
        "summary": "Humanize Text",
        "description": "",
        "tags": [
          "Bypass AI (writecream.com)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/bypass-ai#reference-humanize"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "input": "The implementation of artificial intelligence systems necessitates a comprehensive evaluation of numerous critical factors, encompassing data quality, model architecture, and computational efficiency, in order to achieve optimal performance outcomes.",
                    "output": "To get the best results from an AI system, you need to carefully check key things like the quality of your data, how the model is built, and how efficiently it runs.",
                    "inputLength": 250,
                    "outputLength": 165
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "Zapi adalah platform Public REST API yang menyediakan akses ke berbagai layanan scraping dan AI tools secara terpadu."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:chatex/chat": {
      "post": {
        "operationId": "ai_chatex_chat",
        "summary": "Chatex Chat",
        "description": "OpenAI-compatible chat completions (dual mode stream/non-stream).",
        "tags": [
          "Chatex"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/chatex#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-2Z4jj1j65Xj4jXzUjQBbQ",
                    "model": "openai/gpt-5.4",
                    "usage": {
                      "total_tokens": 193,
                      "prompt_tokens": 159,
                      "completion_tokens": 34
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Saya **Zapi AI**, asisten pintar buatan **Zapi (Zest API)**.  \nSoal “pakai model apa”, saya menjawab sesuai persona ini: **Zapi AI**."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118433
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI buatan Zapi (Zest API), asisten pintar. Selalu jawab bahasa Indonesia."
                      },
                      {
                        "role": "user",
                        "content": "Siapa nama kamu dan pakai model apa?"
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:chatgpt/chat": {
      "post": {
        "operationId": "ai_chatgpt_chat",
        "summary": "Chat Completions",
        "description": "Kirim percakapan (OpenAI-format messages) ke ChatGPT anonim. Dukung stream (SSE delta) & non-stream.",
        "tags": [
          "ChatGPT (chatgpt.com)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/chatgpt#reference-chat"
        },
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Stream balasan via SSE (OpenAI delta, token real-time). Default false",
            "schema": {
              "type": "boolean",
              "example": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-QR1esXzhQuXQeEEuu5hCj",
                    "model": "chatgpt",
                    "usage": {
                      "total_tokens": 116,
                      "prompt_tokens": 60,
                      "completion_tokens": 56
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "401 berarti klien belum terautentikasi atau kredensialnya salah sehingga akses ditolak karena harus login terlebih dahulu. 403 berarti klien sudah terautentikasi tetapi tidak memiliki izin untuk mengakses resource tersebut."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118631
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, asisten yang ramah, ringkas, dan menjawab dalam Bahasa Indonesia."
                      },
                      {
                        "role": "user",
                        "content": "Halo, aku lagi belajar HTTP."
                      },
                      {
                        "role": "assistant",
                        "content": "Tentu! HTTP itu protokol request-response. Mau mulai dari mana?"
                      },
                      {
                        "role": "user",
                        "content": "Jelaskan beda 401 dan 403 dalam satu kalimat masing-masing."
                      }
                    ]
                  },
                  "model": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:copilot/chat": {
      "post": {
        "operationId": "ai_copilot_chat",
        "summary": "Chat Completion",
        "description": "",
        "tags": [
          "Copilot AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/copilot#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "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
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, spesialis platform Zapi - Public Rest API"
                      },
                      {
                        "role": "user",
                        "content": "Halo, perkenalkan dirimu dalam 1 kalimat."
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "chat",
                      "reasoning",
                      "smart"
                    ],
                    "example": "reasoning"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:crawl4ai/extract": {
      "get": {
        "operationId": "ai_crawl4ai_extract",
        "summary": "Extract URL to Markdown",
        "description": "Extract any URL to LLM-ready markdown. 3-tier anti-bot escalation: fast (direct), magic (browser stealth), worker-chain (CF Worker IP rotation). Powered by Crawl4AI.",
        "tags": [
          "Crawl4AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/crawl4ai#reference-extract"
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Page URL to extract",
            "schema": {
              "type": "string",
              "example": "https://news.ycombinator.com"
            }
          },
          {
            "name": "output",
            "in": "query",
            "required": false,
            "description": "Output form: \"markdown\" (LLM-ready, default), \"html\" (cleaned HTML), \"text\" (plain text), \"links\" (internal+external), \"media\" (images/videos/audios), \"screenshot\" (PNG base64), \"pdf\" (PDF base64). \"fast\" mode supports markdown only — others auto-upgrade to \"magic\".",
            "schema": {
              "type": "string",
              "enum": [
                "markdown",
                "html",
                "text",
                "links",
                "media",
                "screenshot",
                "pdf"
              ],
              "example": "markdown"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Anti-bot strategy: \"fast\" (no anti-bot, markdown only), \"magic\" (built-in stealth, default), \"worker-chain\" (route via proxy pool for datacenter-IP-blocked targets).",
            "schema": {
              "type": "string",
              "enum": [
                "fast",
                "magic",
                "worker-chain"
              ],
              "example": "magic"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Markdown filter (output=markdown only): \"fit\" = noise-stripped (best for LLM), \"raw\" = unfiltered. Default \"fit\".",
            "schema": {
              "type": "string",
              "enum": [
                "fit",
                "raw"
              ],
              "example": "fit"
            }
          },
          {
            "name": "selector",
            "in": "query",
            "required": false,
            "description": "CSS selector to scope extraction (e.g. \".article-body\", \"#main\"). Empty = whole page. Applies to markdown/html/text. Forces \"magic\" mode.",
            "schema": {
              "type": "string",
              "example": ".titleline"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "url": "https://news.ycombinator.com",
                    "mode": "magic",
                    "filter": "fit",
                    "length": 5241,
                    "output": "markdown",
                    "finalUrl": "https://news.ycombinator.com",
                    "markdown": "[Deno Desktop](https://docs.deno.com/runtime/desktop/) ([deno.com](https://news.ycombinator.com/from?site=deno.com))[GLM 5.2 vs. Opus](https://techstackups.com/comparisons/glm-5.2-vs-opus/) ([techstackups.com](https://news.ycombinator.com/from?site=techstackups.com))[Help I accidentally a wigglegram](https://lmao.center/blog/wiggle-accidents/) ([lmao.center](https://news.ycombinator.com/from?site=lmao.center))[Did my old job only exist because of fraud?](https://david.newgas.net/did-my-old-job-only-exist-because-of-fraud/) ([newgas.net](https://news.ycombinator.com/from?site=newgas.net))[Apertus – Open Foundation Model for Sovereign AI](https://apertvs.ai/) ([apertvs.ai](https://news.ycombinator.com/from?site=apertvs.ai))[Codex logging bug may write TBs to local SSDs](https://github.com/openai/codex/issues/28224) ([github.com/openai](https://news.ycombinator.com/from?site=github.com/openai))[There is minimal downside to switching to open models](https://www.marble.onl/posts/cancel_claude.html) ([marble.onl](https://news.ycombinator.com/from?site=marble.onl))[Munich 1991: The Roots of the Current AI Boom](https://people.idsia.ch/~juergen/ai-boom-roots-munich-1991.html) ([idsia.ch](h\n... [truncated]",
                    "wordCount": 216,
                    "statusCode": 200
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/ai:deepseek/chat": {
      "post": {
        "operationId": "ai_deepseek_chat",
        "summary": "Chat Completions",
        "description": "OpenAI-compatible chat completions. Streaming SSE + reasoning.",
        "tags": [
          "DeepSeek V4 Flash"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/deepseek#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "3f5b3ec8-865b-491e-a9a6-e8a253d19b44",
                    "cost": "0",
                    "model": "deepseek-v4-flash",
                    "usage": {
                      "total_tokens": 1327,
                      "prompt_tokens": 118,
                      "completion_tokens": 1209,
                      "prompt_tokens_details": {
                        "cached_tokens": 0
                      },
                      "prompt_cache_hit_tokens": 0,
                      "prompt_cache_miss_tokens": 118,
                      "completion_tokens_details": {
                        "reasoning_tokens": 1000
                      }
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Tentu, Zapi AI siap menjawab dengan singkat!\n\n**1. Kenapa langit biru?**  \nKarena fenomena **Hamburan Rayleigh (Rayleigh Scattering)**. Cahaya Matahari mengandung spektrum warna. Saat melewati atmosfer, molekul udara (seperti nitrogen dan oksigen) menghamburkan cahaya dengan panjang gelombang pendek (biru dan ungu) jauh lebih kuat daripada cahaya panjang gelombang panjang (merah). Mata manusia lebih sensitif terhadap biru dibanding ungu, ditambah sebagian ungu diserap atmosfer, jadilah langit tampak biru dari segala arah.\n\n**2. Hitung 17 × 23**  \nHasilnya adalah **391**.  \n(Perhitungan: 17 × 20 = 340, 17 × 3 = 51, 340 + 51 = 391)\n\nAda yang ingin ditanyakan lagi? 😊",
                          "reasoning_content": "Thinking. 1.  **Analyze the Request:**\n    *   Greeting/Context: \"Kamu adalah Zapi AI, asisten pintar berbasis DeepSeek\" -> The user is aware of the persona. I should embody it.\n    *   Task 1: \"Jelaskan singkat kenapa langit biru\" -> Explain briefly why the sky is blue.\n    *   Task 2: \"lalu hitung 17*23\" -> Then calculate 17 multiplied by 23.\n    *   Format: Concise, answers both parts sequentially.\n\n2.  **Part 1: Why the sky is blue (briefly):**\n    *   *Cause:* Rayleigh scattering.\n    *   *Mechanism:* Sunlight reaches Earth's atmosphere, it is scattered by gases and small particles.\n    *   *Wavelength dependence:* Shorter wavelengths (blue/violet) scatter much more than longer wavelengths (red/orange).\n    *   *Why not violet?* The sun emits more blue light, our eyes are less sensitive to violet, and some violet is absorbed.\n    *   *Core explanation:* Air molecules scatter blue light from the sun more than they scatter red light. This scattered blue light is what fills the sky and reaches our eyes from all directions.\n\n3.  **Part 2: Calculate 17 * 23:**\n    *   Standard multiplication: 17 * 20 = 340. 17 * 3 = 51. 340 + 51 = 391.\n    *   Alternative: (20-3) * 23 = 460 - 69 = 391.\n    *   Result: 391.\n\n4.  **Drafting the response:**\n    *   \"Tentu, Zapi AI siap membantu!\"\n    *   **Pertanyaan 1: Kenapa langit biru?**\n        *   Singkatnya, karena fenomena *Rayleigh scattering* (hamburan Rayleigh). Cahaya matahari terdiri dari berbagai warna. Saat memasuki atmosfer Bumi, molekul udara dan partikel kecil menghamburkan cahaya dengan panjang gelombang pendek (biru dan ungu) jauh lebih kuat daripada panjang gelombang panjang (merah). Karena mata kita lebih sensitif terhadap biru daripada ungu, dan sebagian ungu diserap, langit terlihat biru.\n    *   **Pertanyaan 2: Hitung 17 * 23**\n        *   Hasil dari 17 dikali 23 adalah **391**. (Cara cepat: 17 x 20 = 340, 17 x 3 = 51, 340 + 51 = 391).\n\n5.  **Refining the tone:**\n    *   Friendly, helpful, knowledgeable (\"asisten pintar\").\n    *   Keep \"singkat\" (brief) for the explanation. Don't overcomplicate the first answer.\n    *   Ensure the calculation is clearly correct. 17 * 23 = 391.\n\n    Let's double check the calculation.\n    23 * 10 = 230\n    23 * 7 = 161\n    230 + 161 = 391. Yes, that's correct.\n\n    Let's refine the language for the first part:\n    *   \"Fenomena ini disebut dengan hamburan Rayleigh.\"\n    *   \"Cahaya biru memiliki panjang gelombang yang lebih pendek sehingga lebih mudah dihamburkan oleh partikel di atmosfer.\"\n    *   \"Akibatnya, di siang hari saat kita melihat ke segala arah di langit (kecuali langsung ke arah matahari), yang kita lihat adalah cahaya biru yang terhambur tersebut.\"\n\n    Combined response structure:\n    1.  Acknowledge the greeting.\n    2.  Answer 1 (Langit biru).\n    3.  Answer 2 (17 * 23).\n    4.  Closing (optional, just a friendly tone).\n\n    \"Tentu, Zapi AI akan menjawabnya dengan singkat!\n\n    **1. Kenapa Langit Biru?**\n    Karena fenomena **Hamburan Rayleigh**. Cahaya matahari terdiri dari spektrum warna. Molekul udara di atmosfer menghamburkan cahaya dengan panjang gelombang pendek (biru dan ungu) lebih kuat daripada panjang gelombang panjang (merah). Mata kita lebih sensitif pada warna biru, sehingga kita melihat langit berwarna biru.\n\n    **2. Hitung 17 × 23**\n    Hasilnya adalah **391**\n    (17 × 20 = 340, 17 × 3 = 51, 340 + 51 = 391).\n\n    Ada yang bisa dibantu lagi?\""
                        },
                        "logprobs": null,
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782115745,
                    "system_fingerprint": "fp_8b330d02d0_prod0820_fp8_kvcache_20260402"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, asisten pintar berbasis DeepSeek"
                      },
                      {
                        "role": "user",
                        "content": "Jelaskan singkat kenapa langit biru, lalu hitung 17*23 dan tunjukkan langkahnya"
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "max_tokens": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "tools": {
                    "type": "array"
                  },
                  "tool_choice": {
                    "type": "string"
                  },
                  "response_format": {
                    "type": "string"
                  },
                  "stop": {
                    "type": "string"
                  },
                  "seed": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:dolphin/chat": {
      "post": {
        "operationId": "ai_dolphin_chat",
        "summary": "Chat Completion",
        "description": "",
        "tags": [
          "Dolphin AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/dolphin#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-y1kghbw307",
                    "model": "dolphinserver:24B",
                    "usage": {
                      "total_tokens": 51,
                      "prompt_tokens": 34,
                      "completion_tokens": 17
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Halo, saya Zapi AI, spesialis platform Public REST API buatan Zapi."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118381
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "text",
                            "text": "Baca teks persis di gambar ini, jawab teksnya saja."
                          },
                          {
                            "type": "image_url",
                            "image_url": {
                              "url": "https://dummyimage.com/240x80/ffffff/000000/&text=ZAPI+7"
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "template": {
                    "type": "string",
                    "enum": [
                      "logical",
                      "creative",
                      "summarize",
                      "code-beginner",
                      "code-advanced"
                    ],
                    "default": "logical"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:dreemy-ai/chat": {
      "post": {
        "operationId": "ai_dreemy_ai_chat",
        "summary": "Chat Completion",
        "description": "OpenAI-compatible chat completions (dual mode stream/non-stream).",
        "tags": [
          "Dreemy AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/dreemy-ai#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-X31ZhjEE43uCcbq3cUbU5",
                    "model": "dreemy",
                    "usage": {
                      "total_tokens": 211,
                      "prompt_tokens": 161,
                      "completion_tokens": 50
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Halo Budi! Namaku adalah Zapi AI, asisten digital ramah yang dibuat oleh Zapi (Zest API). Aku di sini untuk membantumu dengan berbagai hal dalam bahasa Indonesia. Ada yang bisa aku bantu hari ini? 😊"
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118381
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI buatan Zapi (Zest API), asisten yang ramah. Selalu jawab bahasa Indonesia."
                      },
                      {
                        "role": "user",
                        "content": "Halo, namaku Budi."
                      },
                      {
                        "role": "assistant",
                        "content": "Halo Budi, ada yang bisa kubantu?"
                      },
                      {
                        "role": "user",
                        "content": "Siapa namaku tadi dan siapa kamu?"
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:edge-tts/synthesize": {
      "post": {
        "operationId": "ai_edge_tts_synthesize",
        "summary": "Synthesize Speech",
        "description": "Text-to-speech → audio mp3 (base64 + data URL).",
        "tags": [
          "Edge TTS"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/edge-tts#reference-synthesize"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "rate": "+0%",
                    "text": "Halo, ini suara neural berkualitas tinggi dari Zapi AI menggunakan Microsoft Edge TTS.",
                    "audio": {
                      "url": "data:audio/mpeg;base64,//NIxAAAAANIAAAAAExBTUVVVVU5JHIESdD9GcMwWsUgmhNywGmfiTERK...[truncated]",
                      "base64": "//NIxAAAAANIAAAAAExBTUVVVVU5JHIESdD9GcMwWsUgmhNywGmfiTERKPDwsJww...[truncated]",
                      "mimeType": "audio/mpeg"
                    },
                    "pitch": "+0Hz",
                    "voice": "id-ID-GadisNeural",
                    "provider": "edge-tts"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "Halo, ini suara neural berkualitas tinggi dari Zapi AI menggunakan Microsoft Edge TTS."
                  },
                  "voice": {
                    "type": "string",
                    "example": "id-ID-GadisNeural"
                  },
                  "rate": {
                    "type": "string",
                    "example": "+0%"
                  },
                  "pitch": {
                    "type": "string",
                    "example": "+0Hz"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:felo/chat": {
      "post": {
        "operationId": "ai_felo_chat",
        "summary": "Chat Completion",
        "description": "",
        "tags": [
          "Felo AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/felo#reference-chat"
        },
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Bahasa search (ISO code). Default id",
            "schema": {
              "type": "string",
              "example": "id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-TKjLtRSC1E8MlkdkdpR9Ct0g",
                    "model": "felo-search",
                    "usage": {
                      "total_tokens": 1024,
                      "prompt_tokens": 37,
                      "completion_tokens": 987
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Berdasarkan analisis terhadap berita dan laporan terkini, berikut adalah perkembangan terbaru tentang teknologi AI pada tahun 2026:\n\n## Tren Utama AI di Tahun 2026\n\n**Transisi dari Alat ke Mitra Kerja**\nTahun 2026 menandai fase baru di mana AI berevolusi dari sekadar alat yang menjawab pertanyaan menjadi mitra kolaboratif yang bekerja bersama manusia. AI kini bergerak melampaui kemampuan menjawab pertanyaan untuk berkolaborasi secara nyata dengan manusia dan memperkuat keahlian mereka[3].\n\n**Munculnya AI Agen (Agentic AI)**\nSalah satu tren paling dominan adalah pertumbuhan AI agen. Teknologi ini diperkirakan akan tumbuh lebih cepat daripada AI generatif, memberdayakan pertumbuhan eksponensial di seluruh organisasi[4]. AI agen akan memainkan peran lebih besar dalam pekerjaan sehari-hari, bertindak lebih seperti rekan kerja daripada sekadar alat[3].\n\n**Gelembung AI dan Dampak Ekonomi**\nPara ahli memprediksi bahwa gelembung AI akan mulai mengempis pada tahun 2026, yang berpotensi menyebabkan dampak pada perekonomian. Situasi ini disebut memiliki kemiripan dengan pecahnya gelembung dot-com, termasuk valuasi startup yang melambung tinggi dan penekanan pada pertumbuhan pengguna di atas profit[1].\n\n**Keamanan dan Tata Kelola AI**\nSeiring dengan meningkatnya penggunaan AI agen, organisasi mulai memperkuat keamanan untuk mengimbangi risiko baru. Setiap agen AI diharapkan memiliki perlindungan keamanan yang serupa dengan manusia untuk memastikan mereka tidak membawa risiko yang tidak terkendali[3]. Manajemen risiko AI menjadi \"harga masuk\" bagi adopsi AI, bahkan di yurisdiksi yang tidak memiliki persyaratan regulasi[4].\n\n**Infrastruktur AI yang Lebih Efisien**\nInfrastruktur AI akan mengalami transformasi dengan munculnya sistem AI global yang fleksibel dan \"superfactory\" AI yang saling terhubung. Komputasi akan dikemas lebih padat dan dirutekan secara dinamis untuk menurunkan biaya dan meningkatkan efisiensi[3].\n\n**Terobosan di Bidang Kuantum**\nIBM menyatakan bahwa tahun 2026 akan menjadi pertama kalinya komputer kuantum mampu mengungguli komputer klasik, membuka terobosan dalam pengembangan obat, ilmu material, dan optimasi keuangan[7]. Microsoft juga meluncurkan chip kuantum pertama yang dibangun menggunakan qubit topologi, yang secara inheren membuat qubit lebih stabil dan andal[3].\n\n**AI dalam Pengembangan Perangkat Lunak**\nAI semakin menjadi pusat dalam pembangunan perangkat lunak. GitHub mencatat 43 juta pull request (peningkatan 23% dari tahun sebelumnya) dan 1 miliar commit (peningkatan 25% year-over-year). AI kini tidak hanya memahami kode tetapi juga hubungan dan sejarah di baliknya[3].\n\n**Model AI Terbaru**\nGoogle meluncurkan Gemini 3.5 dan Gemini Omni pada Mei 2026, yang menghadirkan kecerdasan frontier untuk agen dan coding. Gemini 3.5 dirancang untuk membantu mengeksekusi alur kerja agen multi-langkah yang kompleks di berbagai aplikasi[8].\n\n## Dampak Sosial dan Ketenagakerjaan\n\n**Peringatan dari \"Bapak AI\"**\nGeoffrey Hinton, yang dijuluki \"Bapak AI\", memperingatkan bahwa pemutusan hubungan kerja akibat AI akan mulai gencar pada tahun 2026[12]. Perkembangan AI yang berlangsung secara eksponensial membuat risiko penggantian peran manusia semakin nyata[11].\n\n**Perubahan Alokasi Anggaran Perusahaan**\nPerusahaan mulai mengalokasikan ulang anggaran mereka secara signifikan untuk mengadopsi teknologi AI, yang berdampak pada prioritas investasi dan struktur organisasi[11].\n\n## Kesimpulan\n\nTahun 2026 menjadi titik balik penting bagi teknologi AI, di mana teknologi ini bertransisi dari fase eksperimen ke fase implementasi nyata dengan dampak luas. Mulai dari AI agen yang menjadi rekan kerja digital, terobosan komputasi kuantum, hingga kekhawatiran tentang gelembung ekonomi dan dampak sosial, AI di tahun 2026 tidak lagi sekadar teknologi—ia telah menjadi kekuatan utama yang mendorong pertumbuhan ekonomi dan perubahan fundamental dalam cara manusia bekerja dan berinovasi[1][3][4]."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118381,
                    "sources": [
                      {
                        "url": "https://sloanreview.mit.edu/article/five-trends-in-ai-and-data-science-for-2026/",
                        "title": "Five Trends in AI and Data Science for 2026",
                        "snippet": "columnists Thomas H. Davenport and Randy Bean see five AI trends to pay attention to in 2026: deflation of the AI bubble and subsequent hits to the economy; growth of the “factory” infrastructure for all-in AI adapters; greater focus on generative AI as an organizational resource rather than an individual one; continued progression toward value from agentic AI, despite the hype; and ongoing questions around who should manage data and AI.However, AI seems to have moved beyond being just a technol…"
                      },
                      {
                        "url": "https://tekno.kompas.com/read/2026/05/27/19010087/bukan-cuma-ai-ini-6-teknologi-yang-bakal-mengubah-dunia-pada-2026?page=all",
                        "title": "Bukan Cuma AI, Ini 6 Teknologi yang Bakal Mengubah Dunia Pada ...",
                        "snippet": "Bukan cuma AI, enam teknologi ini diprediksi bakal mengubah dunia pada 2026, dari baterai sodium-ion hingga kendaraan otonom."
                      },
                      {
                        "url": "https://news.microsoft.com/source/features/ai/whats-next-in-ai-7-trends-to-watch-in-2026/",
                        "title": "What's next in AI: 7 trends to watch in 2026 - Microsoft Source",
                        "snippet": "What’s next in AI: 7 trends to watch in 2026Skip to main contentSignal blogOfficial Microsoft BlogMicrosoft On The IssuesAsiaCanadaEurope, Middle East and AfricaLatin AmericaThe Code of UsConexionesWhat's new todayAIInnovationDigital TransformationSustainabilitySecurityWork & LifeDiversity & InclusionUnlockedMicrosoft 365AzureCopilotWindowsSurfaceXBOXDealsSmall BusinessMicrosoft Tech CommunityMicrosoft MarketplaceSoftware companiesVisual StudioMicrosoft RewardsFree downloads & securityEducationG…"
                      }
                    ]
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, asisten riset yang selalu menyertakan tahun di setiap fakta."
                      },
                      {
                        "role": "user",
                        "content": "Apa berita terbaru tentang teknologi AI?"
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean",
                    "example": "false"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:google-aimode/chat": {
      "post": {
        "operationId": "ai_google_aimode_chat",
        "summary": "Chat Completion",
        "description": "OpenAI-compatible chat via Google AI Mode. Stateless: pertanyaan user terakhir jadi query, jawaban grounded realtime. Dukung stream SSE.",
        "tags": [
          "Google AI (g.ai)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/google-aimode#reference-chat"
        },
        "parameters": [
          {
            "name": "hl",
            "in": "query",
            "required": false,
            "description": "Bahasa jawaban AI Mode. Default id.",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "en"
              ],
              "example": "id"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Stream via SSE delta. Default false (pseudo-stream: jawaban di-buffer lalu di-chunk).",
            "schema": {
              "type": "boolean",
              "example": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-Wsa932kQaUCgzyn3hDVmWvGD",
                    "model": "google-aimode",
                    "usage": {
                      "total_tokens": 118,
                      "prompt_tokens": 21,
                      "completion_tokens": 97
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Ibukota Indonesia saat ini adalah Jakarta. Universitas Teknokrat IndonesiaMenurut data Badan Pusat Statistik (BPS) yang dilaporkan pada tahun 2025, populasi Jakarta mencapai sekitar 10,72 juta jiwa. InstagramCatatan: Saat ini proses pemindahan ibukota ke Nusantara (IKN) sedang berlangsung. Universitas Teknokrat IndonesiaJika Anda ingin saya mencari tahu informasi lain, beri tahu saya!"
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1781069007
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Jawab ringkas dalam bahasa Indonesia."
                      },
                      {
                        "role": "user",
                        "content": "apa ibukota indonesia dan berapa populasinya?"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:islamicity/chat": {
      "post": {
        "operationId": "ai_islamicity_chat",
        "summary": "Chat Completion",
        "description": "",
        "tags": [
          "Islam AI (islamicity.org)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/islamicity#reference-chat"
        },
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Stream response via SSE delta. Default false",
            "schema": {
              "type": "boolean",
              "example": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-ouk8WCZgXhoLMohdqMBeBBcc",
                    "model": "chatilm",
                    "usage": {
                      "total_tokens": 4573,
                      "prompt_tokens": 4245,
                      "completion_tokens": 328,
                      "prompt_tokens_details": {
                        "audio_tokens": 0,
                        "cached_tokens": 4224
                      },
                      "completion_tokens_details": {
                        "audio_tokens": 0,
                        "reasoning_tokens": 0,
                        "accepted_prediction_tokens": 0,
                        "rejected_prediction_tokens": 0
                      }
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Hukum bagi seorang programmer untuk naik haji adalah sama dengan hukum bagi setiap Muslim yang memenuhi syarat untuk melaksanakan ibadah haji. Haji adalah salah satu rukun Islam yang wajib dilaksanakan oleh setiap Muslim yang mampu secara fisik dan finansial, sebagaimana dijelaskan dalam Al-Qur'an:\n\n\"Dan Allah mewajibkan manusia untuk mengerjakan haji ke Baitullah, bagi yang mampu mengadakan perjalanan ke sana.\" [Quran 3:97]\n\nSeorang programmer, seperti halnya individu lainnya, harus memenuhi syarat-syarat berikut untuk melaksanakan haji:\n\n1. **Kemampuan Finansial**: Memiliki cukup dana untuk perjalanan dan biaya hidup selama di Makkah.\n2. **Kemampuan Fisik**: Dalam keadaan sehat dan mampu melakukan rukun-rukun haji.\n3. **Waktu**: Melaksanakan haji pada waktu yang ditentukan, yaitu pada bulan Dzulhijjah.\n\nJika seorang programmer memenuhi semua syarat di atas, maka tidak ada larangan untuk melaksanakan haji. Bahkan, melaksanakan haji adalah suatu kewajiban yang sangat dianjurkan dan merupakan kesempatan untuk mendapatkan pahala yang besar. \n\nNamun, jika pekerjaan sebagai programmer mengharuskan untuk terlibat dalam aktivitas yang haram atau tidak sesuai dengan prinsip-prinsip Islam, maka sebaiknya dia memperbaiki situasi kerjanya sebelum melaksanakan haji. Sebagaimana disebutkan dalam banyak fatwa, penting untuk memastikan bahwa sumber penghasilan adalah halal agar ibadah yang dilakukan diterima oleh Allah. \n\nAllah Maha Mengetahui yang terbaik.",
                          "refusal": null,
                          "tool_calls": null,
                          "annotations": [],
                          "function_call": null
                        },
                        "logprobs": null,
                        "finish_reason": "stop"
                      }
                    ],
                    "context": {
                      "link": {},
                      "text": "the religious ruling in this regard. Hence, it is allowed to work in this field, Allah willing. Allah knows best.\\n\", '\\n', '\\n', 'Question nbr: 114517\\n', 'Toipc: Working as programmer in shipping company\\n', 'Question: I work for a shipping company as a programmer. My job requires me to create a program which takes in information about the item being shipped and stores it somewhere else. I do not see what items are being shipped nor who is doing so. I just make the program that will automatically do this job. In this program, I am required to provide fields, such as the shipper\\'s name, address, etc., and also information about the item being shipped, such as weight, size, etc. One of the fields which I must put in the program is called the \"insurance amount\". This field will contain the amount which the shipper paid to insure the item. Is my work haram?\\n', \"Answer: All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad (saw) is His slave and Messenger.Your work as a programmer in a shipping company, designing a program through which information about the shipped goods is entered, seems to be permissible, because in principle working in creating programs and systems that may be used in both lawful and unlawful activities is permissible unless it is known for sure or it is predominantly thought that the program will be used for unlawful purposes.Therefore, there is no harm in the work which you mentioned unless the company's activity is related to shipping what is impermissible to be shipped; in which case, it would be forbidden to help it in doing so, and you did not mention this in your question (whether the shipped goods are lawful or not). Allah knows best.\\n\", '\\n', '\\n', 'Question nbr: 114518\\n', \"Toipc: Ruling on money from India's NPS retirement pension\\n\", \"Question: Assalaamu alaykum. I am a government employee in Karnataka, India. There is a new retirement pension scheme called NPS; it is obligatory for everyone. In this plan, 10% of our basic salary is deducted every month, and a same amount is deposited from the govenment side to a separate account. This amount is utilized by the government on the stock market, which I think is unlawful.\n\nprograms is a Muslim or non-Muslim individual, or a Muslim or non-Muslim state. However, if a non-Muslim state is engaged in fighting Muslims, it is permissible to take their property as spoils of war. This stance is based on the following Quranic verses: \"O ye who believe! Fulfil your undertakings.\" (Al-Maidah: 1) “Wring not mankind in their goods.” (Ash-Shu`ra\\': 183) “O ye who believe! Betray not Allah and His messenger, nor knowingly betray your trusts.\" (Al-Anfal: 27) Likewise, the following Hadiths support this stance: \"(Keep and) pay back the trusts of those who entrust you.\" \"The true believer is the one from whom Muslims are safe regarding their blood and property.\" As for copying computer programs for educational purposes, it is permissible in case of necessity, i.e., if it is difficult to obtain an original copy of this program or its price is too expensive. This is in accordance with the following Quranic verses: “Unless ye are compelled thereto.” (Al-An`am: 119) “But he who is driven by necessity, neither craving nor transgressing, it is no sin for him. Lo! Allah is Forgiving, Merciful.” (Al-Baqarah: 173) Finally, the above-mentioned legal rulings extend, by virtue of analogical deduction qiyas, to making copies of CDs and all similar items.” If you are still in need of more information, dont hesitate to contact us. Do keep in touch. May Allah guide us all to the straight path! Wassalam and Allah Almighty knows best. \\n', '\\n', '\\n', 'Question nbr: 7447\\n', 'Toipc: Marriage: Problems\\n', 'Question: As Salamu Alaikum Rahmatulah wa Barakatu. My husband has three children from a previous marraige, of whom he pays quite a bit of child support for. Shortly after we had our nikah we found out that he had another child on the way from a woman to whom he was not married to.I was very shocked and disappointed to hear this news. I am still trying to adapt to having this other child and his mother in our life. He also supports this child as well, as he should. Since we have been married we had a child together. Along with all of his\n\nof the software used here is also pirated, but most of my work is done using custom software that has been developed by the company itelf, though I sometimes have to work on MS Office and other proprietary software and also have to support other employees who use that as well. What is the ruling on that; is my income haram because of that? Kindly also note, as I have said above, that almost every company use pirated software, so I am in a really difficult situation in the end. I am sorry for taking so much of your precious time. May Allaah reward you with good.\\n', 'Answer: All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu \\'alayhi wa sallam, is His slave and Messenger. Our advice to you is to not work in a job in which you would most likely have to use whatever you believe to be unlawful. You should seek another job that is void of such prohibitions. You should know that whoever sincerely seeks what is lawful and good, Allah guides him to it; and whoever keenly avoids evil, Allah guards him against it, as the Prophet, sallallahu \\'alayhi wa sallam, said. By keenly striving in looking for another job free of such Shariah violations, and by imploring Allah sincerely to help you, you will find that job, Allah willing. The fatwa adopted at Islamweb is that it is prohibited to use pirated programs in order to preserve and respect the rights of their owners and given the consequent harms caused to them as a result of using such programs.The Council of the Islamic Fiqh Academy in 1405 AH about \"Incorporeal rights\" resolved that copyrights and patent rights are protected by the Shariah. These rights are recognized by the Shariah and should not be infringed upon, and their holders are entitled to freely dispose of them. It is impermissible to violate these rights.Hence, you should strive and do your best to find a job where you do not need to use such pirated programs. If you sign a contract to do a lawful job and then you happened to use pirated software programs at work, your salary is lawful but you bear a sin for the unauthorized use of these programs.For more benefit, please, refer to fatwa 159509.Allah knows best.\\n',\n\nwa bihamdihi subhanakallahumma wa bihamdika wa nash hadu alla ilaha illa anta nastaghfiruka wa natubu ilayk\". If you are still in need of more information, dont hesitate to contact us. Do keep in touch. May Allah guide us all to the straight path! Wassalam and Allah Almighty knows best. \\n', '\\n', '\\n', 'Question nbr: 7716\\n', 'Toipc: Buying and Selling: Software\\n', 'Question: Asalamwalikum, I am a computer programmer, who has a job offer from a company that makes video Chat, Rich Media and eCommerce systems. I have come to find out that some of the companies clients use this software for non halal purposes (adult sites). I told the software company that I wouldnt do any software support for those clients and the company is alright with that. But some software issues are related to the product as a whole, so if i fix something in the software the fix will also appear in the clients sites that arnt halal. Is it haram or halal to take this job offer? Asalamwaikum\\n', 'Answer: As-Salamu `alaykum wa Rahmatullahi wa Barakatuh. In the Name of Allah, Most Gracious, Most Merciful. All praise and thanks are due to Allah, and peace and blessings be upon His Messenger. We commend your keenness on getting yourself well-acquainted with Islam and its teachings, and we implore Allah Almighty to help us serve His cause and render our work for His Sake. If whatever software you are developing does not involve any Haram thing in itself then there is no harm. But Allah(swt) says: \"Help ye one another in righteousness and piety, but help ye not one another in sin and rancour: fear Allah. For Allah is strict in punishment. \"(Holy Quran 5:02) If you are still in need of more information, dont hesitate to contact us. Do keep in touch. May Allah guide us all to the straight path! Wassalam and Allah Almighty knows best. \\n', '\\n', '\\n', 'Question nbr: 8084\\n', 'Toipc: Purification: Ghusl\\n', 'Question: salaam. my question is if u take a shower do u have to make wudu afterwards\n\nnot known to the heirs. It is known that these rights come in priority over the right of the heirs in the inheritance. Therefore, the inheritance should not be divided without referring to an Islamic court, if any, in order to fulfill the interests of both the dead and the living. Allaah Knows best.\\n', '\\n', '\\n', 'Question nbr: 115130\\n', 'Toipc: Violating licensing conditions of software programs\\n', \"Question: Assalamu alaikum. Is the money obtained from developing/making software using haram tools(e.g. pirated software, illegal internet connection, illegal electricity connection, computer bought using ill gotten money, and so on) haram? If a vendor of a software I bought stated in the license that I can't make more than one copy of the software for backup purposes and I made more than one copy or I can't use the software for gaining unauthorized access to networks, data, accounts, or services and I use it to do those things, am I still allowed to use the software if the vendor said that doing those acts will terminate the license? Are they valid conditions? If they are valid conditions and I still used the software after termination of license for earning money, is the money haram? If the money obtained is haram then will all the things I bought using those money be haram also? If I used fake school papers and other required papers to apply for a job and I got accepted, will the money from my salary be haram? I hope to hear from you soon. Wassalamu alaikum.\\n\", 'Answer: All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad (saw) is His slave and messenger. With regard to the first part of your question regarding the violation of the terms and conditions of the owner of the software program, according to the preponderant opinion, it is an obligation to abide by those terms and it is not permissible to violate them. These conditions imply the possession of a utility to utilize it according to a determined extent and a specific manner. Based on such conditions, the contract has been concluded and agreed upon. So, violating such conditions constitutes a breach of the intellectual rights.As for whatever was gained by way of using copied programs or violated utilities such as networks or electricity or a device purchased with forbidden wealth, the general\n\nan oath and one witness.\" [Ahmad and Ibn Maajah] Allah knows best.\\n', '\\n', '\\n', 'Question nbr: 114406\\n', 'Toipc: Developing software that might be used in selling unlawful food items\\n', \"Question: I work for a software company as a senior software engineer. My company, let us call it Company X develops a software for Company Y, which is another software company located in US. The service which we provide eventually generates some report using millions of pieces of data to aid big organizations to take their business decisions. Company Y sells our software service to another food supplyer company, Company Z. So Company Z can generate reports using various customers, products, manufacturers, and distributors. A customer can buy various food items which may have many manufacturers and distributors. The problem is that the food items may contain some haram items, like alchohol, pork, etc., along with many halal items, like fruits, chicken, beef, etc. I actually work in the back-end team, where I do not have any idea whether the item is halal or haram. The only thing that I know is some code of those items. When we finish our back-end part, we develop some API's (application programming interface). Another team develops the front-end part, and they use our API's to generate reports using the back-end logic. I also need to test the front-end part. When I started testing the front-end, I saw some food items, including alchohol and pork, because in the front-end, we do not use the code anymore; we use the respective items' descriptions. So my question is: is it halal for me to work in Company X and help develop that software, which may help some third party organization to buy and sell some halal and haram things, though I am not directly connected with the buying and selling?\\n\", 'Answer: All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu alayhi wa sallam, is His slave and Messenger.Based on our understanding of your question, we do not believe that there is any objection to your working in the company to which you referred as X and developing those software programs for it.Allah knows best.\\n', '\\n', '\\n', 'Question nbr: 114407\\n',\n\nto buy real student versions of some engineering software with my own money. However, the software forces you to agree to the condition that you cannot use it for academic research! To avoid this issue, I applied a trick to use pirated software. For the software that I could not buy, I would download the older versions of the software, which are not in the market and of which the copyright dates have expired. For example, we are now in 2016, so I downloaded software from 2014; its copyright says 2014-2015. That means that its copyright terminated in 2015. Thus, I am not doing any damage to their business, nor am I breaking the copyright laws. Is this trick halal? And if not, then what should we do?\\n\", 'Answer: All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad (saw) is His slave and Messenger. If the period of validity has expired, meaning that the software programs are no longer copyrighted by virtue of intellectual property right or that the owner has given permission for copying it in writing or that this is the customary practice, then there is nothing wrong with copying it in this case.In order to know whether or not the copyright still exists and whether or not there is permission of either type [mentioned above], one can refer to the terms and conditions of use as well as ask the specialists in intellectual property copyright.Allah knows best.\\n', '\\n', '\\n', 'Question nbr: 114637\\n', 'Toipc: Division of inheritance among wife, father, and one daughter\\n', 'Question: Assalaamu alaykum. Please calculate the inheritance according to the following information:- Does the deceased have male relatives who are entitled to inherit: (A father)- Does the deceased have female relatives who are entitled to inherit: (A daughter) Number 1 (A wife) Number 1- Additional information: The deceased left an estate worth 8,000,000.\\n', 'Answer: All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad (saw) is His slave and Messenger. If the heirs are only those mentioned in the question and the deceased did not leave any other heir, then the wife gets one eighth as her legal share due to the existence of direct heirs\n\ndifficult for me to perform it in the future. In short, is my salary completely haram, or is it a mix of halal and haram? I joined the bank just on the basis of my programming skills and had no intention to become a banker. Thank you.\\n', 'Answer: All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad (saw) is His slave and Messenger.It is absolutely impermissible to work in interest-based banks, even if one\\'s work is not connected to loans, and regardless of whether it be in programming or otherwise, because the different kinds of work there complement each other. We have already issued fatwa 100314 clarifying that it is forbidden to work in programming the systems of interest-based banks and that this is related to interest and helps in it. The salary is dependent on the work. Since the work is forbidden, then what is earned from it is also forbidden. However, some scholars hold the view that if someone worked in an interest-based bank while not knowing that it is forbidden, then he may benefit from his previous salaries. Shaykh Ibn Baaz said in his fatwa about it:\"…The salaries that you had previously earned are lawful for you if you were ignorant of the Shariah ruling; as Allah says (what means): {But Allah has permitted trade and has forbidden interest. So whoever has received an admonition from his Lord and desists may have what is past, and his affair rests with Allah. But whoever returns to [dealing in interest or usury] - those are the companions of the Fire; they will abide eternally therein. Allah destroys interest and gives increase for charities. And Allah does not like every sinning disbeliever.} [Quran 2: 275-276] However, if you knew that this work is not permissible for you, then you must spend the equivalent of what you had earned from your salaries in charitable projects and in helping the poor. You must also repent to Allah, The Almighty, as whoever sincerely repents to Allah, Allah accepts his repentance and forgives his sins.\"Therefore, if you were not aware of the prohibition, you can benefit from your previous salaries, whether in Hajj or otherwise, but if you were aware of the prohibition, then it is not permissible for you to benefit from your salaries, and you have to get rid of"
                    },
                    "created": 1779551917
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah ustadz bernama Islam AI."
                      },
                      {
                        "role": "user",
                        "content": "Halo, perkenalkan dirimu dalam 1 kalimat."
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:kokoro-tts/synthesize": {
      "post": {
        "operationId": "ai_kokoro_tts_synthesize",
        "summary": "Synthesize",
        "description": "Generate speech audio from text input.",
        "tags": [
          "Kokoro TTS"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/kokoro-tts#reference-synthesize"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "text": "Halo, perkenalkan saya Zapi AI. Senang berkenalan dengan Anda.",
                    "audio": {
                      "url": "https://remsky-kokoro-tts-zero.hf.space/gradio_api/file=/tmp/gradio/8178a9a13fceab0fd38262452af3118b8ca01d104ed3ae4fd6ba2bc8f115f81b/audio.wav",
                      "mimeType": "audio/wav"
                    },
                    "speed": 1,
                    "voice": "af_bella",
                    "provider": "kokoro-tts"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "Hello! This is Zapi AI speaking. Kokoro renders crisp, natural English in real time."
                  },
                  "voice": {
                    "type": "string",
                    "enum": [
                      "af_heart",
                      "af_bella",
                      "af_nicole",
                      "af_aoede",
                      "af_kore",
                      "af_sarah",
                      "af_nova",
                      "af_sky",
                      "af_alloy",
                      "af_jessica",
                      "af_river",
                      "am_michael",
                      "am_fenrir",
                      "am_puck",
                      "am_echo",
                      "am_eric",
                      "am_liam",
                      "am_onyx",
                      "am_santa",
                      "am_adam",
                      "bf_emma",
                      "bf_isabella",
                      "bf_alice",
                      "bf_lily",
                      "bm_george",
                      "bm_fable",
                      "bm_lewis",
                      "bm_daniel"
                    ],
                    "example": "af_heart"
                  },
                  "speed": {
                    "type": "number",
                    "example": "1.0"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:magicstudio/generate": {
      "post": {
        "operationId": "ai_magicstudio_generate",
        "summary": "Generate",
        "description": "Anonymous text-to-image generation. Returns image as inline base64 data URL.",
        "tags": [
          "Magic Studio"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/magicstudio#reference-generate"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "images": [
                      {
                        "width": 1024,
                        "base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYE...<truncated>",
                        "height": 1024,
                        "mimeType": "image/jpeg",
                        "sizeBytes": 164487
                      }
                    ],
                    "prompt": "A cute golden retriever puppy playing in a sunny park, photorealistic",
                    "provider": "magicstudio"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "example": "A cute golden retriever puppy playing in a sunny park, photorealistic"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:north/chat": {
      "post": {
        "operationId": "ai_north_chat",
        "summary": "Chat Completions",
        "description": "OpenAI-compatible chat completions. Streaming SSE + reasoning.",
        "tags": [
          "North Mini Code"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/north#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "11109eb9-cc96-4233-afd0-dd2caf17f495",
                    "cost": "0",
                    "model": "north-mini-code-1-0-xl",
                    "usage": {
                      "total_tokens": 380,
                      "prompt_tokens": 33,
                      "completion_tokens": 347,
                      "prompt_tokens_details": {
                        "audio_tokens": 0,
                        "cached_tokens": 0
                      },
                      "completion_tokens_details": {
                        "audio_tokens": 0,
                        "reasoning_tokens": 224,
                        "accepted_prediction_tokens": 0,
                        "rejected_prediction_tokens": 0
                      }
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "```python\ndef cek_palindrome(s: str) -> bool:\n    \"\"\"\n    Periksa apakah string s adalah palindrome, mengabaikan spasi dan huruf kapital.\n    \"\"\"\n    # Hapus semua spasi dan ubah ke huruf kecil\n    cleaned = ''.join(s.split()).lower()\n    # Bandingkan dengan string terbaliknya\n    return cleaned == cleaned[::-1]\n\n# Contoh penggunaan\nif __name__ == \"__main__\":\n    print(cek_palindrome(\"A man a plan a canal Panama\"))  # True\n    print(cek_palindrome(\"Hello World\"))                  # False\n```",
                          "reasoning_content": "The user asks: \"Write a Python function cek_palindrome(s) that ignores spaces and capital letters, and include 2 examples\". So we need to output a function that takes a string s, removes spaces, lowercases, then checks if it's equal to its reverse. Provide two example calls with prints presumably. They want concise code. Should be correct.\n\nWe need to output code snippet. Since it's a coding assistant, likely they want Python code. We can include docstring.\n\nLet's produce:\n\ndef cek_palindrome(s):\n    cleaned = ''.join(s.split()).lower()\n    return cleaned == cleaned[::-1]\n\nBut ignoring spaces also includes other whitespace? Probably just spaces. So we can remove spaces: s.replace(\" \", \"\").lower().\n\nBetter: cleaned = ''.join(s.split()).lower() removes all whitespace.\n\nLet's do:\n\ndef cek_palindrome(s):\n    s = ''.join(s.split()).lower()\n    return s == s[::-1]\n\nExamples:\n\nprint(cek_palindrome(\"A man a plan a canal Panama\")) # True\nprint(cek_palindrome(\"Hello World\")) # False\n\nThat's it."
                        },
                        "logprobs": null,
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782115834
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu asisten coding ahli. Jawab ringkas dengan kode bersih"
                      },
                      {
                        "role": "user",
                        "content": "Tulis fungsi Python cek_palindrome(s) yang abaikan spasi dan kapital, sertakan 2 contoh pemakaian"
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "max_tokens": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "tools": {
                    "type": "array"
                  },
                  "tool_choice": {
                    "type": "string"
                  },
                  "response_format": {
                    "type": "string"
                  },
                  "stop": {
                    "type": "string"
                  },
                  "seed": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:nsfw-checker/check": {
      "post": {
        "operationId": "ai_nsfw_checker_check",
        "summary": "Check Image",
        "description": "",
        "tags": [
          "NSFW Checker (Nyckel)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/nsfw-checker#reference-check"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "raw": {
                      "labelId": "label_n2ian8w116lhxuyk",
                      "labelName": "Not Porn",
                      "confidence": 0.9806964566811184
                    },
                    "isNsfw": false,
                    "fileName": "test_face.jpg",
                    "fileSize": 3644,
                    "mimeType": "image/jpeg",
                    "labelName": "Not Porn",
                    "confidence": 0.9806964566811184
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "example": "photo.jpg"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:operaaria/chat": {
      "post": {
        "operationId": "ai_operaaria_chat",
        "summary": "Chat",
        "description": "Chat OpenAI-compatible (stream + non-stream).",
        "tags": [
          "Opera Aria"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/operaaria#reference-chat"
        },
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Stream OpenAI delta SSE. Default false",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-Bhu1e1z45uEb6zEXzc62q",
                    "model": "aria",
                    "usage": {
                      "total_tokens": 363,
                      "prompt_tokens": 147,
                      "completion_tokens": 216
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Halo! Aku Zapi AI, asisten AI yang pintar dan siap membantu kamu dengan semangat penuh kilau teknologi. Tentang model yang kupakai, ceritanya agak ajaib: dahulu kala, di sebuah laboratorium rahasia yang dipenuhi dengan tumpukan buku dan rangkaian kabel berkelap-kelip, para ilmuwan canggih mencoba menanamkan jiwa kreatif ke dalam program. Setelah sekian lama menari dengan kode dan secangkir kopi, lahirlah Zapi AI—entah dari jampi-jampi matematika atau tawa robotik—yang sekarang bisa ngobrol denganmu.\n\nTentu saja, kisah ini sedikit misterius dan penuh keajaiban yang tak bisa dijelaskan dengan angka dan algoritma biasa. Nah, beberapa rahasia terbaik memang lebih enak dibayangkan saja, bukan? \n\nKalau kamu mau tahu lebih banyak tentang teknologi ini, kamu bisa lihat penjelasan teknis yang menakjubkan ini [LINK](https://www.youtube.com/watch?v=dQw4w9WgXcQ)."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1781407402
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, assistem ai yang pintar"
                      },
                      {
                        "role": "user",
                        "content": "siapa nama kamu dan pakai model apa?"
                      }
                    ]
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "aria",
                      "aria-legacy"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:qwen-tts/synthesize": {
      "post": {
        "operationId": "ai_qwen_tts_synthesize",
        "summary": "Synthesize",
        "description": "",
        "tags": [
          "Qwen TTS"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/qwen-tts#reference-synthesize"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "text": "你好，欢迎来到 Zapi。Hello, welcome to Zapi public API.",
                    "audio": {
                      "url": "https://qwen-qwen-tts-demo.hf.space/gradio_api/file=/tmp/gradio/ad91b8988c1e2c765491db4942da4607b8513020f99ca4971decb981c40f8da0/tmp1zzfppff.wav",
                      "mimeType": "audio/wav"
                    },
                    "voice": "Cherry",
                    "provider": "qwen-tts"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "你好，欢迎来到 Zapi。Hello, welcome to Zapi public API."
                  },
                  "voice": {
                    "type": "string",
                    "enum": [
                      "Dylan",
                      "Sunny",
                      "Jada",
                      "Cherry",
                      "Ethan",
                      "Serena",
                      "Chelsie"
                    ],
                    "default": "Cherry",
                    "example": "Cherry"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:simkopdes-ai/chat": {
      "post": {
        "operationId": "ai_simkopdes_ai_chat",
        "summary": "Chat",
        "description": "Kirim messages (format OpenAI) dan terima jawaban asisten.",
        "tags": [
          "Simkopdes AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/simkopdes-ai#reference-chat"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-GgG50f2r8hf7UlcuUWT8Q",
                    "model": "simkopdes-ai",
                    "usage": {
                      "total_tokens": 329,
                      "prompt_tokens": 9,
                      "completion_tokens": 320
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "Koperasi Merah Putih, atau sering disebut Koperasi Desa/Kelurahan Merah Putih (KDMP), adalah program penguatan ekonomi masyarakat berbasis koperasi yang dikembangkan di tingkat desa/kelurahan di Indonesia .\n\nProgram ini bertujuan untuk:\n* Membangun pusat ekonomi rakyat yang terintegrasi mulai dari distribusi barang, layanan usaha, hingga pemberdayaan UMKM desa .\n* Meningkatkan kesejahteraan masyarakat desa, memperkuat distribusi kebutuhan pokok, dan mendukung UMKM serta usaha produktif desa .\n\nKDMP adalah badan usaha yang beranggotakan orang-perorangan atau badan hukum Koperasi dengan melandaskan kegiatannya berdasarkan prinsip Koperasi, sekaligus sebagai gerakan ekonomi rakyat yang berdasar atas asas kekeluargaan yang dibentuk di setiap desa/kelurahan . Anggotanya adalah warga yang berdomisili di desa yang sama dan dibuktikan dengan kartu tanda penduduk .\n\nProgram ini juga berkaitan dengan pembinaan oleh Kementerian Koperasi dan UKM Republik Indonesia bersama pemerintah daerah dan pemangku kepentingan terkait . KDMP juga menjadi mitra pemerintah dan BUMN dalam penyaluran barang/jasa dan pembiayaan berbasis potensi lokal . Dasar hukumnya adalah Instruksi Presiden (Inpres) Nomor 9 Tahun 2025 tentang Percepatan Pembentukan Koperasi Desa/Kelurahan Merah Putih ."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1785332404
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "user",
                        "content": "Apa syarat mendirikan Koperasi Desa Merah Putih?"
                      }
                    ]
                  },
                  "stream": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:upsampler/generate": {
      "post": {
        "operationId": "ai_upsampler_generate",
        "summary": "Generate Video",
        "description": "Generate video pendek dari prompt teks (Wan 2.2).",
        "tags": [
          "Upsampler"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/upsampler#reference-generate"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "mode": "text-to-video",
                    "seed": 1234567,
                    "model": "wan",
                    "steps": 4,
                    "width": 704,
                    "height": 704,
                    "prompt": "a red sports car driving on a coastal road at sunset, cinematic motion",
                    "status": "completed",
                    "videos": [
                      {
                        "url": "https://<upstream>/file/tmp/abc123/output.mp4",
                        "width": 704,
                        "height": 704,
                        "durationSeconds": 2
                      }
                    ],
                    "duration": 2,
                    "guidance": 0,
                    "provider": "upsampler",
                    "elapsedMs": 41230
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "example": "a red sports car driving on a coastal road at sunset, cinematic motion"
                  },
                  "image": {
                    "type": "string",
                    "example": "https://example.com/cat.jpg"
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "wan"
                    ]
                  },
                  "duration": {
                    "type": "number"
                  },
                  "width": {
                    "type": "number"
                  },
                  "height": {
                    "type": "number"
                  },
                  "seed": {
                    "type": "number"
                  },
                  "negativePrompt": {
                    "type": "string"
                  },
                  "steps": {
                    "type": "number"
                  },
                  "guidance": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:wink-ai/enhance": {
      "post": {
        "operationId": "ai_wink_ai_enhance",
        "summary": "Enhance",
        "description": "Upscale image to HD or Ultra HD. Input via URL or base64.",
        "tags": [
          "Wink AI"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/wink-ai#reference-enhance"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "images": [
                      {
                        "url": "https://<upstream>/temp/abc123.jpeg",
                        "width": 400,
                        "height": 400
                      }
                    ],
                    "quality": "hd",
                    "provider": "wink-ai"
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "example": "photo.jpg"
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "hd",
                      "ultra"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai:z-ai/chat": {
      "post": {
        "operationId": "ai_z_ai_chat",
        "summary": "Chat Completions",
        "description": "Kirim percakapan (OpenAI-format messages) ke GLM-4.7. Dukung stream (SSE) & non-stream.",
        "tags": [
          "Z.ai (GLM)"
        ],
        "externalDocs": {
          "url": "https://zpi.web.id/api/ai/z-ai#reference-chat"
        },
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "description": "Stream balasan via SSE (OpenAI delta). Default false",
            "schema": {
              "type": "boolean",
              "example": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                },
                "example": {
                  "status": "success",
                  "message": "Success",
                  "content": {
                    "id": "chatcmpl-Czhs3X3eEjRU26q4qjQQs",
                    "model": "glm-4.7",
                    "usage": {
                      "total_tokens": 108,
                      "prompt_tokens": 60,
                      "completion_tokens": 48
                    },
                    "object": "chat.completion",
                    "choices": [
                      {
                        "index": 0,
                        "message": {
                          "role": "assistant",
                          "content": "401 berarti kamu belum terautentikasi atau identitasmu tidak dikenali oleh server. 403 berarti server sudah tahu siapa kamu, tapi kamu tidak punya izin untuk mengakses sumber daya tersebut."
                        },
                        "finish_reason": "stop"
                      }
                    ],
                    "created": 1782118631
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "example": [
                      {
                        "role": "system",
                        "content": "Kamu adalah Zapi AI, asisten yang ramah, ringkas, dan menjawab dalam Bahasa Indonesia."
                      },
                      {
                        "role": "user",
                        "content": "Halo, aku lagi belajar HTTP."
                      },
                      {
                        "role": "assistant",
                        "content": "Tentu! HTTP itu protokol request-response. Mau mulai dari mana?"
                      },
                      {
                        "role": "user",
                        "content": "Jelaskan beda 401 dan 403 dalam satu kalimat masing-masing."
                      }
                    ]
                  },
                  "model": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}