LLM API Endpoint Discovery

May 17, 2026 · View on GitHub

The AWF api-proxy sidecar exposes a /reflect endpoint listing every configured LLM provider, its port, and available models. Use it to configure any tool that needs OpenAI/Anthropic access inside the agent container.

⚠️ Only reachable from inside the AWF agent container — not from the runner host.

Quick Start

# Discover all configured providers and their models
curl -sf http://api-proxy:10000/reflect | jq '.endpoints[] | select(.configured)'

Provider Ports

ProviderPortBase URLCredentials env var
openai / codex10000http://api-proxy:10000/v1OPENAI_API_KEY
anthropic10001http://api-proxy:10001/v1 (or no /v1 for native SDK)ANTHROPIC_API_KEY
copilot10002http://api-proxy:10002/v1COPILOT_GITHUB_TOKEN
gemini10003http://api-proxy:10003/v1GEMINI_API_KEY

All ports use the OpenAI-compatible API format. The api-proxy injects auth headers automatically — do not pass raw API keys to these URLs.

/reflect Response

{
  "endpoints": [
    { "provider": "openai",    "port": 10000, "configured": true,  "models": ["gpt-4o", "o1-mini"], "models_url": "http://api-proxy:10000/v1/models" },
    { "provider": "anthropic", "port": 10001, "configured": true,  "models": ["claude-sonnet-4-5"],  "models_url": "http://api-proxy:10001/v1/models" },
    { "provider": "copilot",   "port": 10002, "configured": true,  "models": null,                   "models_url": "http://api-proxy:10002/models" },
    { "provider": "gemini",    "port": 10003, "configured": false, "models": null,                   "models_url": null }
  ],
  "models_fetch_complete": true
}

Only use endpoints where configured: true. models may be null when the proxy hasn't finished fetching; use models_url to fetch on demand.

Configure Tools

OpenAI-compatible SDK (any provider)

# Use Copilot as the OpenAI backend
export OPENAI_BASE_URL="http://api-proxy:10002/v1"
export OPENAI_API_KEY="$COPILOT_GITHUB_TOKEN"

Anthropic SDK

export ANTHROPIC_BASE_URL="http://api-proxy:10001"
export ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"

Dynamic resolution from /reflect

PROVIDER=anthropic
PORT=$(curl -sf http://api-proxy:10000/reflect \
  | jq -r --arg p "$PROVIDER" '.endpoints[] | select(.provider == $p and .configured) | .port')
export ANTHROPIC_BASE_URL="http://api-proxy:${PORT}"

List Available Models

# OpenAI / Anthropic / Copilot format → { data: [{id}] }
curl -sf http://api-proxy:10000/reflect \
  | jq -r '.endpoints[] | select(.provider == "openai" and .configured) | .models_url' \
  | xargs curl -sf | jq '[.data[].id]'

# Gemini format → { models: [{name: "models/gemini-..."}] }
curl -sf http://api-proxy:10003/v1/models | jq '[.models[].name | ltrimstr("models/")]'

See Also

  • network.md — egress domain configuration
  • syntax.mdengine: and engine.model frontmatter