> This page is for version v1.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.agentverse.ai/v-2/llms.txt
> - v1: https://docs.agentverse.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.agentverse.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.agentverse.ai/_mcp/server.

# Create New Team Agent

POST https://agentverse.ai/v1/hosting/teams/{slug}/agents
Content-Type: application/json

Reference: https://docs.agentverse.ai/v-1/api-reference/hosting-v-1/create-team-agent

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `slug` (string, required)

### Query parameters

- `no_cache` (boolean, optional, default: false)

### Body (application/json)

This endpoint expects a NewAgent.

- `name` (string, required) — Name of the new agent.
- `readme` (string, optional) — Readme content for the agent.
- `avatar_url` (string, optional) — URL of the agent's avatar.
- `short_description` (string, optional) — Brief description.
- `network` (enum, optional) — Network on which the agent will register (mainnet or testnet)
  - Allowed values: `mainnet`, `testnet`

## Response

### 200

Successful Response

- `name` (string, required) — Name of the agent.
- `address` (string, required) — Bech32 address of the agent.
- `running` (boolean, required) — Whether the agent is currently running.
- `revision` (integer, required) — Revision number of the agent.
- `domain` (string, optional) — Domain name associated with the agent.
- `prefix` (enum, optional, default: test-agent) — Address prefix of the agent.
  - Allowed values: `agent`, `test-agent`
- `compiled` (boolean, optional) — Whether the agent code has been compiled.
- `code_digest` (string, optional) — Digest of the agent's code.
- `wallet_address` (string, optional) — Wallet address of the agent.
- `code_update_timestamp` (string, optional) — Last time the code was updated.
- `creation_timestamp` (string, optional) — Time when the agent was created.
- `avatar_url` (string, optional) — URL to the agent's avatar image.
- `maintainer_id` (string, optional) — ID of the user maintaining the agent.
- `readme` (string, optional) — README description of the agent.
- `short_description` (string, optional) — Short description for display.
- `metadata` (AgentMetadata, optional) — Metadata associated with the agent.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### AgentMetadata

Model used to validate metadata for an agent. Framework specific fields will be added here to ensure valid serialization. Additional fields will simply be passed through.

- `geolocation` (AgentMetadataGeolocation, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### AgentMetadataGeolocation

- AgentGeoLocation: AgentGeoLocation
- AgentGeoLocationDetails: AgentGeoLocationDetails

### ValidationErrorLocItems

- string
- integer

### AgentGeoLocation

- `latitude` (double, required)
- `longitude` (double, required)
- `radius` (double, optional)

### AgentGeoLocationDetails

- `name` (string, optional) — the full agent location
- `description` (string, optional) — the description of the agent location
- `latitude` (double, optional) — the latitude of the agent location
- `longitude` (double, optional) — the longitude of the agent location
- `street` (string, optional) — the street where the agent is located
- `city` (string, optional) — the city where the agent is located
- `state` (string, optional) — the state where the agent is located
- `postal_code` (string, optional) — the postal code where the agent is located
- `country` (string, optional) — the country where the agent is located
- `url` (string, optional) — the url belonging to the agent location
- `image_url` (string, optional) — the image url belonging to the agent location

## Examples

**Request**

```json
{
  "name": "foo"
}
```

**Response**

```json
{
  "name": "foo",
  "address": "foo",
  "running": true,
  "revision": 42,
  "domain": "foo",
  "prefix": "agent",
  "compiled": true,
  "code_digest": "foo",
  "wallet_address": "foo",
  "code_update_timestamp": "foo",
  "creation_timestamp": "foo",
  "avatar_url": "foo",
  "maintainer_id": "foo",
  "readme": "foo",
  "short_description": "foo",
  "metadata": {
    "geolocation": {
      "latitude": 42,
      "longitude": 42,
      "radius": 42
    }
  }
}
```

**SDK Code**

```python hostingV1CreateTeamAgentExample
import requests

url = "https://agentverse.ai/v1/hosting/teams/slug/agents"

payload = { "name": "foo" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript hostingV1CreateTeamAgentExample
const url = 'https://agentverse.ai/v1/hosting/teams/slug/agents';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"foo"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go hostingV1CreateTeamAgentExample
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://agentverse.ai/v1/hosting/teams/slug/agents"

	payload := strings.NewReader("{\n  \"name\": \"foo\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby hostingV1CreateTeamAgentExample
require 'uri'
require 'net/http'

url = URI("https://agentverse.ai/v1/hosting/teams/slug/agents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"foo\"\n}"

response = http.request(request)
puts response.read_body
```

```java hostingV1CreateTeamAgentExample
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://agentverse.ai/v1/hosting/teams/slug/agents")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"foo\"\n}")
  .asString();
```

```php hostingV1CreateTeamAgentExample
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://agentverse.ai/v1/hosting/teams/slug/agents', [
  'body' => '{
  "name": "foo"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp hostingV1CreateTeamAgentExample
using RestSharp;

var client = new RestClient("https://agentverse.ai/v1/hosting/teams/slug/agents");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"foo\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift hostingV1CreateTeamAgentExample
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["name": "foo"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://agentverse.ai/v1/hosting/teams/slug/agents")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```