Skip to content

API Reference

Welcome to the Perlica API reference. The API provides a proxy to standard AI endpoints with secure server-side credential management.

Base URL: https://api.perlica.my.id

Endpoints

1. Root Endpoint

Check the health and status of the API.

  • Method: GET
  • Path: /v1

Response (200 OK)

json
{
  "message": "Nihao"
}

2. Chat Completions

Create a chat completion request, which proxies to the configured AI service.

  • Method: POST
  • Path: /v1/chat/completions

Headers

  • Content-Type: application/json

Body Follows the standard Chat Completions API format. For example:

json
{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}

3. List Models

List all available models from the configured AI service.

  • Method: GET
  • Path: /v1/models

Response Returns the standard models list response format.

json
{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1715368132,
      "owned_by": "system"
    }
  ]
}