Text Chat
curl --request POST \
--url https://geoff.ai/api/v1/text/chat \
--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,
"stream": false,
"top_p": 1
}
'import requests
url = "https://geoff.ai/api/v1/text/chat"
payload = {
"model": "magma",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"temperature": 1,
"stream": False,
"top_p": 1
}
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,
stream: false,
top_p: 1
})
};
fetch('https://geoff.ai/api/v1/text/chat', 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/text/chat",
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,
'stream' => false,
'top_p' => 1
]),
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/text/chat"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"stream\": false,\n \"top_p\": 1\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/text/chat")
.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 \"stream\": false,\n \"top_p\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/text/chat")
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 \"stream\": false,\n \"top_p\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "magma",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}
Text
Text Chat
Send a chat completion request.
POST
/
v1
/
text
/
chat
Text Chat
curl --request POST \
--url https://geoff.ai/api/v1/text/chat \
--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,
"stream": false,
"top_p": 1
}
'import requests
url = "https://geoff.ai/api/v1/text/chat"
payload = {
"model": "magma",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"temperature": 1,
"stream": False,
"top_p": 1
}
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,
stream: false,
top_p: 1
})
};
fetch('https://geoff.ai/api/v1/text/chat', 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/text/chat",
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,
'stream' => false,
'top_p' => 1
]),
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/text/chat"
payload := strings.NewReader("{\n \"model\": \"magma\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"temperature\": 1,\n \"stream\": false,\n \"top_p\": 1\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/text/chat")
.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 \"stream\": false,\n \"top_p\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geoff.ai/api/v1/text/chat")
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 \"stream\": false,\n \"top_p\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "magma",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "magma",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}
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.
Whether to stream the response via SSE.
Nucleus sampling parameter.