OpenAI-Compatible
Welcome to the OpenAI-Compatible API documentation. This guide will help developers integrate with our API seamlessly. It replicates OpenAI’s functionality while providing additional features like mixTuningId
for enhanced customization.
Authentication
Headers
Two headers are required for authentication:
-
apikey
- Description: Your unique API key to access the endpoint. This key is specific to your organization or project and can be found in your Humiris dashboard Here.
-
mixTuningId
- Description: The unique identifier for your MixTuning configuration (Mix Model).
Endpoint: Chat Completions
URL
Base URL : https://moai-service-app.humiris.ai/api/v1
POST /chat/completions
Description
Use this endpoint to send a chat completion request. This is similar to OpenAI’s chat/completions
endpoint, with added functionality for custom tuning.
Headers
Header | Type | Required | Description |
---|---|---|---|
apikey | string | Yes | Your API key. |
mixTuningId | string | Yes | The MixTuning ID for personalized AI responses. |
Body
The request body follows OpenAI’s chat/completions
format.
Request Body Example
Fiels | Type | Required | Description |
---|---|---|---|
messages | string | Yes | Array of message objects, each with role and content. |
model | string | Yes | The model to use. Example: Humiris/humiris-moai |
Response
Error
Status Code | Error | Description |
---|---|---|
400 | BadRequest | The mixTuningId header is missing. |
404 | MixTuningNotFound | The provided mixTuningId does not exist. |
401 | Unauthorized | Invalid or missing apikey. |
Integration Examples
JavaScript Here’s how to integrate the API using the fetch method in JavaScript:
Python Here’s how to integrate the API using the request method in Python:
Support For any questions or issues, please contact Hilario Houmey at h.hilario@humiris.ai.