LG

LLM Gateway

BTY internal gateway · external API proxy

Live

Configuration

Quick Start (curl)

# OpenAI-compatible chat
curl -X POST https://your-domain/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-key>" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role":"user","content":"Hello!"}],
    "stream": false
  }'

# Anthropic Messages protocol
curl -X POST https://your-domain/api/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-key>" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4.6",
    "max_tokens": 1024,
    "messages": [{"role":"user","content":"Hello!"}]
  }'

# List models
curl https://your-domain/api/v1/models \
  -H "Authorization: Bearer <your-key>"

# Image generation (media)
curl -X POST https://your-domain/api/v1/llm_server \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-key>" \
  -H "x-bty-model: doubao-seedream-5-0-260128" \
  -d '{"prompt":"A futuristic city at sunset","size":"1024x1024"}'

Endpoints

Authentication: Set the GATEWAY_API_KEY env var to require a key on all requests. If unset, the gateway is open (sandbox mode). Clients may use Authorization: Bearer <key> or x-api-key.