curl --request POST \
--url https://flow.seekr.com/v1/inference/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "meta-llama/Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"max_completion_tokens": 128,
"temperature": 0.7,
"stream": false
}
'import requests
url = "https://flow.seekr.com/v1/inference/chat/completions"
payload = {
"model": "meta-llama/Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"max_completion_tokens": 128,
"temperature": 0.7,
"stream": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'meta-llama/Llama-3.1-8B-Instruct',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'What is the capital of France?'}
],
max_completion_tokens: 128,
temperature: 0.7,
stream: false
})
};
fetch('https://flow.seekr.com/v1/inference/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://flow.seekr.com/v1/inference/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'meta-llama/Llama-3.1-8B-Instruct',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'What is the capital of France?'
]
],
'max_completion_tokens' => 128,
'temperature' => 0.7,
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flow.seekr.com/v1/inference/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://flow.seekr.com/v1/inference/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://flow.seekr.com/v1/inference/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"function_call": {
"name": "<string>",
"arguments": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
},
"type": "function"
}
],
"reasoning": "<string>"
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
]
}
]
}
]
},
"finish_reason": "stop",
"stop_reason": 123,
"token_ids": [
123
]
}
],
"usage": {
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 123,
"created_cache_tokens": 123,
"multimodal_tokens": {}
}
},
"object": "chat.completion",
"service_tier": "auto",
"system_fingerprint": "<string>",
"prompt_logprobs": [
{}
],
"prompt_token_ids": [
123
],
"prompt_text": "<string>",
"kv_transfer_params": {},
"metrics": {
"time_to_first_token_ms": 123,
"generation_time_ms": 123,
"queue_time_ms": 123,
"mean_itl_ms": 123,
"tokens_per_second": 123
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}Create chat completion
Generate a chat completion response from a deployed model.
curl --request POST \
--url https://flow.seekr.com/v1/inference/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "meta-llama/Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"max_completion_tokens": 128,
"temperature": 0.7,
"stream": false
}
'import requests
url = "https://flow.seekr.com/v1/inference/chat/completions"
payload = {
"model": "meta-llama/Llama-3.1-8B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"max_completion_tokens": 128,
"temperature": 0.7,
"stream": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'meta-llama/Llama-3.1-8B-Instruct',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'What is the capital of France?'}
],
max_completion_tokens: 128,
temperature: 0.7,
stream: false
})
};
fetch('https://flow.seekr.com/v1/inference/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://flow.seekr.com/v1/inference/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'meta-llama/Llama-3.1-8B-Instruct',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'What is the capital of France?'
]
],
'max_completion_tokens' => 128,
'temperature' => 0.7,
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flow.seekr.com/v1/inference/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://flow.seekr.com/v1/inference/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://flow.seekr.com/v1/inference/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_completion_tokens\": 128,\n \"temperature\": 0.7,\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"function_call": {
"name": "<string>",
"arguments": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
},
"type": "function"
}
],
"reasoning": "<string>"
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
]
}
]
}
]
},
"finish_reason": "stop",
"stop_reason": 123,
"token_ids": [
123
]
}
],
"usage": {
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 123,
"created_cache_tokens": 123,
"multimodal_tokens": {}
}
},
"object": "chat.completion",
"service_tier": "auto",
"system_fingerprint": "<string>",
"prompt_logprobs": [
{}
],
"prompt_token_ids": [
123
],
"prompt_text": "<string>",
"kv_transfer_params": {},
"metrics": {
"time_to_first_token_ms": 123,
"generation_time_ms": 123,
"queue_time_ms": 123,
"mean_itl_ms": 123,
"tokens_per_second": 123
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123,
"param": "<string>"
}
}Authorizations
Your Seekr API key, sent in the Authorization header with no 'Bearer' prefix.
Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- ResponseFormat
- StructuralTagResponseFormat
- LegacyStructuralTagResponseFormat
Show child attributes
Show child attributes
-9223372036854776000 <= x <= 9223372036854776000Show child attributes
Show child attributes
Show child attributes
Show child attributes
"none"Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
none, minimal, low, medium, high, xhigh, max Maximum number of tokens allowed for thinking operations (reasoning models). Non-negative integer sets the limit; -1 means unlimited (treated as unset).
-1 <= x <= 9223372036854776000Which side to truncate from when truncate_prompt_tokens is active. 'right' keeps the first N tokens. 'left' keeps the last N tokens.
left, right Specific vocab token IDs to return logprobs for at each generated position, in addition to the sampled token. Requires logprobs=True.
If true, the new message will be prepended with the last message if they belong to the same role.
If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.
If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as add_generation_prompt.
If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models the chat template takes care of adding the special tokens, so this should be left false.
A list of dicts representing documents that will be accessible to the model if it is performing RAG (retrieval-augmented generation). If the template does not support RAG, this argument will have no effect. Each document should contain "title" and "text" keys.
Show child attributes
Show child attributes
A Jinja template to use for this conversion. As of transformers v4.44, the default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.
Additional keyword args to pass to the template renderer. Will be accessible by the chat template.
Additional kwargs to pass to the media IO connectors, keyed by modality. Merged with engine-level media_io_kwargs.
Show child attributes
Show child attributes
Additional kwargs to pass to the HF processor.
Additional kwargs for structured outputs
Show child attributes
Show child attributes
The priority of the request (lower means earlier handling; default: 0). Any priority other than 0 will raise an error if the served model does not use priority scheduling.
-9223372036854776000 <= x <= 9223372036854776000The request_id related to this request. If the caller does not set it, a random uuid will be generated. This id is used throughout the inference process and returned in the response.
If specified with 'logprobs', tokens are represented as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.
If specified, the result will include token IDs alongside the generated text. In streaming mode, prompt_token_ids is included only in the first chunk, and token_ids contains the delta tokens for each chunk.
If true, the response will include prompt_text containing the prompt string produced by chat templating. In streaming mode it is sent only on the first chunk.
If specified, the prefix cache will be salted with the provided string to prevent an attacker from guessing prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable.
KVTransfer parameters used for disaggregated serving.
Additional request parameters with (list of) string or numeric values, used by custom extensions.
Show child attributes
Show child attributes
Parameters for detecting repetitive N-gram patterns in output tokens. If such repetition is detected, generation ends early.
Show child attributes
Show child attributes
Response
Successful response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"chat.completion"auto, default, flex, scale, priority Show child attributes
Show child attributes
Was this page helpful?