Skip to main content

Introduction

APIPHON provides a REST API that allows you to interact with the gateway service programmatically. The API follows an OpenAI-compatible format, making it easy to integrate with existing tools and libraries that support the OpenAI API standard.

Base URL

The API is accessible at:
http://{host}:5000
Where {host} is either:
  • 127.0.0.1 (localhost only)
  • Your LAN IP address (when configured for network access)

Authentication

All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer UnHackerEnCapital
The default API key is UnHackerEnCapital. Make sure to keep this key secure and only share it with trusted users.

API Format Compatibility

APIPHON implements an OpenAI-style API format, specifically compatible with the /v1/chat/completions endpoint. This means you can use APITHON as a drop-in replacement for OpenAI’s API in many applications.

Available Endpoints

APIPHON currently provides one main endpoint:

Chat Completions

Send messages and receive AI-generated responses

Endpoint Summary

MethodEndpointDescription
POST/v1/chat/completionsSend chat messages and receive completions

Response Format

All successful API responses return JSON with a standard structure:
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Response text"
      }
    }
  ],
  "model": "apithon-v3"
}

Error Responses

When an error occurs, the API returns an appropriate HTTP status code along with an error message:

401 Unauthorized

Returned when the authentication token is missing or invalid:
{
  "error": "Unauthorized"
}
Common causes:
  • Missing Authorization header
  • Incorrect Bearer token
  • Malformed authentication header

Error Response Structure

Status CodeDescription
401Unauthorized - Invalid or missing API key
400Bad Request - Invalid request format
500Internal Server Error - Server-side error

Getting Started

To get started with the APITHON API:
  1. Ensure the APITHON gateway is running
  2. Note the host IP address and port (default: 5000)
  3. Use the API key: UnHackerEnCapital
  4. Make requests to /v1/chat/completions
For detailed usage instructions, see the Chat Completions documentation.

Example Request

Here’s a quick example of making a request to the API:
curl http://127.0.0.1:5000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer UnHackerEnCapital' \
  -d '{"messages": [{"role": "user", "content": "Hello!"}]}'

Next Steps

Chat Completions

Learn how to send messages and receive responses

Authentication

Understand API authentication requirements

Build docs developers (and LLMs) love