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 with the registered model name in the model field, and sends the API key of the registration, when the registration has one, as a bearer token. The model field of the body applies only when the registration has no model name. 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 content type, typically a chat completion object in JSON; a request with "stream": true receives the model server's server-sent events as text/event-stream.