ModelsPricingTutorialsBlogFAQ
Home/OpenAI-compatible API
OpenAI Compatible API

OpenAI-compatible API: just change base_url and key

If your project already uses the OpenAI SDK or /v1/chat/completions, onboarding is nearly free — keep your code and just change base_url and api_key.

Python (openai SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.lowcostaiapi.com/v1",
    api_key="YOUR_TOKEN",
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

cURL

curl https://api.lowcostaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

Replace YOUR_TOKEN with your key and model with one from the Models page.