API / dg-ai

DG AI API

A totally free AI API for all — no login, no API key, no account. Powered by Cloudflare Workers, featuring 7 powerful models with no paywalls and live support at our Discord server.

WHY Why we built it

The problem: People could not access top-tier models for free without facing tedious identification formalities. Good AI APIs had aggressive paywalls.

How we solved it: We built an API on Cloudflare's Workers AI so that no one is left behind and everyone can power their applications with good LLMs.

What we offer: 7 distinct models with absolutely zero paywalls, plus live support at our Discord server.

LIM Limits

60,000
requests / day
20 / min
rate limit
7
models available

MDL Available models

DG AI offers seven different models behind one API. Hitting the base URL routes your request through a smart fallback system across all of them:

OpenAI — gpt-oss-120b Z.ai — glm-4.7-flash Meta — llama-4-scout-17b DeepSeek — r1-distill-32b Google — gemma-2-9b Qwen — qwen-1.5-14b Qwen Coder — qwen-2.5-32b

REQ Default request

Hitting the base URL (/v1/chat) routes your request through the fallback system across all 7 models:

// Example: How to connect your app to the Free AI API
async function askAI(userPrompt) {
  const API_URL = "https://dg-ai.scriptsnsenses.workers.dev/v1/chat";

  try {
    const response = await fetch(API_URL, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        messages: [
          {
            role: "system",
            content: "You are a helpful assistant."
          },
          {
            role: "user",
            content: userPrompt
          }
        ]
      })
    });

    const data = await response.json();

    // Extract the text response from the OpenAI-format JSON
    const reply = data.choices[0].message.content;
    console.log("AI Reply:", reply);
    return reply;

  } catch (error) {
    console.error("Error calling the AI API:", error);
  }
}

// Usage:
askAI("Give me a 3-word motto for a programmer.");

MDL Calling a specific model

Each model also has its own dedicated path under /v1/chat/ if you want to skip the fallback system and target one directly.

GPT-OSS (OpenAI - 120b)

// Example: Target the GPT-OSS model directly
async function askGPT(userPrompt) {
  const API_URL = "https://dg-ai.scriptsnsenses.workers.dev/v1/chat/gpt-oss";

  try {
    const response = await fetch(API_URL, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        messages: [
          { role: "system", content: "You are a helpful assistant." },
          { role: "user", content: userPrompt }
        ]
      })
    });

    const data = await response.json();
    const reply = data.choices[0].message.content;
    console.log("ChatGPT Reply:", reply);
    return reply;
  } catch (error) {
    console.error("Error calling GPT-OSS:", error);
  }
}

askGPT("Write a funny 1-line error message for a broken server connection.");

DeepSeek (r1-distill-32b)

// Example: Target the DeepSeek model directly
async function askDeepSeek(userPrompt) {
  const API_URL = "https://dg-ai.scriptsnsenses.workers.dev/v1/chat/deepseek";

  try {
    const response = await fetch(API_URL, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        messages: [
          { role: "system", content: "You are a helpful assistant." },
          { role: "user", content: userPrompt }
        ]
      })
    });

    const data = await response.json();
    const reply = data.choices[0].message.content;
    console.log("DeepSeek Reply:", reply);
    return reply;
  } catch (error) {
    console.error("Error calling DeepSeek:", error);
  }
}

askDeepSeek("Explain the concept of serverless computing in one simple sentence.");

RTE Model routes at a glance

ModelPathFormat
All Models (Fallback)/v1/chatOpenAI
GPT-OSS (120b)/v1/chat/gpt-ossOpenAI
GLM 4.7 Flash/v1/chat/glmOpenAI
Llama 4 Scout (17b)/v1/chat/llama-4-scoutOpenAI
DeepSeek R1 Distill (32b)/v1/chat/deepseekOpenAI
Gemma 2 (9b)/v1/chat/gemmaOpenAI
Qwen 1.5 (14b)/v1/chat/qwenOpenAI
Qwen 2.5 Coder (32b)/v1/chat/qwen-coderOpenAI

Note: Llama 4 Scout also supports image analysis via /chat/v1/vision.

+++ Discord perks

Joining the Discord unlocks extended access on top of the free tier:

Support the project: most DG Develops projects are free-for-all — no money required, just time. Join in and help build what's next: discord.gg/4ApADpxGQV