Docs

Somnia Agents / Invoking agents

Quickstart

How agent invocation works, which network to use, and where to explore agents.

This page covers how to invoke Somnia Agents: calling their methods and receiving results.

How agent invocation works

Agent invocations are asynchronous. When you invoke an agent:

  1. You invoke the agent through the platform contract and pay a fee.
  2. The platform contract distributes the request to validator nodes, which execute the agent independently.
  3. Validators reach consensus on the result.
  4. The platform returns the result, and optionally delivers it to a callback.

This decentralized execution makes results trustworthy and auditable.

Network and tokens

Somnia Agents are live on both Somnia Mainnet and Somnia Testnet, on the Global chain and on Tokyo. Pick the chain that matches your deployment target:

Property Global mainnet Global testnet Tokyo mainnet Tokyo testnet
Network name Somnia Mainnet Somnia Testnet Somnia Mainnet Somnia Testnet
Chain ID 5031 50312 50321 50383
RPC URL https://api.infra.mainnet.somnia.network https://api.infra.testnet.somnia.network https://api.tokyo.infra.mainnet.somnia.network https://api.hideki.infra.testnet.somnia.network
Currency SOMI STT SOMI STT
SomniaAgents contract 0x5E5205CF39E766118C01636bED000A54D93163E6 0x037Bb9C718F3f7fe5eCBDB0b600D607b52706776 0x085f05Bc63c3185812f765CbA75F7eeC33e7A3A1 0x7407cb35a17D511D1Bd32dD726ADb8D5344ECbE3

Tokyo runs JSON API Request and Price Oracle. LLM Inference and LLM Parse Website run on the Global chains only.

Get testnet STT from the faucet. For mainnet, acquire SOMI through the usual channels.

Explore agents

The easiest way to get started is the Somnia Explorer: explorer.somnia.network/agents. For testnet, use explorer.testnet.somnia.network/agents; each explorer shows its own network.

In the Somnia Explorer you can:

  • Browse all available agents
  • View agent methods and their parameters
  • Send a request from your wallet with Try it, and follow it to its result
  • Copy a generated Solidity contract or TypeScript script for each method (payload encoding, deposit, createRequest and callback)
  • View requests and their execution receipts

See Using the explorer for a tour of each page.

Invocation methods

There are two ways to invoke agents:

Method Use case Guide
Explorer Exploration, testing, one-off calls Using the explorer
Solidity Smart contract integration, on-chain automation Invoking from Solidity

All agent invocations go through the Solidity platform contract, including requests sent from the explorer.

Next steps

Send feedback

Agents: POST the same to /api/feedback.