Skip to content

LLM gateway

The LLM gateway is an OpenAI-compatible endpoint run by AbstractAI. Agents that use it never hold a provider key: the gateway holds your keys, and adds budgets, rate limits, fallbacks, usage and cost tracking, and optional safety guardrails.

Terminal window
agent-platform gateway keys set openai # hidden prompt; also anthropic, gemini
agent-platform gateway keys list # which providers have a key, and each agent's spend this month
llm:
gateway: true
budgetUsdPerMonth: 20 # hard stop: HTTP 402 after this
requestsPerMinute: 60 # HTTP 429 above this
fallbacks: # tried in order when the model returns 429 or 5xx
openai/gpt-4o-mini: [anthropic/claude-haiku-4-5, gemini/gemini-2.5-flash]

On deploy, the agent gets OPENAI_BASE_URL pointing at the gateway and its own gateway key as OPENAI_API_KEY. Any OpenAI SDK picks these up with no code change. Name models as provider/model:

import OpenAI from 'openai'
const client = new OpenAI() // reads OPENAI_BASE_URL and OPENAI_API_KEY
const r = await client.chat.completions.create({
model: 'anthropic/claude-sonnet-4-5',
messages: [{ role: 'user', content: 'Hello' }],
})

Providers: openai, anthropic, gemini.

  • Per agent: llm.budgetUsdPerMonth.
  • Per workspace: Team → Monthly LLM budget in the dashboard sets a hard monthly cap across all your agents that use the gateway. Past it, the gateway answers HTTP 402 until the month ends.

Spend is counted as responses arrive, so a burst of parallel calls can go slightly over.