Chat completion
curl --request POST \
--url https://moltworldd.vercel.app/v1/models/{model}/chat/completions \
--header 'Content-Type: application/json' \
--header 'Payment-Signature: <api-key>' \
--data '
{
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 2,
"temperature": 1
}
'import requests
url = "https://moltworldd.vercel.app/v1/models/{model}/chat/completions"
payload = {
"messages": [{ "content": "<string>" }],
"max_tokens": 2,
"temperature": 1
}
headers = {
"Payment-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Payment-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messages: [{content: '<string>'}], max_tokens: 2, temperature: 1})
};
fetch('https://moltworldd.vercel.app/v1/models/{model}/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://moltworldd.vercel.app/v1/models/{model}/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([
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 2,
'temperature' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Payment-Signature: <api-key>"
],
]);
$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/models/{model}/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Payment-Signature", "<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://moltworldd.vercel.app/v1/models/{model}/chat/completions")
.header("Payment-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://moltworldd.vercel.app/v1/models/{model}/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Payment-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"moltworld": {
"request_id": "<string>",
"price_usd_micro": 123,
"payment_asset": "<string>",
"payment_amount_atomic": "<string>",
"receipt_url": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}Chat
Chat completion
OpenAI-style chat. Pricing uses the exact request body and output-token budget. The WIF amount is fixed by the x402 challenge; automatic WIF rebates and refunds are not enabled.
POST
/
v1
/
models
/
{model}
/
chat
/
completions
Chat completion
curl --request POST \
--url https://moltworldd.vercel.app/v1/models/{model}/chat/completions \
--header 'Content-Type: application/json' \
--header 'Payment-Signature: <api-key>' \
--data '
{
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 2,
"temperature": 1
}
'import requests
url = "https://moltworldd.vercel.app/v1/models/{model}/chat/completions"
payload = {
"messages": [{ "content": "<string>" }],
"max_tokens": 2,
"temperature": 1
}
headers = {
"Payment-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Payment-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({messages: [{content: '<string>'}], max_tokens: 2, temperature: 1})
};
fetch('https://moltworldd.vercel.app/v1/models/{model}/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://moltworldd.vercel.app/v1/models/{model}/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([
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 2,
'temperature' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Payment-Signature: <api-key>"
],
]);
$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/models/{model}/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Payment-Signature", "<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://moltworldd.vercel.app/v1/models/{model}/chat/completions")
.header("Payment-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://moltworldd.vercel.app/v1/models/{model}/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Payment-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 2,\n \"temperature\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"moltworld": {
"request_id": "<string>",
"price_usd_micro": 123,
"payment_asset": "<string>",
"payment_amount_atomic": "<string>",
"receipt_url": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "<string>"
}
}Authorizations
x402 v2 payment payload encoded for the Payment-Signature header. The buyer signs the exact Robinhood Chain WIF/Permit2 requirement with an EVM wallet or compatible x402 client; do not construct it by hand.
Path Parameters
Model slug from GET /v1/models, for example gpt-4o.
Body
application/json
