Skip to content

Documentation Chat Completions

API reference

Chat Completions

Submit a list of messages and receive a text response using the documented compatibility surface.

Endpoint#

POSThttps://api.dev.morphfactory.io/v1/chat/completions

Headers#

HeaderValue
AuthorizationBearer <MORPH_API_KEY>
Content-Typeapplication/json

Request body#

FieldTypeStatus
modelstringRequired; model identifier
messagesarrayRequired; role/content messages
JSON
{
  "model": "motif/motif-3",
  "messages": [
    { "role": "user", "content": "Hello, Morph!" }
  ]
}

Response#

Read generated text from the following response path.

Python
response.choices[0].message.content