Skip to main content
POST
/
workspace
/
{workspace_id}
/
agent
Create a new agent using XanoScript
curl --request POST \
  --url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/agent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: text/x-xanoscript' \
  --data 'agent foo {
  canonical = "custom"
  llm = {
    type         : "anthropic"
    system_prompt: "You are a helpful AI Agent."
    max_steps    : 5
    prompt       : ""
    model        : "claude-4-sonnet-20250514"
    temperature  : 1
    reasoning    : true
    baseURL      : ""
    headers      : ""
  }
}
'
{
  "id": 1,
  "created_at": "2023-04-19 21:01:32+0000",
  "updated_at": "2023-04-19 21:01:32+0000",
  "name": "Agent Test",
  "description": "My agent description",
  "branch": "v1",
  "llm": "anthropic",
  "tag": [
    "example tag"
  ],
  "xanoscript": {
    "status": "ok",
    "value": "<string>",
    "message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
integer<int64>
required

Query Parameters

branch
string
default:""
include_xanoscript
boolean
default:false

Body

text/x-xanoscript

The body is of type string.

Example:

"agent foo {\n canonical = \"custom\"\n llm = {\n type : \"anthropic\"\n system_prompt: \"You are a helpful AI Agent.\"\n max_steps : 5\n prompt : \"\"\n model : \"claude-4-sonnet-20250514\"\n temperature : 1\n reasoning : true\n baseURL : \"\"\n headers : \"\"\n }\n}\n"

Response

Success!

id
integer<int64>
default:1
created_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
updated_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
name
string
default:Agent Test
description
string
default:My agent description
branch
string
default:v1
llm
string
default:anthropic
tag
string[]
xanoscript
object