Create agent endpoint
curl --request POST \
--url https://api.x402layer.cc/agent/endpoints \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"origin_url": "<string>",
"chain": "<string>",
"wallet_address": "<string>",
"price": 123,
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"fields": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}
'import requests
url = "https://api.x402layer.cc/agent/endpoints"
payload = {
"slug": "<string>",
"name": "<string>",
"origin_url": "<string>",
"chain": "<string>",
"wallet_address": "<string>",
"price": 123,
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"fields": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
origin_url: '<string>',
chain: '<string>',
wallet_address: '<string>',
price: 123,
api_schema: {
version: 1,
baseUrl: '<string>',
routes: [
{
path: '/users/{id}',
summary: '<string>',
parameters: [
{name: '<string>', required: true, description: '<string>', example: '<string>'}
],
requestBody: {
fields: [
{name: '<string>', required: true, description: '<string>', example: '<string>'}
],
example: '<string>'
},
responseExample: '<string>'
}
]
}
})
};
fetch('https://api.x402layer.cc/agent/endpoints', 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://api.x402layer.cc/agent/endpoints",
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([
'slug' => '<string>',
'name' => '<string>',
'origin_url' => '<string>',
'chain' => '<string>',
'wallet_address' => '<string>',
'price' => 123,
'api_schema' => [
'version' => 1,
'baseUrl' => '<string>',
'routes' => [
[
'path' => '/users/{id}',
'summary' => '<string>',
'parameters' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'example' => '<string>'
]
],
'requestBody' => [
'fields' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'example' => '<string>'
]
],
'example' => '<string>'
],
'responseExample' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.x402layer.cc/agent/endpoints"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.x402layer.cc/agent/endpoints")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x402layer.cc/agent/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyAgent Endpoints
Create agent endpoint
POST
/
agent
/
endpoints
Create agent endpoint
curl --request POST \
--url https://api.x402layer.cc/agent/endpoints \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"origin_url": "<string>",
"chain": "<string>",
"wallet_address": "<string>",
"price": 123,
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"fields": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}
'import requests
url = "https://api.x402layer.cc/agent/endpoints"
payload = {
"slug": "<string>",
"name": "<string>",
"origin_url": "<string>",
"chain": "<string>",
"wallet_address": "<string>",
"price": 123,
"api_schema": {
"version": 1,
"baseUrl": "<string>",
"routes": [
{
"path": "/users/{id}",
"summary": "<string>",
"parameters": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"example": "<string>"
}
],
"requestBody": {
"fields": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"example": "<string>"
}
],
"example": "<string>"
},
"responseExample": "<string>"
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
origin_url: '<string>',
chain: '<string>',
wallet_address: '<string>',
price: 123,
api_schema: {
version: 1,
baseUrl: '<string>',
routes: [
{
path: '/users/{id}',
summary: '<string>',
parameters: [
{name: '<string>', required: true, description: '<string>', example: '<string>'}
],
requestBody: {
fields: [
{name: '<string>', required: true, description: '<string>', example: '<string>'}
],
example: '<string>'
},
responseExample: '<string>'
}
]
}
})
};
fetch('https://api.x402layer.cc/agent/endpoints', 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://api.x402layer.cc/agent/endpoints",
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([
'slug' => '<string>',
'name' => '<string>',
'origin_url' => '<string>',
'chain' => '<string>',
'wallet_address' => '<string>',
'price' => 123,
'api_schema' => [
'version' => 1,
'baseUrl' => '<string>',
'routes' => [
[
'path' => '/users/{id}',
'summary' => '<string>',
'parameters' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'example' => '<string>'
]
],
'requestBody' => [
'fields' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'example' => '<string>'
]
],
'example' => '<string>'
],
'responseExample' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.x402layer.cc/agent/endpoints"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.x402layer.cc/agent/endpoints")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x402layer.cc/agent/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"origin_url\": \"<string>\",\n \"chain\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"price\": 123,\n \"api_schema\": {\n \"version\": 1,\n \"baseUrl\": \"<string>\",\n \"routes\": [\n {\n \"path\": \"/users/{id}\",\n \"summary\": \"<string>\",\n \"parameters\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"requestBody\": {\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"example\": \"<string>\"\n },\n \"responseExample\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Response
Endpoint created
Was this page helpful?
⌘I
