Skip to main content
Cheap’ai provides a unified API that gives you access to multiple open sources AI models through a single endpoint, while automatically handling fallbacks and selecting the most cost-effective options. Get started with just a few lines of code using your preferred SDK or framework.

Go to our Dashboard

Go to our dashboard at https://console.buycheap.ai/, sign up and create an API Key.

Using the OpenAI SDK

import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://api.buycheap.ai/avocado',
  apiKey: '<API_KEY>'
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: 'deepseek/deepseek-chat-v3-0324',
    messages: [
      {
        role: 'user',
        content: 'Who is Joseph Stalin?',
      },
    ],
  });

  console.log(completion.choices[0].message);
}

main();
from openai import OpenAI

client = OpenAI(
  base_url="https://api.buycheap.ai/avocado",
  api_key="<API_KEY>",
)

completion = client.chat.completions.create(
  model="deepseek/deepseek-chat-v3-0324",
  messages=[
    {
      "role": "user",
      "content": "Who is Joseph Stalin?"
    }
  ]
)

print(completion.choices[0].message.content)