OpenAI-Compatible Chat Completions
curl --request POST \
--url https://geoff.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Stack-Id: <x-stack-id>' \
--data '
{
"model": "magma",
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 123,
"temperature": 1,
"top_p": 1,
"stream": false,
"tools": [
{}
]
}
'import requests
url = "https://geoff.ai/api/v1/chat/completions"
payload = {
"model": "magma",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"temperature": 1,
"top_p": 1,
"stream": False,
"tools": [{}]
}
headers = {
"X-Stack-Id": "<x-stack-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Stack-Id': '<x-stack-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'magma',
messages: [{content: '<string>'}],
max_tokens: 123,
temperature: 1,
top_p: 1,
stream: false,
tools: [{}]
})
};
fetch('https://geoff.ai/api/v1/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://geoff.ai/api/v1/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' => 'magma',
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 123,
'temperature' => 1,
'top_p' => 1,
'stream' => false,
'tools' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Stack-Id: <x-stack-id>"
],
]);
$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://geoff.ai/api/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Stack-Id", "<x-stack-id>")
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://geoff.ai/api/v1/chat/completions")
.header("X-Stack-Id", "<x-stack-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Stack-Id"] = '<x-stack-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Text
Compatible OpenAI API
Use the OpenAI-compatible API for text generation.
POST
/
v1
/
chat
/
completions
OpenAI-Compatible Chat Completions
curl --request POST \
--url https://geoff.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Stack-Id: <x-stack-id>' \
--data '
{
"model": "magma",
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 123,
"temperature": 1,
"top_p": 1,
"stream": false,
"tools": [
{}
]
}
'import requests
url = "https://geoff.ai/api/v1/chat/completions"
payload = {
"model": "magma",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"temperature": 1,
"top_p": 1,
"stream": False,
"tools": [{}]
}
headers = {
"X-Stack-Id": "<x-stack-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Stack-Id': '<x-stack-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'magma',
messages: [{content: '<string>'}],
max_tokens: 123,
temperature: 1,
top_p: 1,
stream: false,
tools: [{}]
})
};
fetch('https://geoff.ai/api/v1/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://geoff.ai/api/v1/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' => 'magma',
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 123,
'temperature' => 1,
'top_p' => 1,
'stream' => false,
'tools' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Stack-Id: <x-stack-id>"
],
]);
$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://geoff.ai/api/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Stack-Id", "<x-stack-id>")
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://geoff.ai/api/v1/chat/completions")
.header("X-Stack-Id", "<x-stack-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Stack-Id"] = '<x-stack-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 1,\n \"stream\": false,\n \"tools\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Overview
The Geoff API also exposes an OpenAI-compatible chat completions endpoint. Configure an OpenAI SDK client withhttps://geoff.ai/api/v1.
Configuration
from openai import OpenAI
client = OpenAI(
api_key="your-geoff-api-key",
base_url="https://geoff.ai/api/v1",
)
response = client.chat.completions.create(
model="magma",
messages=[
{"role": "user", "content": "Hello!"}
],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-geoff-api-key",
baseURL: "https://geoff.ai/api/v1",
});
const response = await client.chat.completions.create({
model: "magma",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
curl --request POST \
--url https://geoff.ai/api/v1/chat/completions \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'X-Stack-Id: stk_jmqog66ha0mugmro' \
--header 'Content-Type: application/json' \
--data '{
"model": "magma",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Supported features and limits
The standard chat path accepts text/image messages, conversation history, system/developer instructions, and function tools. It forwardstemperature, top_p, stop, frequency_penalty, presence_penalty, seed, response_format, and parallel_tool_calls to the worker. Model capabilities determine whether each control is available.
max_completion_tokens takes precedence over max_tokens; the cap is constrained by the request budget. Only one completion (n: 1) is supported. Logprobs, logit bias, audio output, predictions, storage, hosted web search, and service-tier selection are unsupported and return validation errors.
Omit stream (or set it to false) for JSON. For SSE, set stream: true. Set stream_options: { include_usage: true } to receive a final usage chunk with an empty choices array. Other chunks then contain usage: null.
reasoning_effort stays on the selected inference path. Stacknet-specific sequential-thinking, multi-model, and media workflows have separate execution contracts; they are not certified against this standard chat parameter subset.
Paid traffic through the current Rust settlement gate is buffered until billing commits, even when SSE was requested. Other paths can stream progressively. Tool arguments may arrive as a complete block after the worker finishes. Disconnecting a client does not guarantee cancellation of inference.
The legacy /api/v1/text/chat endpoint is an alias of /api/v1/chat/completions. Responses include HTTP status codes and request identifiers.Authorizations
Bearer API_key, can be found in Account Management > API Keys.
Headers
Supplied automatically by the documentation playground.
Body
application/json
Select a supported model layer.
Available options:
magma, pyro, pyro:max Array of message objects.
Show child attributes
Show child attributes
Maximum number of tokens to generate.
Sampling temperature between 0 and 2.
Nucleus sampling parameter.
Whether to stream the response via SSE.
Tool definitions for function calling.