← Blog

Switch from OpenAI to Daylite in 30 Seconds

March 21, 2026 · 4 min read

Daylite's API is fully compatible with the OpenAI SDK. If you're currently using OpenAI, Together AI, Fireworks, or any OpenAI-compatible provider, switching takes exactly two lines of code.

From OpenAI

Before:

from openai import OpenAI
client = OpenAI()  # uses OPENAI_API_KEY

After:

from openai import OpenAI
client = OpenAI(
    base_url="https://api.daylite.ai/v1",
    api_key="YOUR_DAYLITE_KEY",
)

That's it. Everything else stays the same — client.chat.completions.create(), streaming, function calling, all work identically.

From Together AI

# Before
client = OpenAI(
    base_url="https://api.together.xyz/v1",
    api_key="TOGETHER_KEY",
)

# After
client = OpenAI(
    base_url="https://api.daylite.ai/v1",
    api_key="DAYLITE_KEY",
)

From Fireworks

# Before
client = OpenAI(
    base_url="https://api.fireworks.ai/inference/v1",
    api_key="FIREWORKS_KEY",
)

# After — same pattern
client = OpenAI(
    base_url="https://api.daylite.ai/v1",
    api_key="DAYLITE_KEY",
)

JavaScript / TypeScript

// Before (OpenAI)
const client = new OpenAI();

// After (Daylite)
const client = new OpenAI({
  baseURL: "https://api.daylite.ai/v1",
  apiKey: "YOUR_DAYLITE_KEY",
});

Using LiteLLM

If you use LiteLLM for multi-provider routing:

import litellm

response = litellm.completion(
    model="openai/llama-3.1-70b",
    messages=[{"role": "user", "content": "Hello"}],
    api_base="https://api.daylite.ai/v1",
    api_key="YOUR_DAYLITE_KEY",
)

Environment Variables

For apps that read config from env vars:

# .env
OPENAI_BASE_URL=https://api.daylite.ai/v1
OPENAI_API_KEY=dl-your-api-key

Many frameworks (LangChain, LlamaIndex, CrewAI) read OPENAI_BASE_URL automatically. Set it once and all your inference routes through Daylite.

Model Mapping

You usedUse on Daylite
meta-llama/Llama-3.1-70B-Instructllama-3.1-70b
meta-llama/Llama-3.1-8B-Instructllama-3.1-8b
deepseek-ai/DeepSeek-V3deepseek-v3

What About Function Calling?

Daylite supports the same tools and tool_choice parameters as OpenAI. If your current code uses function calling, it works on Daylite without changes.

Get Started

Free API key at daylite.ai/dashboard. 100K tokens/month free. Takes 30 seconds to switch. Try the playground first if you want to test before committing.