POST
/
v1
/
text
/
chat
curl --request POST \
  --url https://geoff.ai/api/v1/text/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "magma",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "max_tokens": 1024
  }'
{
  "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
  }
}

Authorization

Authorization
string
required
Bearer token. Bearer API_key, can be found in Settings > API Keys.

Request Body

model
enum
default:"magma"
required
The model to use for generation. E.g., magma.
messages
array
required
Array of message objects with role and content fields.
max_tokens
integer
Maximum number of tokens to generate. Default varies by model.
temperature
number
Sampling temperature between 0 and 2. Default: 1.
stream
boolean
Whether to stream the response via SSE. Default: false.
top_p
number
Nucleus sampling parameter. Default: 1.
curl --request POST \
  --url https://geoff.ai/api/v1/text/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "magma",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "max_tokens": 1024
  }'
{
  "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
  }
}