Repository navigation
Connect OpenAI and Other Remote APIs
Adi edited this page Oct 19, 2026
·
2 revisions
How-to. Let agents use the OpenAI API, any OpenAI-compatible server, or the Anthropic API. Agents stay network-less; requests go through llm-bridge. Remote models and llm-bridge explains how this works.
Remote means your code leaves the machine and tokens are billed. Each task is capped by token_budget
(3M by default for remote models).
# secrets.env (mode 600, read only by the llm-bridge container)
OPENAI_API_KEY=sk-...OpenAI:
gpt-5-mini:
backend: openai
endpoint: https://api.openai.com/v1
model_name: gpt-5-mini
api_key_env: OPENAI_API_KEY
token_param: max_completion_tokens # newer OpenAI models reject max_tokens
drop_params: [temperature, top_p] # reasoning models reject custom sampling
max_agents: 4
token_budget: 2000000Any OpenAI-compatible server (llama.cpp, LM Studio, SGLang, TGI, vLLM elsewhere, OpenRouter, Groq, …):
llamacpp-local:
backend: openai
endpoint: http://127.0.0.1:8080/v1 # llm-bridge uses host networking, so 127.0.0.1 works
model_name: qwen3-coder
max_output_tokens: 8192 # clamp for servers with small output limits
# api_key_env: OPENROUTER_API_KEY # if the server needs a key
# extra_body: {provider: {sort: throughput}} # provider-specific fieldsAnthropic API (pass-through):
claude-haiku:
backend: anthropic
endpoint: https://api.anthropic.com
model_name: claude-haiku-5-5
api_key_env: ANTHROPIC_API_KEYdocker compose up -d # recreates llm-bridge with the new secrets.env
docker compose restart agentbox agentbox-launcher
scripts/smoke-test.sh gpt-5-minidelegate_task checks the key and the endpoint through llm-bridge before starting the agent. A missing
key or a rejected key is reported as an error, without running anything.
Requirements for the upstream model:
- it supports function or tool calling;
- it has a context of ≥ 64k tokens;
- it streams (
stream: true). Servers that ignore streaming still work.
Tutorials
How-to guides
- Install
- Delegate from Claude Code
- Write good specs
- Python environments
- Add a local model
- Connect remote APIs
- Run under gVisor
- Operate
- Troubleshoot
Reference
Explanation