Groq
groq
- openai/gpt-oss-120b
- openai/gpt-oss-20b
OpenAI-compatible AI gateway by Octoprograms
OctoFlux is an OpenAI-compatible gateway that routes requests across configured providers, models, and API keys, with health-aware failover built in.
POST /v1/chat/completions · GET /v1/models · GET /v1/aliases · POST /v1/responses
The problem
Every provider brings its own credentials, limits, model catalog, availability, and failure behavior. Without a routing layer, switching providers becomes application work.
Each SDK, header scheme, and model ID leaks into application code.
A single throttled key stalls requests that another key could have served.
Catalogs shift and endpoints fail; your code absorbs the churn.
OctoFlux does not resolve every provider incompatibility. It supports OpenAI-compatible providers and configurable authentication headers.
The solution
Point an OpenAI-compatible client at OctoFlux once. Configure providers, models, aliases, and keys centrally, then let the gateway resolve each request.
Application → Provider A Application → Provider B Application → Provider C
Application → OctoFlux → Provider A
→ Provider B
→ Provider CHow it works
Request lifecycle — illustrative
Retries and failover depend on the error category. A request does not always try every provider — candidates stop as soon as one returns successfully or the configured attempts are exhausted.
Streaming responses forward chunk by chunk over SSE. Failover happens only before the first streamed byte.
Quick start
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="OctoFlux-dev-key",
)
response = client.chat.completions.create(
model="auto",
messages=[
{"role": "user", "content": "Hello"}
],
)
print(response.choices[0].message.content)base_url points the OpenAI client to OctoFlux.model: "auto" lets the router consider enabled models across enabled providers.curl \
-H "Authorization: Bearer $OctoFlux_CLIENT_KEY" \
-H "Content-Type: application/json" \
-X POST \
http://localhost:8000/v1/chat/completions \
-d '{
"model": "auto",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Model routing
{
"model": "openai/gpt-oss-120b"
}Exact model requests only fail over to another provider offering the same model ID. OctoFlux does not silently substitute another model.
Provider ecosystem
groq
openrouter
nvidia_nim
These are example configured model IDs, not permanent availability guarantees. Provider model catalogs change. OctoFlux can compare configured model IDs against a provider's /models response; NVIDIA NIM may return bare model names, so OctoFlux handles the corresponding publisher-prefixed configuration IDs.
Capabilities
Track provider and key health, cooldowns, and recent probe results before selecting a route.
Rotate configured keys using round-robin, least-used, or priority-based selection.
Retry rate limits, timeouts, connection failures, and server errors according to their failure category.
Apply request, token, concurrency, and time-window limits before calling upstream providers.
Create explicit fallback paths when you intentionally want different model IDs tried in sequence.
Forward streaming responses chunk by chunk and fail over only before the first response byte.
Add OpenAI-compatible providers through YAML configuration instead of provider-specific application code.
Inspect health, usage, model availability, logs, and runtime configuration through the existing admin API and dashboard.
Health and operations
/models endpoint.Deployment
.env must not be committed.docker compose up -d --buildArchitecture
OctoFlux is built in the open for developers who want a simpler way to work with AI providers. If it saves you time, consider supporting its continued development.