Anthropic-Compatible Messages
curl --request POST \
--url https://geoff.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Stack-Id: <x-stack-id>' \
--data '
{
"model": "magma",
"max_tokens": 123,
"messages": [
{
"content": "<string>"
}
],
"system": "<string>",
"stream": false,
"temperature": 1,
"top_p": 1,
"tools": [
{}
]
}
'import requests
url = "https://geoff.ai/api/v1/messages"
payload = {
"model": "magma",
"max_tokens": 123,
"messages": [{ "content": "<string>" }],
"system": "<string>",
"stream": False,
"temperature": 1,
"top_p": 1,
"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',
max_tokens: 123,
messages: [{content: '<string>'}],
system: '<string>',
stream: false,
temperature: 1,
top_p: 1,
tools: [{}]
})
};
fetch('https://geoff.ai/api/v1/messages', 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/messages",
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',
'max_tokens' => 123,
'messages' => [
[
'content' => '<string>'
]
],
'system' => '<string>',
'stream' => false,
'temperature' => 1,
'top_p' => 1,
'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/messages"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\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/messages")
.header("X-Stack-Id", "<x-stack-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magma\",\n \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"tools\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/messages")
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 \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"tools\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"role": "<string>",
"model": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
],
"stop_reason": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123
}
}Text
Compatible Anthropic API
Use the supported Anthropic Messages API subset for Stacknet inference.
POST
/
v1
/
messages
Anthropic-Compatible Messages
curl --request POST \
--url https://geoff.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Stack-Id: <x-stack-id>' \
--data '
{
"model": "magma",
"max_tokens": 123,
"messages": [
{
"content": "<string>"
}
],
"system": "<string>",
"stream": false,
"temperature": 1,
"top_p": 1,
"tools": [
{}
]
}
'import requests
url = "https://geoff.ai/api/v1/messages"
payload = {
"model": "magma",
"max_tokens": 123,
"messages": [{ "content": "<string>" }],
"system": "<string>",
"stream": False,
"temperature": 1,
"top_p": 1,
"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',
max_tokens: 123,
messages: [{content: '<string>'}],
system: '<string>',
stream: false,
temperature: 1,
top_p: 1,
tools: [{}]
})
};
fetch('https://geoff.ai/api/v1/messages', 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/messages",
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',
'max_tokens' => 123,
'messages' => [
[
'content' => '<string>'
]
],
'system' => '<string>',
'stream' => false,
'temperature' => 1,
'top_p' => 1,
'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/messages"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\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/messages")
.header("X-Stack-Id", "<x-stack-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"magma\",\n \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"tools\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/messages")
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 \"max_tokens\": 123,\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"tools\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"role": "<string>",
"model": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
],
"stop_reason": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123
}
}Overview
Geoff implements a subset of the Anthropic Messages API over Stacknet models. Configure an Anthropic SDK withhttps://geoff.ai/api and use your Geoff API key.
Configuration
import anthropic
client = anthropic.Anthropic(
api_key="your-geoff-api-key",
base_url="https://geoff.ai/api",
)
message = client.messages.create(
model="magma",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello!"}
],
)
print(message.content[0].text)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "your-geoff-api-key",
baseURL: "https://geoff.ai/api",
});
const message = await client.messages.create({
model: "magma",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
console.log(message.content[0].text);
curl --request POST \
--url https://geoff.ai/api/v1/messages \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'X-Stack-Id: stk_jmqog66ha0mugmro' \
--header 'Content-Type: application/json' \
--header 'anthropic-version: 2023-06-01' \
--data '{
"model": "magma",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Supported features and limits
- Text messages, system text/blocks, and conversation history.
- Base64 and URL image blocks, when the selected worker model supports vision.
- Custom tools, tool results, and streamed
tool_use/input_json_deltablocks. Tool arguments currently arrive after the worker completes the tool response. tool_choicevaluesauto,any,tool, andnone;disable_parallel_tool_usemaps to the worker’s parallel-tool setting.- Required positive-integer
max_tokens, temperature from 0 to 1,top_p, and up to fourstop_sequences. - JSON responses by default; SSE when
stream: true.
magma select Stacknet inference. This endpoint does not imply access to Anthropic’s Claude models. Worker capabilities determine whether vision and tool controls are available.
Extended thinking, documents, server tools, top_k, structured output configuration, context/container controls, and max_tokens: 0 cache warming are unsupported and return validation errors.
Paid traffic through the current Rust settlement gate is buffered until billing commits, even when SSE was requested. Other paths can stream progressively. Disconnecting a client does not guarantee cancellation of inference.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 Maximum number of tokens to generate.
Array of message objects with role and content fields.
Show child attributes
Show child attributes
System prompt.
Whether to stream the response via SSE.
Sampling temperature between 0 and 2.
Nucleus sampling parameter.
Tool definitions for function calling.