Endpoints and client formats
Only these fixed shapes are accepted. Similar but unlisted paths, such as
/v2/chat/completions, return 404.
Send a request
Use the LLM URL and credentials from the consumer Connect tab:X-AG-API-Key, x-api-key, or
Authorization: Bearer ag_…. OAuth2 and OIDC bearer tokens are also accepted when
configured. Private deployments may require X-AG-Gateway-Slug.
See Auth and Quickstart.
Model selection and routing
The consumer controls which registries and models can serve the request:- Use
"model": "auto"for load balancing or Smart routing. - Use an allowed model ID to request a specific model.
- Gemini puts the model in the URL path instead of the request body.
- Model allowlists and defaults are enforced before TrustGate calls the provider.
X-Selected-Provider and X-Selected-Model, which are useful when
debugging routing decisions.
See Model resolution,
Load balancing, and
Smart routing.
Streaming
For OpenAI, Anthropic, Cohere, and Responses clients, set"stream": true in the request.
For Gemini, call :streamGenerateContent or add ?alt=sse.
TrustGate adapts normal server-sent events to the format expected by the client. If an
upstream stream stops unexpectedly after the HTTP response has started, TrustGate emits
this fixed error event; the already-sent HTTP status remains 200:
Provider-specific features can differ. TrustGate adapts supported request and response
fields, but does not guarantee every provider extension is portable across every provider.