Chat

Our flag ship API endpoint

Chat completion

POST /api/chat

Generate the next completion in a chat based data model.

Returns details about the user associated with the authentication provided in the request's authorization header.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body

NameTypeDescription

model

string

Model to use for the generation

messages

chat

Chat dialog between user and assistant

Response

{
    "address": "0xb4A665CA2E65F90319321e9721cAF539A4C60edF",
    "model": "llama2-uncensored",
    "messages": [
        {
            "role": "user",
            "content": "What is block chain?"
        },
        {
            "role": "assistant",
            "content": "A chain of blocks."
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}

Last updated