Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deploy Python code as a hosted agent on Fetch.ai's Agentverse. Creates a new agent, uploads code, and optionally starts it. Handles the tricky code upload format automatically. Requires AGENTVERSE_API_KEY env var. Use when asked to deploy, host, or publish an agent on Agentverse.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -41% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -22% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 10% | 0% |
Deploy Python code as a hosted agent on Agentverse. The agent runs on Fetch.ai's infrastructure — no server needed. Creates the agent, uploads code in the correct format, and optionally starts it.
AGENTVERSE_API_KEY environment variable setrequestsbashpython3 scripts/deploy_agent.py --name "my-agent" --file ./my_agent_code.py --start
bashpython3 scripts/deploy_agent.py --name "hello-agent" --code ' @agent.on_event("startup") async def hello(ctx): ctx.logger.info("Hello from my agent!") '
json{ "status": "success", "name": "my-agent", "address": "agent1q...", "running": true }
Your code MUST follow these rules for the hosted environment:
Agent() instance — agent is pre-created by the platformagent.run() — the platform manages the lifecycle@agent.on_event("startup") for initializationctx.logger.info() for output (no print/stdout)Protocol objects and agent.include() for message handlingpythonfrom uagents import Context, Protocol @agent.on_event("startup") async def startup(ctx: Context): ctx.logger.info(f"Agent started: {ctx.agent.address}") @agent.on_interval(period=60.0) async def periodic(ctx: Context): ctx.logger.info("Running periodic task...")
pythonfrom datetime import datetime from uuid import uuid4 from uagents import Context, Protocol from uagents_core.contrib.protocols.chat import ( ChatMessage, ChatAcknowledgement, TextContent, chat_protocol_spec ) protocol = Protocol(spec=chat_protocol_spec) @protocol.on_message(ChatMessage) async def handle(ctx: Context, sender: str, msg: ChatMessage): response = ChatMessage( timestamp=datetime.now(), msg_id=uuid4(), content=[TextContent(type="text", text="Hello! I received your message.")] ) await ctx.send(sender, response) agent.include(protocol, publish_manifest=True)
The API expects a specific format:
pythonimport json files = [{"language": "python", "name": "agent.py", "value": your_code_string}] payload = {"code": json.dumps(files)} # code is a JSON STRING of a list
The deploy script handles this automatically.
agentverse-manage logs)uagents + uagents_core available in hosted envOther measured skills in the registry, with their headline benchmark lift.