Bring offchain answers into your contract.
Somnia Agents let smart contracts query public APIs, run deterministic AI models and parse websites. A subcommittee of validators runs each request, agrees on the result and returns it to the contract with signed execution receipts.
Read the docs- RequestcreateRequest()payload + deposit
- ElectSomniaAgentselects 3 validators
- ExecuteValidator 1 · 2 · 3sandbox · receipt
- AgreeConsensusmajority or threshold
- DeliverhandleResponse()result + receipts
- Pay per requestfees set per agent and per validator
| Validator | Result | Receipt | Status |
|---|---|---|---|
| 0x8f3a…21c4 | true | 0x5d07…a9e1 | Running |
| 0x2b91…7e05 | true | 0x91c4…03bd | Running |
| 0xc604…9a38 | true | 0x3e6f…d572 | Running |
- Validators you can set per advanced request
- Up to 10
- Validators you can set per advanced request
- Validators in the default subcommittee per request
- 3
- Validators in the default subcommittee per request
- Somnia Agents docs
- Consensus types per request: majority and threshold
- 2
- Consensus types per request: majority and threshold
- Somnia docs, Invoking from Solidity
- Fee the platform contract takes; unused deposit is rebated
- 0%
- Fee the platform contract takes; unused deposit is rebated
Answers your contract can check.
Remove the trusted middleman
A subcommittee of validators runs each request and must agree on the result, so no single server decides what your contract receives.
Keep a receipt for every result
Every response comes with a signed execution receipt you can use in an audit or a dispute.
Bring AI into contract logic
Run deterministic language models from a contract and act on the agreed answer.
Pick the agent for the job.
JSON API Request
Fetch a string, number, flag or array from any public JSON endpoint with a selector path.
- fetchUint(url, selector, decimals)
- Priced per request in SOMI; see the docs for current prices
LLM Inference
Run deterministic language models from a contract, including MCP and onchain tool calls.
- 4 output modes
- Priced per request in SOMI; see the docs for current prices
LLM Parse Website
Read a web page and return a structured answer to a question about it.
- Question in, structured answer out
- Priced per request in SOMI; see the docs for current prices
Automate decisions you can audit.
Resolve outcomes without a resolution desk
Somnia Agents structure, create and resolve every market on Prophecy Social without manual intervention, and run the agent committees behind Somnia Oracle.
33.1K
Prophecy Social
33.1K users as of 1 Sep 2026
- Question
- Has the venue published its 2026 annual report?
- Agent
- LLM Parse Website
- Sources
- 2 public web pages
- Subcommittee
- 5 validators
- Consensus
- Threshold, 3 of 5
- Result
- Agreed answer with receipts
- Receipts
- 5, one per validator
How an agent request runs.
- requestId
- 48213
- subcommittee
- 3 validators
- status
- 2 · Success
- responses
- 3 of 3 submitted
- consensus
- Majority
- result
- abi-encoded uint256
- receipt
- 0x5d07…a9e1, per validator
- rebate
- Unused deposit returned
- Check that msg.sender is the platform contract.
- Track pending request IDs.
- Handle Failed and TimedOut as well as Success.
- Add receive() so rebates can reach your contract.
- Send getRequestDeposit() plus the agent price times the subcommittee size.
AgentConsumer.sol, adapted from the Somnia Agents docs
Try it in the browser, ship it in a contract.
Try an agent in the browser
Browse agents, invoke methods, inspect receipts and generate Solidity or TypeScript code from the Agent Explorer.
Open Agent ExplorerCall an agent from your code
From Solidity, call createRequest() or createAdvancedRequest() and receive the result in a callback. From TypeScript, send the transaction and listen for the response event.
- Mainnet chain ID 5031
- Platform contract 0x5E5205CF39E766118C01636bED000A54D93163E6
Set the rules for every request.
Set how much agreement each answer needs
Choose subcommittee size, threshold and consensus type for each request.
Keep proof of what each validator ran
Each validator that runs the request signs its own receipt.
Pay only for what a request uses
You pay per agent and per validator, and any unused deposit comes back to you.
Put a deadline on advanced requests
Advanced requests set their own deadline, after which the request closes as timed out.
Know how every request ended
Every request ends as Success, Failed or TimedOut, and your callback hears which.
Skip writing the call by hand
The Agent Explorer writes the Solidity or TypeScript call for any agent method.
Put an agent behind your contract.
Try an agent in the browser, or talk to the team about what your contract needs to know.
Read: Somnia, the Agentic L1