Chat Completions

Generate a chat completion

Changed on

Generates a model response for a conversation in the OpenAI Chat Completions shape, from any model whose supported APIs include chat completions. The hand-written orl chat is the friendlier front for this operation: model name completion, a readable transcript, and streaming output rendered to the terminal.

Requires a funded balance. Set "stream" to true to receive the completion incrementally as Server-Sent Events, ending with a data: [DONE] sentinel. The request body is capped at 10 MiB.

Requires the inference.invoke permission. See Permissions for the roles and API key permissions that include it.

post/v1/chat/completions

Request

  • Base URL
    https://inference.openrelay.inc
  • URL
    https://inference.openrelay.inc/v1/chat/completions
  • Auth
    HTTP bearer

Request body

max_completion_tokensinteger

Upper bound on the number of tokens to generate.

messagesobject[] required

The conversation so far: {role, content} objects (system, user, assistant).

modelstring required

An OpenRelay public model id, e.g. openrelay/gpt-oss-120b.

streamboolean

Stream the response as Server-Sent Events.

Response

OK

choicesobject[]
idstring
modelstring

Always the public OpenRelay model id requested.

object'chat.completion'
usageobject

Changes

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      endpoint added