# Models

## The QuoteResponse object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"QuoteResponse":{"type":"object","description":"Best swap quote across 150+ liquidity sources (0x default) or Uniswap V2/V3/V4","properties":{"sellToken":{"type":"string","description":"Address of the token being sold"},"buyToken":{"type":"string","description":"Address of the token being bought"},"sellAmount":{"type":"string","description":"Sell amount in token base units (wei)"},"buyAmount":{"type":"string","description":"Buy amount in token base units"},"price":{"type":"string","description":"Exchange rate (buy per sell)"},"source":{"type":"string","description":"DEX source routing the quote"},"chain":{"type":"string","description":"Chain the quote is valid on"},"calldata":{"type":"string","description":"Encoded calldata for on-chain execution"},"to":{"type":"string","description":"Contract address to send the swap transaction to"},"value":{"type":"string","description":"ETH value to attach (for native token swaps)"},"gasEstimate":{"type":"string","description":"Estimated gas units for the transaction"}}}}}}
```

## The ChatRequest object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"ChatRequest":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","description":"Conversation history in OpenAI message format","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}}}},"vaultAddress":{"type":"string","description":"RigoBlock vault (smart pool) address for vault-scoped operations"},"contextDocs":{"type":"array","description":"Optional request-scoped context snippets (for example markdown excerpts) injected into the model prompt for this request.","items":{"type":"string"}},"routingMode":{"type":"string","description":"Force Llama-only routing. Omit for the default Kimi K2.6 orchestration.","enum":["llama_only"]},"chain":{"type":"string","description":"Target chain context","default":"base","enum":["base","arbitrum","ethereum","optimism","polygon","bsc","unichain"]}}}}}}
```

## The ChatResponse object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"ChatResponse":{"type":"object","properties":{"message":{"type":"string","description":"AI-generated response text"},"reasoning":{"type":"string","description":"DeepSeek R1 reasoning trace (contents of <think> block). Only present when using Workers AI DeepSeek model."},"modelsUsed":{"type":"array","description":"Ordered list of model identifiers that contributed to this output.","items":{"type":"string"}},"finalModel":{"type":"string","description":"Model that authored the final natural-language output (or 'tooling' when output is tool-native)."},"action":{"type":"object","description":"Executable on-chain action, if applicable","properties":{"type":{"type":"string","enum":["swap","position","analysis"],"description":"Action type"},"to":{"type":"string","description":"Contract address"},"calldata":{"type":"string","description":"Encoded transaction calldata"},"value":{"type":"string","description":"ETH value to attach"},"gasEstimate":{"type":"string","description":"Estimated gas"}}}}}}}}
```

## The X402PaymentRequired object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}}}
```

## The ToolDefinition object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"ToolDefinition":{"type":"object","description":"OpenAI-compatible function schema for a single DeFi tool","required":["name","description","category","parameters","requiresOperatorAuth","readOnly"],"properties":{"name":{"type":"string","description":"Canonical tool name used in POST /api/tools?toolName={name}"},"description":{"type":"string","description":"What the tool does and when to use it"},"category":{"type":"string","description":"Functional group","enum":["Spot Trading","Vault Info","GMX Perpetuals","Uniswap v4 LP","Cross-Chain","GRG Staking","Vault Management","Delegation","TWAP Orders","NAV Sync","Operator Settings","Oracle","Strategy","Other"]},"parameters":{"type":"object","description":"JSON Schema for the tool's arguments object"},"requiresOperatorAuth":{"type":"boolean","description":"If true, the tool can only be invoked when the request includes a valid operator signature"},"readOnly":{"type":"boolean","description":"If true, the tool only reads data and never produces transaction calldata"}}}}}}
```

## The ToolCatalogResponse object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"ToolCatalogResponse":{"type":"object","required":["description","usage","price","toolCount","tools"],"properties":{"description":{"type":"string"},"usage":{"type":"string"},"price":{"type":"string"},"toolCount":{"type":"integer","description":"Total number of tools in the catalog"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolDefinition"}}}},"ToolDefinition":{"type":"object","description":"OpenAI-compatible function schema for a single DeFi tool","required":["name","description","category","parameters","requiresOperatorAuth","readOnly"],"properties":{"name":{"type":"string","description":"Canonical tool name used in POST /api/tools?toolName={name}"},"description":{"type":"string","description":"What the tool does and when to use it"},"category":{"type":"string","description":"Functional group","enum":["Spot Trading","Vault Info","GMX Perpetuals","Uniswap v4 LP","Cross-Chain","GRG Staking","Vault Management","Delegation","TWAP Orders","NAV Sync","Operator Settings","Oracle","Strategy","Other"]},"parameters":{"type":"object","description":"JSON Schema for the tool's arguments object"},"requiresOperatorAuth":{"type":"boolean","description":"If true, the tool can only be invoked when the request includes a valid operator signature"},"readOnly":{"type":"boolean","description":"If true, the tool only reads data and never produces transaction calldata"}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.rigoblock.com/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
