> ## Documentation Index
> Fetch the complete documentation index at: https://docs.humiris.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Hmodels OpenAI Compatible

> Integration guide for Hmodel OpenAI Compatibility with Python and JavaScript.

# Introduction

Our platform allows you to integrate our [Hmodels](https://docs.humiris.ai/Hmodels) (**baby1**, **daddy1**, **mommy1**) into your projects using OpenAI Compatibility. You can interact with these models using the official `openai` package.

## Generate an API Key

Before you start, you need to generate an API key from our platform. To do so, visit:

👉 [Generate an API Key](https://console.humiris.ai/api-keys)

## Base URL

All requests must be sent to:

```
https://api.humiris.ai/api/openai/v1
```

## Installing the OpenAI Package

If you haven't installed it yet, add the OpenAI package to your project:

**Python:**

```bash theme={null}
pip install openai
```

**JavaScript (Node.js):**

```bash theme={null}
npm install openai
```

***

# Using OpenAI Compatibility

## Sending a Request to a Model

Here is an example of how to interact with the **baby1 basic** model using Python and JavaScript.
Find an verview of all available AI models on Hmodels here 👉 [Hmodels](https://docs.humiris.ai/Hmodels).

```python theme={null}
# Python Example
import openai

openai.api_key = "your_api_key"
openai.api_base = "https://api.humiris.ai/api/openai/v1"

response = openai.ChatCompletion.create(
    model="codiris-v1-preview",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain the theory of relativity."}
    ]
)

print(response["choices"][0]["message"]["content"])
```

```javascript theme={null}
// JavaScript Example
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: "your_api_key",
  baseURL: "https://api.humiris.ai/api/openai/v1",
});

async function run() {
  const response = await openai.chat.completions.create({
    model: "daddy1",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Explain the theory of relativity." },
    ],
  });
  console.log(response.choices[0].message.content);
}
run();
```

***

## Other Useful Parameters

The API supports several options to customize the model's responses.

| Parameter     | Description                                                            |
| ------------- | ---------------------------------------------------------------------- |
| `model`       | Name of the model used (`daddy1` or `daddy1-adv`).                     |
| `messages`    | List of messages to structure the conversation.                        |
| `temperature` | Controls response creativity (0 = deterministic, 1 = highly creative). |
| `max_tokens`  | Maximum number of tokens in the response.                              |

**Example with Advanced Parameters:**

```python theme={null}
# Python Example
import os
import openai

openai.api_key = "your_api_key"
openai.api_base = "https://api.humiris.ai/api/openai/v1"
response = openai.ChatCompletion.create(
    model="daddy1",
    messages=[
        {"role": "system", "content": "You are an expert in quantum physics."},
        {"role": "user", "content": "Explain the tunnel effect."}
    ],
    temperature=0.7,
    max_tokens=200
)
```

```javascript theme={null}
// JavaScript Example
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: "your_api_key",
  baseURL: "https://api.humiris.ai/api/openai/v1",
});
const response = await openai.chat.completions.create({
  model: "daddy1",
  messages: [
    { role: "system", content: "You are an expert in quantum physics." },
    { role: "user", content: "Explain the tunnel effect." },
  ],
  temperature: 0.7,
  max_tokens: 200,
});
```

***
