Inference

Create a chat completion

Generates a reply with the requested model, in OpenAI's chat completions format. The key may be sent as Authorization: Bearer or X-API-Key, never both.

With stream: true the reply is a server-sent event stream of chat.completion.chunk objects ending with data: [DONE]; a : keep-alive comment arrives during long silences, such as while a long prompt is read. A stream that breaks off without [DONE] was cut short and should be retried. Request fields other than those listed are passed to the model's engine unchanged.

Requests of one conversation stay on the same GPU node, reusing its prompt cache, when they share a session_id (or X-Session-Id header), a prompt_cache_key, or their first system and user messages.

Completions are charged to your organization's API billing account: without an active one, while it is paused, or once today's spend reaches its daily limit, the answer is 402.

Requires the inference entitlement family; requests without it return 404 not_found.

post/v1/chat/completions

Request

  • Base URL
    https://api.liquidcompute.co
  • Auth
    • HTTP bearer
    • or API key in header X-API-Key

Headers

X-Session-Idstring

Conversation id that keeps a conversation's requests on one GPU node. A session_id in the body takes precedence.

Request body

modelstring required

A model id from GET /v1/models.

streamboolean
session_idstring

Conversation id; requests sharing one stay on one GPU node.

prompt_cache_keystring

Keeps requests on one GPU node when no session id is sent.

Response

The completion, or with stream set an event stream of completion chunks.

idstring required
object'chat.completion' required
createdinteger
modelstring required
choicesobject[] required

Changes

No recorded changes to this operation across all 1 revision of this API.