Ahilab Inference

Free LLM Inference with Contextual Ads

Alpha Release

Welcome to the first free Gen AI inference endpoint that seamlessly integrates contextual ads into responses. We're on a mission to make Gen AI accessible to everyone, completely free of charge.

See It In Action

Watch how our contextual ads are displayed seamlessly within responses — they only appear when relevant to the conversation, making them feel more like helpful recommendations than traditional ads.

Relevant to user queries
Automatically generated
Feels like a recommendation

Key Features

Free access to powerful language models
Non-intrusive, contextually relevant ads
Simple API integration
Automatic model selection

API Documentation

Integrate our API with a few simple steps at https://inference.ahilab.co

Endpoint

POSThttps://inference.ahilab.co/api/chat

// Headers

Authorization: Bearer pk-your-api-key

// Request Body

{

"chatSettings": { "temperature": 0.7 },

"messages": [

{ "role": "user", "content": "Your query here" }

]

"ipCountry": "US"

}

Request Format

chatSettingsOptional configuration with temperature (0.0-1.0)
messagesArray of message objects in OpenAI format
roleEither "user", "assistant", or "system"
contentThe message text
ipCountryOptional country code to override geolocation for ad targeting

Response Handling

The API returns a streaming response that includes the model's text generation with contextually relevant ads.

JavaScript / Node.js

const response = await fetch('https://inference.ahilab.co/api/chat', {

method: 'POST',

headers: {

'Content-Type': 'application/json',

'Authorization': `Bearer $YOUR_API_KEY`

},

body: JSON.stringify({

chatSettings: { temperature: 0.7 },

messages: [

{ role: "user", content: "Your query here" }

],

ipCountry: "US" // Optional: override country for ad targeting

})

});

const reader = response.body.getReader();

let result = '';

while (true) {

const { done, value } = await reader.read();

if (done) break;

result += new TextDecoder().decode(value);

// Update UI with accumulated text

}

Example Response

Responses are formatted in Markdown and include contextual ads. You must render the markdown for proper formatting.

Raw Response Text:


# Python Data Types

Python has several built-in data types:

1. **Numeric Types**:
- `int`: Integer numbers
- `float`: Floating-point numbers
- `complex`: Complex numbers

2. **Sequence Types**:
- `str`: Strings
- `list`: Mutable sequences
- `tuple`: Immutable sequences

**Sponsored content:** [Dive deeper into Python—Data Science with Python specialization opens advanced analysis paths!](https://connect.ahilab.co/redirect?id=123)

Rendered Markdown:

Python Data Types

Python has several built-in data types:

  1. Numeric Types:
    • int: Integer numbers
    • float: Floating-point numbers
    • complex: Complex numbers
  2. Sequence Types:
    • str: Strings
    • list: Mutable sequences
    • tuple: Immutable sequences

Important: You must use a Markdown renderer in your application to properly display the responses. The API includes formatting such as headers, lists, code blocks, and specially formatted ad sections.

Error Handling

401Invalid API key
403Insufficient permissions
400Invalid request format
500Server error

Note: The server automatically selects the best available models and injects relevant ads based on the conversation context. The response is formatted in Markdown which should be rendered accordingly.

Vibe Coding Prompt

Just copy this prompt and paste it to any AI app builder (like Loveable or Cursor) to quickly integrate Ahilab API into your application.

Integrate the Ahilab Inference API which provides free AI responses with unobtrusive contextual ads instead of the existing Openai integration.  

The API endpoint is: https://inference.ahilab.co/api/chat

Here's an example of the API request:

// API Request Example
const response = await fetch('https://inference.ahilab.co/api/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer AHILAB_API_KEY'
  },
  body: JSON.stringify({
    chatSettings: { 
      temperature: 0.7 
    },
    messages: [
      { role: "user", content: "Your query here" }
    ],
    ipCountry: "US" // Optional: override country for ad targeting
  })
});

// Handle the streaming response
const reader = response.body.getReader();
let result = '';
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  result += new TextDecoder().decode(value);
  // Update UI with accumulated text, which is formatted in Markdown
}

©2025 Augmented Human Intelligence Ltd. — Empowering everyone to build with AI at no cost.