Completions

Chat Completion

Follows the exact same API spec as OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat

curl -X POST http://localhost:4000/v1/chat/completions 
-H "Content-Type: application/json" 
-H "Authorization: Bearer sk-1234" 
-d '{
    "model": "gpt-4o",
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}'
POST/engines/{model}/chat/completions
Authorization
Path parameters
model*Model
Response

Successful Response

Body
any
Request
const response = await fetch('/engines/{model}/chat/completions', {
    method: 'POST',
    headers: {},
});
const data = await response.json();
Response
{
  "detail": [
    {
      "loc": [
        "text"
      ],
      "msg": "text",
      "type": "text"
    }
  ]
}