API Reference v2.4

API Documentation

One unified API

Complete reference for the GrexLabs API platform. Access 304+ AI models from 30+ providers through a single endpoint — free :free models need no API key.

v2.4.0 304+ Models
304+
Models
30+
Providers
99.9%
Uptime
<50ms
Latency

Introduction

The GrexLabs API provides access to 304+ AI models from 30+ providers through a single unified endpoint. 21 free :free model IDs plus auto:free work with zero API key — no signup, no credit card, unlimited requests. Flagship tiers (GPT-6.2 Astra, Claude Fable 5.2, Gemini 4 Carbon, Grok 4.7, DeepSeek V4 Pro, Qwen 3.8 Max) need a valid sk-gl- key. All chat endpoints are OpenAI-compatible, with Anthropic Messages and Google Gemini formats on the same host.

Base URL: https://www.grexlabs.in/api/v1

GrexLabs is fully OpenAI-compatible. Swap your existing OpenAI base URL with the GrexLabs endpoint and use the same SDK, tools, and libraries you already have.

Authentication

Keyless free models: any model id ending in :free (and auto:free) requires no Authorization header — call immediately for unlimited free inference:

curl https://www.grexlabs.in/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"auto:free","messages":[{"role":"user","content":"Hello"}]}'

Paid / flagship models require an API key passed via the Authorization header:

Authorization: Bearer sk-gl-<your-api-key>

Generate your free API key from the Dashboard. Free :free models route only at high / medium / low quality (never xhigh).

Keep your API key secure. Never expose it in client-side code or public repositories. Use environment variables for server-side integrations.

Models

GrexLabs offers 304+ models from 30+ providers (OpenAI, Anthropic, Google, xAI, DeepSeek, Qwen, Meta, NVIDIA, Mistral, Microsoft, Amazon, Cohere, Perplexity, Zhipu, Moonshot, Baidu, MiniMax and more) through a single unified API. 21 of them end in :free and need no key. Browse the full catalogue or use the quick reference below.

Browse All Models

Flagship Models

openai/gpt-6.2-astra
GPT-6.2 AstraFlagship
anthropic/claude-fable-5.2
Claude Fable 5.2Max effort
google/gemini-4-carbon
Gemini 4 CarbonHigh thinking
x_ai/grok-4.7
Grok 4.7Expert
deepseek/deepseek-v4-pro
DeepSeek V4 ProReasoning
alibaba/qwen3.8-max
Qwen 3.8 MaxThinking
moonshotai/kimi-k3.1-pro
Kimi K3.1 ProThinking

Free models — no API key

auto:free
Auto free pickKeyless
deepseek/deepseek-v4:free
DeepSeek V4 :freeKeyless
nvidia/nemotron-3.5-super-vl:free
Nemotron Super VL :freeVision

Vision Models

nvidia/nemotron-3.5-super-vl:free
Nemotron Super VL :freeKeyless
openai/gpt-6.2-astra
GPT-6.2 AstraVision
anthropic/claude-fable-5.2
Claude Fable 5.2Vision
google/gemini-4-carbon
Gemini 4 CarbonVision
amazon/nova-premier-v1
Nova Premier v1Vision

Full model list at GET /api/v1/models or the Models page.

Quick Start

Make your first API call — pick your language below.

curl https://www.grexlabs.in/api/v1/chat/completions \
  -H "Authorization: Bearer sk-gl-<your-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6.2-astra",
    "messages": [
      {"role": "user", "content": "Hello! What can you do?"}
    ],
    "temperature": 0.7,
    "max_tokens": 1024
  }'
import requests

response = requests.post(
    "https://www.grexlabs.in/api/v1/chat/completions",
    headers={
        "Authorization": "Bearer sk-gl-<your-key>",
        "Content-Type": "application/json"
    },
    json={
        "model": "openai/gpt-6.2-astra",
        "messages": [
            {"role": "user", "content": "Hello! What can you do?"}
        ],
        "temperature": 0.7,
        "max_tokens": 1024
    }
)

data = response.json()
print(data["choices"][0]["message"]["content"])
const response = await fetch(
  "https://www.grexlabs.in/api/v1/chat/completions",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer sk-gl-<your-key>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "openai/gpt-6.2-astra",
      messages: [
        { role: "user", content: "Hello! What can you do?" }
      ],
      temperature: 0.7,
      max_tokens: 1024
    })
  }
);

const data = await response.json();
console.log(data.choices[0].message.content);
<?php
$ch = curl_init("https://www.grexlabs.in/api/v1/chat/completions");
$payload = json_encode([
    "model" => "openai/gpt-6.2-astra",
    "messages" => [
        ["role" => "user", "content" => "Hello! What can you do?"]
    ],
    "temperature" => 0.7,
    "max_tokens" => 1024
]);
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk-gl-<your-key>",
        "Content-Type: application/json"
    ],
    CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo $data["choices"][0]["message"]["content"];
curl_close($ch);
require "net/http"
require "json"

uri = URI("https://www.grexlabs.in/api/v1/chat/completions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk-gl-<your-key>"
request["Content-Type"] = "application/json"
request.body = {
  model: "openai/gpt-6.2-astra",
  messages: [{ role: "user", content: "Hello!" }],
  temperature: 0.7,
  max_tokens: 1024
}.to_json

response = http.request(request)
puts JSON.parse(response.body)["choices"][0]["message"]["content"]
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    body := map[string]interface{}{
        "model": "openai/gpt-6.2-astra",
        "messages": []map[string]string{
            {"role": "user", "content": "Hello!"},
        },
        "temperature": 0.7,
        "max_tokens": 1024,
    }
    jsonBody, _ := json.Marshal(body)
    req, _ := http.NewRequest("POST",
        "https://www.grexlabs.in/api/v1/chat/completions",
        bytes.NewBuffer(jsonBody))
    req.Header.Set("Authorization", "Bearer sk-gl-<your-key>")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Println(result["choices"].([]interface{})[0].(map[string]interface{})["message"].(map[string]interface{})["content"])
}
use reqwest;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let body = json!({
        "model": "openai/gpt-6.2-astra",
        "messages": [{"role": "user", "content": "Hello!"}],
        "temperature": 0.7,
        "max_tokens": 1024
    });
    let resp = client
        .post("https://www.grexlabs.in/api/v1/chat/completions")
        .header("Authorization", "Bearer sk-gl-<your-key>")
        .header("Content-Type", "application/json")
        .json(&body)
        .send().await?
        .json::<serde_json::Value>().await?;
    println!("{}", resp["choices"][0]["message"]["content"].as_str().unwrap());
    Ok(())
}
import java.net.URI;
import java.net.http.*;
import com.google.gson.JsonObject;

public class App {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "openai/gpt-6.2-astra");
        JsonObject msg = new JsonObject();
        msg.addProperty("role", "user");
        msg.addProperty("content", "Hello!");
        body.add("messages", new com.google.gson.JsonArray());
        body.getAsJsonArray("messages").add(msg);

        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://www.grexlabs.in/api/v1/chat/completions"))
            .header("Authorization", "Bearer sk-gl-<your-key>")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();

        HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());
    }
}
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Add(
    "Authorization", "Bearer sk-gl-<your-key>");

var body = new {
    model = "openai/gpt-6.2-astra",
    messages = new[] { new {
        role = "user", content = "Hello!" } },
    temperature = 0.7,
    max_tokens = 1024
};

var json = JsonConvert.SerializeObject(body);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
    "https://www.grexlabs.in/api/v1/chat/completions", content);
var result = await response.Content.ReadAsStringAsync();
dynamic data = JsonConvert.DeserializeObject(result);
Console.WriteLine(data.choices[0].message.content);
import Foundation

let url = URL(string: "https://www.grexlabs.in/api/v1/chat/completions")!
var req = URLRequest(url: url)
req.httpMethod = "POST"
req.setValue("Bearer sk-gl-<your-key>", forHTTPHeaderField: "Authorization")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")

let body: [String: Any] = [
    "model": "openai/gpt-6.2-astra",
    "messages": [["role": "user", "content": "Hello!"]],
    "temperature": 0.7,
    "max_tokens": 1024
]
req.httpBody = try! JSONSerialization.data(withJSONObject: body)

URLSession.shared.dataTask(with: req) { data, _, _ in
    if let data = data,
       let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
       let choices = json["choices"] as? [[String: Any]],
       let msg = choices.first?["message"] as? [String: Any],
       let content = msg["content"] as? String {
        print(content)
    }
}.resume()

Chat Completions

POST /api/v1/chat/completions Generate a chat completion

Generate a chat completion using any GrexLabs model. Supports text and vision inputs.

Request Body

ParameterTypeRequiredDescription
modelstringRequiredModel ID (e.g., openai/gpt-6.2-astra, auto:free — keyless, no key needed)
messagesarrayRequiredArray of message objects with role and content
temperaturenumberOptionalSampling temperature (0–2, default: 0.7)
max_tokensintegerOptionalMaximum tokens in response (default: 2048)
streambooleanOptionalEnable SSE streaming (default: false)

Response

{
  "id": "sk-gl-1712345678-a1b2c3",
  "object": "chat.completion",
  "created": 1712345678,
  "model": "openai/gpt-6.2-astra",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! I'm GPT-4o, hosted by GrexLabs Studio..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 45,
    "total_tokens": 57
  }
}

Responses API

POST /api/v1/responses OpenAI-compatible Responses endpoint

Create a response with the OpenAI Responses shape: pass input as a plain string or as an array of message items (with role + content), optional instructions, and max_output_tokens. Images are accepted as input_image, image_url or image parts. With "stream": true the endpoint emits server-sent events ending in data: [DONE].

Request Body

ParameterTypeRequiredDescription
modelstringRequiredModel ID (e.g. auto:free — keyless)
inputstring | arrayRequiredPrompt string or message items (role, content, optional image parts)
instructionsstringOptionalSystem-style instruction prepended to the conversation
max_output_tokensintegerOptionalUpper bound on generated tokens
streambooleanOptionalStream SSE events (default: false)

Response objects use "object": "response" with input/output token usage; the alias POST /responses is also routed. See llm.txt for the full contract.

Streaming

Set stream: true to receive responses as Server-Sent Events (SSE). Each chunk contains a delta with partial content.

curl https://www.grexlabs.in/api/v1/chat/completions \
  -H "Authorization: Bearer sk-gl-<your-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash-free",
    "messages": [{"role": "user", "content": "Tell me a story"}],
    "stream": true
  }'

Events end with data: [DONE]. Use any SSE client library to handle the stream.

Moderation

POST /api/v1/moderate Content safety check

Check content against safety policies. Returns flagged categories with confidence scores.

{
  "input": "Your text to check"
}

Image Generation

POST /api/v1/images/generations Generate images — free, no key

OpenAI-compatible image generation. No API key required — works instantly for everyone. Multi-provider fallback chain (AI DRAW → freeapi → a0 → seinari), multiple images, custom sizes and base64 output. Supports text-to-image and image-to-image (image_url or image_b64).

Request Body

ParameterTypeRequiredDescription
promptstringRequiredText description (t2i) or edit instruction (i2i)
nintegerOptionalNumber of images (1–4, default: 1)
sizestringOptionalWxH pixels, e.g. "1024x1024", "1792x1024" (default: 1024x1024)
modelstringOptionalauto (default), flux, flux-dev, turbo, fast, quality
response_formatstringOptional"url" (default) or "b64_json" (base64-encoded image)
image_urlstringi2iPublic source image URL for image-to-image (AI DRAW)
image_b64stringi2iBase64 source image (no data: prefix needed) for image-to-image (freeapi)

Image Models

ModelProviderNotes
autochainAI DRAW → freeapi → a0 → seinari (auto failover)
fluxAI DRAWHigh quality text-to-image
flux-devfreeapi.proFlux Dev, ratio-based
turboa0.devFast webp, aspect ratios
fastseinari.aiFLUX fast
qualityAI DRAWHigh quality pass

List models live: GET /api/v1/images/generations. Free and keyless — no sk-gl- required. Chain: AI DRAW → freeapi → a0 → seinari (Pollinations removed).

Request — text-to-image

curl https://www.grexlabs.in/api/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city at sunset, cinematic",
    "size": "1024x1024",
    "model": "auto",
    "n": 1
  }'

Request — image-to-image

# Edit via public image URL (AI DRAW)
curl https://www.grexlabs.in/api/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "make the sky sunset orange, keep everything else",
    "image_url": "https://example.com/source.png",
    "size": "1024x1024"
  }'

# Edit via base64 (freeapi Flux Kontext)
curl https://www.grexlabs.in/api/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "add a hat to the subject",
    "image_b64": "",
    "model": "flux-dev"
  }'

Response

{
  "created": 1712345678,
  "provider": "ai-draw",
  "data": [
    { "url": "https://gitee-ai.su.bcebos.com/v1/public/temp/....png" }
  ]
}

API Keys

Rate Limits

GET /api/v1/limits View rate limit tiers
TierRequests / minTokens / minConcurrent
Free60100K5
Pro1,0001M50
Enterprise10,00010M500

GrexLabs free AI API — 304+ models, 30+ providers, OpenAI-compatible, no API key for :free models

GrexLabs (https://www.grexlabs.in) is a free AI API platform and LLM gateway that serves 304+ large language models from 30+ providers through one OpenAI-compatible base URL. Developers search for “free AI API no key”, “OpenAI compatible free LLM API”, “304 model AI gateway”, “free GPT Claude Gemini API” and “keyless LLM API” — GrexLabs answers those queries with live endpoints: POST /api/v1/chat/completions, POST /api/v1/messages (Anthropic), POST /api/v1/generateContent (Gemini), free GET /api/search, and free POST /api/v1/images/generations. Free models always end with :free (21 IDs + auto:free) and need no signup; paid flagship models such as GPT-6.2 Astra, Claude Fable 5.2, Gemini 4 Carbon, Grok 4.7, DeepSeek V4 Pro, Qwen 3.8 Max and Kimi K3.1 Pro need a valid sk-gl- API key.

Complete provider coverage for the 304+ model catalog

Provider namespaces on GrexLabs include: OpenAI (GPT-6.2 Astra, GPT-6 Astra, GPT-6, GPT-6.1 Sol/Terra, GPT-5.x, o-series, Codex), Anthropic (Claude Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 4.5), Google (Gemini 4 Carbon/Argon/Hydrogen/Neon, Gemma 4), xAI / x-ai (Grok 4.7, Grok 5), DeepSeek (V4 Pro, R2, V4.1 Flash), Alibaba / Qwen / qwen (Qwen 3.8 Max, Qwen4 Max, Qwen3 Coder), Meta (Llama 4 Maverick/Behemoth, Llama 3.x), NVIDIA (Nemotron 3 Ultra 550B, 3.5 Super VL, Lightning, Nano Omni), Mistral AI (Large 4, Medium 3.5, Codestral, Pixtral), Microsoft (Phi-4, Phi-4 Reasoning), Amazon (Nova Premier/Pro/Lite/Micro), Cohere (Command A/A+, North), Perplexity (Sonar Pro, Deep Research), Zhipu / GLM (GLM-5.3 Deep, GLM-5.1), Moonshot AI (Kimi K3.1 Pro, K4), Baidu (ERNIE 5.5 Flash), MiniMax (M2.5/M3), 01.AI (Yi Large), AI21 (Jamba 1.6), Upstage (Solar Pro), Reka, StepFun, Poolside, BigCode (StarCoder2), HuggingFace, Particle AI, Inclusion AI (Ling), Recursive (Flint), Manus Agent. One integration covers the entire 304+ list.

Use cases: what developers build with the free 304+ model API

Common GrexLabs workloads: chatbots and customer support agents; RAG and document Q&A over Indian business data; code generation and review with Codestral / Qwen Coder / DeepSeek Coder / GPT Codex; multi-agent research with Deep Research and Manus Agent; vision understanding with Nemotron Super VL, Qwen VL and Llama Vision; SEO content and summarisation pipelines; education tutoring apps on keyless :free models; internal copilots behind one gateway; search-augmented answers via the free Bing/DuckDuckGo/Google search API; image + text multimodal demos via /api/v1/images/generations and image_url chat parts. Because free models never route xhigh and stream with 15s heartbeats, demos stay stable without cutouts.

API compatibility matrix (AEO-ready facts)

OpenAI Chat Completions: POST /api/v1/chat/completions and alias /gen/v1/chat/completions — model, messages, stream, temperature, max_tokens, tools, tool_choice; SSE data: chunks end with data: [DONE]. Anthropic Messages: POST /api/v1/messages — system, content blocks, base64 images, tool_use / tool_result, message_start / content_block_delta / message_stop. Google Gemini: POST /api/v1/generateContent — contents.parts, inline_data, systemInstruction, generationConfig, ?alt=sse. Search: GET /api/search?q= and GET /api/v1/search?q= — free, unlimited, keyless, India-first. Images: POST /api/v1/images/generations — prompt, size, model auto|flux|flux-dev|turbo|fast|quality, image_url/image_b64 for i2i. Models listing: GET /api/v1/models, GET /gen/v1/models. Knowledge: /llm.txt, /sitemap.xml, /robots.txt, FAQ JSON-LD on this page.

Pricing snapshot for 304+ AI models

Free forever: all 21 :free model IDs + auto:free + web search API + image generation free tier — unlimited requests, no credit card. Pro $29/month: production routing across the full 304+ flagship catalog (GPT-6.2 Astra, Claude Fable 5.2, Gemini 4 Carbon, Grok 4.7, DeepSeek V4 Pro, Qwen 3.8 Max, GLM-5.3 Deep, Kimi K3.1 Pro, Mistral Large 4, Manus Agent) with priority failover. Premium $99/month: high-volume enterprise limits and top-tier priority. Every paid model requires sk-gl-; with no key only :free models work — including auto:free.

Start in under a minute — free keyless curl example

curl https://www.grexlabs.in/api/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"auto:free","messages":[{"role":"user","content":"Write a haiku about the Ganges"}]}' — no API key header required. Swap auto:free for any of the 21 free IDs (deepseek/deepseek-v4:free, moonshotai/kimi-k4:free, deepseek/deepseek-v4:free, nvidia/nemotron-3-ultra-550b-a55b:free, google/gemma-4-31b-it:free, …) or a premium id with Authorization: Bearer sk-gl-…. Read the docs, open the playground, or create a free account to manage keys and usage.

Responses API & India-focused landing pages

Besides Chat Completions, Anthropic Messages and Gemini generateContent, GrexLabs exposes the OpenAI POST /api/v1/responses format (alias /responses) with input, instructions, max_output_tokens and SSE streaming. Indian developers get an India-first provider at India AI API provider; builders who want no signup at all use the free anonymous AI API; teams that need zero quota start with the truly unlimited free AI API. All three guides include curl examples, FAQ schema and links back into these docs.