Skip to main content

Relay a chat completion

POST 

/openai/v1/chat/completions

Relays an OpenAI chat completion request to the chat completions API of the LLM named in the x-llm-id header. Foundation4 forwards the body unchanged, inserts the registered model name when the body has no model field and sends the API key of the registration, when the registration has one, as a bearer token. Foundation4 returns the model server's status and body, including error responses, and performs no retrieval, prompt templating or tracing.

Permissions. Execute on the LLM.

LLMs describes the endpoint.

Request​

Responses​

The model server's response, relayed unchanged. A non-streamed request receives the model server's body and headers, typically a chat completion object in JSON; a request with "stream": true receives the model server's server-sent events as text/event-stream.