Get a quote
curl --request POST \
--url https://moltworldd.vercel.app/v1/quote \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 200
}
'import requests
url = "https://moltworldd.vercel.app/v1/quote"
payload = {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 200
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-4o', messages: [{role: 'user', content: 'Hello'}], max_tokens: 200})
};
fetch('https://moltworldd.vercel.app/v1/quote', 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://moltworldd.vercel.app/v1/quote",
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' => 'gpt-4o',
'messages' => [
[
'role' => 'user',
'content' => 'Hello'
]
],
'max_tokens' => 200
]),
CURLOPT_HTTPHEADER => [
"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://moltworldd.vercel.app/v1/quote"
payload := strings.NewReader("{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
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://moltworldd.vercel.app/v1/quote")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://moltworldd.vercel.app/v1/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"name": "<string>",
"available": true,
"endpoint": "<string>",
"payment_flow": "authorization",
"quote": {
"modelSlug": "<string>",
"modality": "chat",
"units": {
"estimatedInputTokens": 123,
"maxOutputTokens": 123
},
"costBasis": {
"kind": "tokens",
"inputPerMillionUsd": 123,
"outputPerMillionUsd": 123
},
"upstreamCostUsd": 123,
"marginPercent": 123,
"finalPriceUsd": 123,
"formattedPrice": "<string>",
"microUsdc": 123,
"costSource": "static",
"amountAtomic": "<string>",
"asset": "<string>",
"symbol": "WIF",
"decimals": 18,
"network": "eip155:4663",
"wifPrice": {
"source": "<string>",
"priceUsd": "<string>",
"observedAt": "2023-11-07T05:31:56Z",
"liquidityUsd": 123
}
},
"note": "<string>"
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}Pricing and catalog
Get a quote
Free exact price quote for a validated chat request body, without paying. For the same request body, the WIF atomic amount is quote-bound to the 402 challenge; that signed challenge is authoritative.
POST
/
v1
/
quote
Get a quote
curl --request POST \
--url https://moltworldd.vercel.app/v1/quote \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 200
}
'import requests
url = "https://moltworldd.vercel.app/v1/quote"
payload = {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 200
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({model: 'gpt-4o', messages: [{role: 'user', content: 'Hello'}], max_tokens: 200})
};
fetch('https://moltworldd.vercel.app/v1/quote', 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://moltworldd.vercel.app/v1/quote",
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' => 'gpt-4o',
'messages' => [
[
'role' => 'user',
'content' => 'Hello'
]
],
'max_tokens' => 200
]),
CURLOPT_HTTPHEADER => [
"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://moltworldd.vercel.app/v1/quote"
payload := strings.NewReader("{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}")
req, _ := http.NewRequest("POST", url, payload)
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://moltworldd.vercel.app/v1/quote")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://moltworldd.vercel.app/v1/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello\"\n }\n ],\n \"max_tokens\": 200\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"name": "<string>",
"available": true,
"endpoint": "<string>",
"payment_flow": "authorization",
"quote": {
"modelSlug": "<string>",
"modality": "chat",
"units": {
"estimatedInputTokens": 123,
"maxOutputTokens": 123
},
"costBasis": {
"kind": "tokens",
"inputPerMillionUsd": 123,
"outputPerMillionUsd": 123
},
"upstreamCostUsd": 123,
"marginPercent": 123,
"finalPriceUsd": 123,
"formattedPrice": "<string>",
"microUsdc": 123,
"costSource": "static",
"amountAtomic": "<string>",
"asset": "<string>",
"symbol": "WIF",
"decimals": 18,
"network": "eip155:4663",
"wifPrice": {
"source": "<string>",
"priceUsd": "<string>",
"observedAt": "2023-11-07T05:31:56Z",
"liquidityUsd": 123
}
},
"note": "<string>"
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}