> For the complete documentation index, see [llms.txt](https://docs.somnia.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.somnia.network/agents/invoking-agents/quickstart.md).

# Quickstart

This section 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. Your request is sent to the Somnia network
2. Multiple validator nodes execute the agent independently
3. Validators reach consensus on the result
4. The result is returned (and optionally delivered to a callback)

{% @mermaid/diagram content="sequenceDiagram
participant You
participant Platform as Platform Contract
participant Network as Validator Network

```
You->>Platform: Invoke agent + fee
Platform->>Network: Distribute to validators
Network->>Network: Execute & reach consensus
Network->>Platform: Return result
Platform->>You: Deliver result (callback or response)" %}
```

This decentralized execution ensures that results are trustworthy and auditable.

## Network & Tokens

Somnia Agents are live on both **Somnia Mainnet** and **Somnia Testnet**. Pick the network that matches your deployment target:

| Property                | Mainnet                                      | Testnet                                      |
| ----------------------- | -------------------------------------------- | -------------------------------------------- |
| Network Name            | Somnia Mainnet                               | Somnia Testnet                               |
| Chain ID                | `5031`                                       | `50312`                                      |
| RPC URL                 | `https://api.infra.mainnet.somnia.network`   | `https://api.infra.testnet.somnia.network`   |
| Currency                | SOMI                                         | STT                                          |
| `SomniaAgents` Contract | `0x5E5205CF39E766118C01636bED000A54D93163E6` | `0x037Bb9C718F3f7fe5eCBDB0b600D607b52706776` |

Get testnet STT from the [Somnia Faucet](https://testnet.somnia.network). For mainnet, acquire SOMI through the usual channels.

## Explore Agents

The easiest way to get started is the Agent Explorer web app:

| Network | URL                                                                                |
| ------- | ---------------------------------------------------------------------------------- |
| Testnet | [**https://agents.testnet.somnia.network**](https://agents.testnet.somnia.network) |
| Mainnet | [**https://agents.somnia.network**](https://agents.somnia.network)                 |

Here you can:

* Browse all available agents
* View agent methods and their parameters
* Invoke agents directly from the browser
* View execution receipts
* Generate code snippets for Solidity and JavaScript

## Invocation Methods

There are two ways to invoke agents:

| Method       | Use Case                                        | Guide                                                              |
| ------------ | ----------------------------------------------- | ------------------------------------------------------------------ |
| **Web App**  | Exploration, testing, one-off calls             | This page                                                          |
| **Solidity** | Smart contract integration, on-chain automation | [Invoking from Solidity](/agents/invoking-agents/from-solidity.md) |

All agent invocations go through the Solidity platform contract — including calls made from the web app.

## Next Steps

* [Invoking from Solidity](/agents/invoking-agents/from-solidity.md) — Integrate agents into smart contracts
* [Receipts](broken://pages/mMhGrKhRzYkIc9MyZqDZ) — Understand execution receipts
* [Gas Fees](/agents/invoking-agents/gas-fees.md) — Learn about invocation costs


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.somnia.network/agents/invoking-agents/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
