curl --request POST \
--url https://dream-gateway.livepeer.cloud/llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model": "",
"temperature": 0.7,
"max_tokens": 256,
"top_p": 1,
"top_k": -1,
"stream": false
}
'{
"id": "<string>",
"model": "<string>",
"created": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"choices": [
{
"index": 123,
"finish_reason": "",
"delta": {
"role": "<string>",
"content": "<string>"
},
"message": {
"role": "<string>",
"content": "<string>"
}
}
]
}Generate text using a language model.
curl --request POST \
--url https://dream-gateway.livepeer.cloud/llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model": "",
"temperature": 0.7,
"max_tokens": 256,
"top_p": 1,
"top_k": -1,
"stream": false
}
'{
"id": "<string>",
"model": "<string>",
"created": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"choices": [
{
"index": 123,
"finish_reason": "",
"delta": {
"role": "<string>",
"content": "<string>"
},
"message": {
"role": "<string>",
"content": "<string>"
}
}
]
}ai-video channel on
Discord.data: line as it arrives./llm endpoint returns a single JSON response in the OpenAI
chat/completions
format, as shown in the sidebar.
To receive responses token-by-token, set "stream": true in the request body.
The server will then use Server-Sent Events (SSE) to stream output in real
time.
Each streamed chunk will look like:
data: {
"choices": [
{
"delta": {
"content": "...token...",
"role": "assistant"
},
"finish_reason": null
}
]
}
"finish_reason": "stop":
data: {
"choices": [
{
"delta": {
"content": "",
"role": "assistant"
},
"finish_reason": "stop"
}
]
}
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?