Tells a client what it may ask for. Cheap — it reads the gateway's own configuration and makes no upstream call.
Reference#
GET /v1/providers
Requires Authorization: Bearer <SKYL_AUTH_TOKEN>. Returns
application/json.
{"default": "anthropic", "providers": ["anthropic", "openai"]}{"default": "anthropic", "providers": ["anthropic", "openai"]}| Field | Meaning |
|---|---|
default | The provider used when a request omits one — SKYL_DEFAULT_PROVIDER, or the alphabetically first name. |
providers | Every registered provider name, sorted. |
Caveats
- Names are sorted, so the output is stable across restarts.
defaulttells you which provider a request with noproviderfield will reach. Read it rather than assuming: it is the alphabetically first name unless an operator setSKYL_DEFAULT_PROVIDER.- The list reflects which API keys were present at startup. A provider is registered for each key found; there is no runtime registration.
- No upstream call. Unlike
/v1/models, this is free and safe to call often.
Usage#
Discovering what is available
curl -sS localhost:8080/v1/providers \
-H "Authorization: Bearer $SKYL_AUTH_TOKEN"curl -sS localhost:8080/v1/providers \
-H "Authorization: Bearer $SKYL_AUTH_TOKEN"import httpx
r = httpx.get(f"{BASE}/v1/providers", headers=HEADERS)
r.raise_for_status()
print(r.json())import httpx
r = httpx.get(f"{BASE}/v1/providers", headers=HEADERS)
r.raise_for_status()
print(r.json())const res = await fetch(`${BASE}/v1/providers`, { headers: HEADERS });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(await res.json());const res = await fetch(`${BASE}/v1/providers`, { headers: HEADERS });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(await res.json());A startup sanity check
# Fail a deploy if the provider you expect is not registered.
curl -sf localhost:8080/v1/providers -H "Authorization: Bearer $TOKEN" \
| grep -q anthropic || { echo "anthropic not registered"; exit 1; }# Fail a deploy if the provider you expect is not registered.
curl -sf localhost:8080/v1/providers -H "Authorization: Bearer $TOKEN" \
| grep -q anthropic || { echo "anthropic not registered"; exit 1; }A smoke test that also validates the token
# 200 proves the gateway is up AND the token is right — more than /healthz,
# which is unauthenticated by design.
curl -sf -o /dev/null -w '%{http_code}\n' localhost:8080/v1/providers \
-H "Authorization: Bearer $TOKEN"# 200 proves the gateway is up AND the token is right — more than /healthz,
# which is unauthenticated by design.
curl -sf -o /dev/null -w '%{http_code}\n' localhost:8080/v1/providers \
-H "Authorization: Bearer $TOKEN"Troubleshooting#
An empty list
Impossible — the gateway refuses to start with no providers registered. If you see one, you are not talking to a skyl gateway.
A provider I configured is missing
Its key was not present at startup. Variable names must match exactly:
ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, and
SKYL_COMPAT_BASE_URL for a compatible host.
The compatible provider is named “compat”
That is the default. Set SKYL_COMPAT_NAME.