Quote an inference request
POST
/
v1
/
quotes
Quote an inference request
curl --request POST \
--url https://api.example.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{
"content": "<unknown>"
}
],
"offer": "<string>",
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 123,
"top_p": 123,
"stop": "<string>",
"stream": true,
"tools": [
"<unknown>"
],
"tool_choice": "<unknown>",
"response_format": "<unknown>",
"seed": 123,
"user": "<string>"
}
'import requests
url = "https://api.example.com/v1/quotes"
payload = {
"model": "<string>",
"messages": [{ "content": "<unknown>" }],
"offer": "<string>",
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 123,
"top_p": 123,
"stop": "<string>",
"stream": True,
"tools": ["<unknown>"],
"tool_choice": "<unknown>",
"response_format": "<unknown>",
"seed": 123,
"user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{content: '<unknown>'}],
offer: '<string>',
max_tokens: 2,
max_completion_tokens: 2,
temperature: 123,
top_p: 123,
stop: '<string>',
stream: true,
tools: ['<unknown>'],
tool_choice: '<unknown>',
response_format: '<unknown>',
seed: 123,
user: '<string>'
})
};
fetch('https://api.example.com/v1/quotes', 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://api.example.com/v1/quotes",
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' => '<string>',
'messages' => [
[
'content' => '<unknown>'
]
],
'offer' => '<string>',
'max_tokens' => 2,
'max_completion_tokens' => 2,
'temperature' => 123,
'top_p' => 123,
'stop' => '<string>',
'stream' => true,
'tools' => [
'<unknown>'
],
'tool_choice' => '<unknown>',
'response_format' => '<unknown>',
'seed' => 123,
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.example.com/v1/quotes"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"quote_id": "<string>",
"model": "<string>",
"model_id": "<string>",
"offer_id": "<string>",
"tariff_version": "<string>",
"input_tokens": "<string>",
"max_output_tokens": "<string>",
"wakes_endpoint": true,
"maximum_credits": "<string>",
"expires_at": 123
}{
"error": {
"code": "<string>",
"type": "<string>",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Pattern:
^0x[0-9a-fA-F]{64}$Required range:
x >= 1Required range:
x >= 1Response
Offer-specific maximum credit quote.
Pattern:
^0x[0-9a-fA-F]{64}$Pattern:
^0x[0-9a-fA-F]{64}$Pattern:
^0x[0-9a-fA-F]{64}$Previous
Create a chat completionProxies an OpenAI-compatible request to an eligible provider and meters the response.
Next
⌘I
Quote an inference request
curl --request POST \
--url https://api.example.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{
"content": "<unknown>"
}
],
"offer": "<string>",
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 123,
"top_p": 123,
"stop": "<string>",
"stream": true,
"tools": [
"<unknown>"
],
"tool_choice": "<unknown>",
"response_format": "<unknown>",
"seed": 123,
"user": "<string>"
}
'import requests
url = "https://api.example.com/v1/quotes"
payload = {
"model": "<string>",
"messages": [{ "content": "<unknown>" }],
"offer": "<string>",
"max_tokens": 2,
"max_completion_tokens": 2,
"temperature": 123,
"top_p": 123,
"stop": "<string>",
"stream": True,
"tools": ["<unknown>"],
"tool_choice": "<unknown>",
"response_format": "<unknown>",
"seed": 123,
"user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
messages: [{content: '<unknown>'}],
offer: '<string>',
max_tokens: 2,
max_completion_tokens: 2,
temperature: 123,
top_p: 123,
stop: '<string>',
stream: true,
tools: ['<unknown>'],
tool_choice: '<unknown>',
response_format: '<unknown>',
seed: 123,
user: '<string>'
})
};
fetch('https://api.example.com/v1/quotes', 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://api.example.com/v1/quotes",
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' => '<string>',
'messages' => [
[
'content' => '<unknown>'
]
],
'offer' => '<string>',
'max_tokens' => 2,
'max_completion_tokens' => 2,
'temperature' => 123,
'top_p' => 123,
'stop' => '<string>',
'stream' => true,
'tools' => [
'<unknown>'
],
'tool_choice' => '<unknown>',
'response_format' => '<unknown>',
'seed' => 123,
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.example.com/v1/quotes"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<unknown>\"\n }\n ],\n \"offer\": \"<string>\",\n \"max_tokens\": 2,\n \"max_completion_tokens\": 2,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n \"<unknown>\"\n ],\n \"tool_choice\": \"<unknown>\",\n \"response_format\": \"<unknown>\",\n \"seed\": 123,\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"quote_id": "<string>",
"model": "<string>",
"model_id": "<string>",
"offer_id": "<string>",
"tariff_version": "<string>",
"input_tokens": "<string>",
"max_output_tokens": "<string>",
"wakes_endpoint": true,
"maximum_credits": "<string>",
"expires_at": 123
}{
"error": {
"code": "<string>",
"type": "<string>",
"message": "<string>"
}
}