Skip to main content

Endpoint

POST /v1/chat/completions
Send messages to Mako and receive a response. Tool calling is handled server-side — the response you receive is the final answer after all tools have been executed.

Headers

Content-Type
string
required
application/json
x-wallet-address
string
required
An EVM wallet address. Used for authentication and credit tracking.
Authorization
string
Bearer YOUR_API_KEY — Required when the gateway is not running in free mode.

Request body

messages
array
required
An array of message objects. Each message has a role ("system", "user", or "assistant") and content (string).
model
string
default:"operator"
Which model to use:
  • "conductor" — 32B model via RunPod. Requires stream: false.
  • "operator" — 8B model via Ollama. Supports streaming.
stream
boolean
default:"false"
When true, the response is delivered as Server-Sent Events. See Streaming.

Response

Standard OpenAI Chat Completion object:
{
  "id": "chatcmpl-1718464968543",
  "object": "chat.completion",
  "created": 1718464968,
  "model": "mako-8b-operator",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "eth is sitting at $1,665 right now."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1931,
    "completion_tokens": 63,
    "total_tokens": 1994
  }
}
id
string
Unique completion identifier.
object
string
Always "chat.completion".
model
string
The model that generated the response.
choices
array
Array with a single choice containing the assistant’s message and finish_reason.
usage
object
Token counts: prompt_tokens, completion_tokens, total_tokens.

Error responses

StatusMeaning
400Missing or invalid messages array.
401Missing wallet address or invalid API key.
402Insufficient credits.
502Model backend error or cold start. The error field will indicate if the model is warming up.
{
  "error": "mako is waking up -- the model is cold starting. try again in about 30 seconds.",
  "details": "503 Service Unavailable"
}

Example: multi-tool query

curl -X POST https://gateway.deepmako.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-wallet-address: 0x0000000000000000000000000000000000000001" \
  -d '{
    "model": "conductor",
    "messages": [
      {"role": "user", "content": "how many transactions has vitalik.eth sent on ethereum?"}
    ],
    "stream": false
  }'
The gateway will resolve the ENS name, fetch the transaction count, and return a natural language answer — all in a single response.