← Back to Admin

⚡ LLM Proxy API

OpenAI-compatible API for accessing LLM models

v1.0 OpenAI Compatible

🚀 Quick Start

Base URL: https://proxy.abhibots.com/v1
Auth: Bearer token — Authorization: Bearer sk-proxy-YOUR_KEY
Format: 100% OpenAI-compatible — works with any OpenAI SDK or client

cURL Example

curl -X POST https://proxy.abhibots.com/v1/chat/completions \
  -H "Authorization: Bearer sk-proxy-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-pro",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello, how are you?"}
    ],
    "temperature": 0.7,
    "stream": false
  }'

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    api_key="sk-proxy-YOUR_KEY",
    base_url="https://proxy.abhibots.com/v1"
)

response = client.chat.completions.create(
    model="gemini-3.1-pro",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ],
    temperature=0.7,
    stream=False
)

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

Node.js (OpenAI SDK)

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'sk-proxy-YOUR_KEY',
  baseURL: 'https://proxy.abhibots.com/v1',
});

const response = await client.chat.completions.create({
  model: 'gemini-3.1-pro',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello!' },
  ],
  stream: false,
});

console.log(response.choices[0].message.content);

Streaming Example (Node.js)

const stream = await client.chat.completions.create({
  model: 'gemini-3.1-pro',
  messages: [{ role: 'user', content: 'Tell me a story' }],
  stream: true,
});

for await (const chunk of stream) {
  const text = chunk.choices[0]?.delta?.content || '';
  process.stdout.write(text);
}

📡 Endpoints

POST /v1/chat/completions

Send a chat completion request. Supports both streaming (SSE) and non-streaming responses.

ParameterTypeDescription
modelstringRequired. Model ID from /v1/models
messagesarrayRequired. Array of message objects with role and content
temperaturenumberSampling temperature (0-2). Default: 1.0
max_tokensnumberMaximum tokens to generate
streambooleanEnable SSE streaming. Default: false
top_pnumberNucleus sampling parameter

Message Roles

RoleDescription
systemSystem prompt — sets the assistant's behavior
userUser message
assistantPrevious assistant response (for multi-turn conversations)

GET /v1/models

List all available (enabled) models. Returns OpenAI-compatible model list.

curl https://proxy.abhibots.com/v1/models \
  -H "Authorization: Bearer sk-proxy-YOUR_KEY"

Response Format

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1773515917,
  "model": "gemini-3.1-pro",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! How can I help you?"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}

🔑 Authentication

All API requests require a valid API key passed via the Authorization header:

Authorization: Bearer sk-proxy-YOUR_KEY
Rate Limiting: Each API key has a configurable rate limit (default: 60 requests/min).
IP Allowlist: Keys can optionally be restricted to specific IPs.
Expiry: Keys can have an expiration date after which they stop working.

❌ Error Handling

StatusErrorDescription
401Missing/invalid API keyCheck your Authorization header
403Key expired or IP blockedKey inactive, expired, or IP not in allowlist
400Model not found/disabledCheck /v1/models for available models
429Rate limit exceededWait and retry, or request a higher limit
500Server/Provider errorUpstream LLM provider error

🤖 Available Models

Models are auto-synced from the Gemini API. Use GET /v1/models for the latest list. Only enabled models are available for chat completions.

Loading models...