Skip to main content

API overview

The gateway exposes an OpenAI-compatible REST API surface so you can reuse existing OpenAI SDKs and tooling โ€” point the client's base_url at the gateway and keep your code unchanged.

Base URLโ€‹

Use the gateway host as the base URL, for example:

http://localhost:8080

Authenticationโ€‹

/v1/* requires a bearer token by default:

Authorization: Bearer fgw_...

Set ALLOW_UNAUTHENTICATED_PROXY=true to disable this for local development โ€” it is refused at startup under GATEWAY_ENV=production. See Authentication.

Inference endpointsโ€‹

These route through the gateway's targets, plugins, and circuit breakers like any other request:

EndpointMethodNotes
/v1/chat/completionsPOSTSupports stream: true (SSE)
/v1/completionsPOSTLegacy text completions, served as a single-message chat
/v1/embeddingsPOST
/v1/images/generationsPOST
/v1/audio/speechPOSTText-to-speech โ€” JSON in, binary audio out
/v1/audio/transcriptions, /v1/audio/translationsPOSTSpeech-to-text โ€” multipart upload, 25 MiB cap
/v1/rerankPOSTCohere-v2 contract
/v1/moderationsPOST
/v1/responsesPOSTGoverned and priced โ€” routes by model like chat

/v1/audio/* is natively routed, not blindly proxied: it goes through targets, plugins, the circuit breaker, and request logging like the endpoints above.

Discoveryโ€‹

EndpointMethodNotes
/v1/modelsGETUnion of catalog, live discovery, and operator-declared models
/v1/capabilitiesGETPer-provider OpenAI parameter support, from the capability matrix

Files, batches, and responses sub-routesโ€‹

EndpointMethodNotes
/v1/files, /v1/files/*GET, POST, DELETEPass-through to the single configured batch_target
/v1/batches, /v1/batches/*GET, POST, DELETEPass-through to the single configured batch_target
/v1/responses/*GET, POST, DELETEId sub-routes (retrieve/delete/cancel/input_items), pin to responses_target

These carry no model โ€” a batch or response id is opaque and provider-scoped โ€” so they pin to one configured target instead of being routed. Each returns 501 when its target (batch_target / responses_target) is unset.

Pass-through proxyโ€‹

Any other /v1/* path is forwarded transparently to the provider that owns the request's model, resolved through the same routing index every native endpoint uses โ€” an unowned model is refused 404 model_not_found rather than forwarded.

Health and observabilityโ€‹

EndpointMethodAuth
/livezGETNone โ€” process is alive
/readyzGETNone โ€” gateway can route traffic
/healthGETNone โ€” deep diagnostic (per-provider status, circuit state)
/metricsGETBearer token, read_only or admin scope
/debug/vars, /debug/pprof/*GETBearer token, admin scope (/debug/pprof/* also requires ENABLE_PPROF=true)
note

/metrics and everything under /debug require a scoped bearer token โ€” unlike /v1/*, an unauthenticated request always gets 401 here, even with ALLOW_UNAUTHENTICATED_PROXY=true.