Documentation Chat Completions
API reference
Chat Completions
Submit a list of messages and receive a text response using the documented compatibility surface.
Endpoint#
POST
https://api.dev.morphfactory.io/v1/chat/completionsHeaders#
| Header | Value |
|---|---|
| Authorization | Bearer <MORPH_API_KEY> |
| Content-Type | application/json |
Request body#
| Field | Type | Status |
|---|---|---|
| model | string | Required; model identifier |
| messages | array | Required; 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