Skip to main content
Start with ZylonGPT to send messages, or use the Workspace API to automate org and project setup.

Prerequisites

  • An API token. See Token Management.
  • Your Zylon hostname (replace {BASE_URL} in the examples).
  • For Workspace API: an account and an organization created in the workspace.

My first Zylon call

1

Send your first message

curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "max_tokens": 64,
    "messages": [
      { "role": "user", "content": "Write a one-sentence product description for Zylon." }
    ]
  }'
Example response (your id and timestamps will differ):
{
  "id": "msg_d88cec8ffdf344dcafddb72026ead6be",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "start_timestamp": "2026-02-06T13:16:10.412540Z",
      "stop_timestamp": "2026-02-06T13:16:10.543884Z",
      "text": "Zylon is a private AI platform for building secure, tool-using assistants and workflows."
    }
  ],
  "model": "private-gpt",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 93,
    "output_tokens": 18
  }
}
2

Stream responses (optional)

Set stream: true to receive Server-Sent Events (SSE).
curl -N -X POST "https://{BASE_URL}/api/gpt/v1/messages" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "model": "default",
    "stream": true,
    "max_tokens": 32,
    "messages": [
      { "role": "user", "content": "Give a three-word tagline for a productivity app." }
    ]
  }'
Example streamed events (truncated):
event: message_start
data: {"type":"message_start","message":{"id":"msg_b55d29718361410bad4f80f8f67c6b72","type":"message","role":"assistant","content":[],"model":"private-gpt","usage":{}}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"block_id":"block_019c331ac11375cea03f7e0fb7a2a044","delta":{"type":"text_delta","text":"Focus"}}

event: message_stop
data: {"type":"message_stop"}

Next steps

Troubleshooting

  • 401/403: Your token is invalid or expired. See Token Management.
  • 404: Check your base URL. For ZylonGPT, use https://{BASE_URL}/api/gpt/v1/.
  • 400 (model not found): Use "model": "default" unless you’ve been given a specific model name.
  • 405: You’re using the wrong method. /messages is POST.