> For the complete documentation index, see [llms.txt](https://docs.opinion.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opinion.trade/developer-guide/opinion-open-api/models.md).

# Models

## The APIBaseResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"APIBaseResponse":{"type":"object","properties":{"code":{"type":"integer","description":"Response code (0 for success)"},"msg":{"type":"string","description":"Response message"},"result":{"type":"object","description":"Response data"}}}}}}
```

## The AuthAPIBaseResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"AuthAPIBaseResponse":{"type":"object","description":"Envelope used by the Auth endpoints. Unlike the data endpoints, the outcome is reported in `errno` / `errmsg`.","properties":{"errno":{"type":"integer","description":"Business result code (0 for success; see the Authentication section for the full list)"},"errmsg":{"type":"string","description":"Error message (empty on success)"},"result":{"type":"object","description":"Response data"}}}}}}
```

## The ApiKeyCredential object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ApiKeyCredential":{"type":"object","properties":{"apiKey":{"type":"string","description":"The API key for the `apikey` request header"},"walletAddress":{"type":"string","description":"Wallet address the key belongs to"}}}}}}
```

## The DeleteApiKeyResult object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"DeleteApiKeyResult":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}}
```

## The QuoteTokenBalance object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"QuoteTokenBalance":{"type":"object","properties":{"quoteToken":{"type":"string","description":"Quote token address"},"tokenDecimals":{"type":"integer","description":"Token decimals"},"totalBalance":{"type":"string","description":"Total balance (formatted with decimals)"},"availableBalance":{"type":"string","description":"Available balance (formatted with decimals)"},"frozenBalance":{"type":"string","description":"Frozen balance (formatted with decimals)"}}}}}}
```

## The MarketListResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"MarketListResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of markets"},"list":{"type":"array","items":{"$ref":"#/components/schemas/MarketData"}}}},"MarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"status":{"type":"integer","description":"Market status: 1=Created, 2=Activated, 3=Resolving, 4=Resolved, 5=Failed, 6=Deleted","enum":[1,2,3,4,5,6]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Created","Activated","Resolving","Resolved","Failed","Deleted"]},"marketType":{"type":"integer","description":"Market type: 0=Binary, 1=Categorical","enum":[0,1]},"childMarkets":{"type":"array","items":{"$ref":"#/components/schemas/ChildMarketData"},"description":"Child markets (for categorical markets)"},"yesLabel":{"type":"string","description":"Yes outcome label"},"noLabel":{"type":"string","description":"No outcome label"},"rules":{"type":"string","description":"Market rules"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"conditionId":{"type":"string","description":"Condition ID"},"resultTokenId":{"type":"string","description":"Result token ID (after resolution)"},"volume":{"type":"string","description":"Total trading volume"},"volume24h":{"type":"string","description":"24-hour trading volume"},"volume7d":{"type":"string","description":"7-day trading volume"},"quoteToken":{"type":"string","description":"Quote token address"},"chainId":{"type":"string","description":"Chain ID"},"questionId":{"type":"string","description":"Question ID"},"incentiveFactor":{"type":"object","description":"Incentive factor (masked as empty object)"},"collection":{"$ref":"#/components/schemas/CollectionDataOpenAPI","description":"Collection market detail if any"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"},"cutoffAt":{"type":"integer","format":"int64","description":"Cutoff timestamp"},"resolvedAt":{"type":"integer","format":"int64","description":"Resolution timestamp"},"labels":{"type":"array","items":{"type":"string"},"description":"Category label names for this market. Aligned by index with labelIds\n(labels[i] corresponds to labelIds[i]). A market may have multiple labels.\n"},"labelIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Category label ids for this market. Aligned by index with labels.\nUse these for stable filtering via GET /market?labelId=<id> — names\nmay be renamed by operators.\n"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"ChildMarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"yesLabel":{"type":"string"},"noLabel":{"type":"string"},"rules":{"type":"string"},"yesTokenId":{"type":"string"},"noTokenId":{"type":"string"},"conditionId":{"type":"string"},"resultTokenId":{"type":"string"},"volume":{"type":"string"},"quoteToken":{"type":"string"},"chainId":{"type":"string"},"questionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"cutoffAt":{"type":"integer","format":"int64"},"resolvedAt":{"type":"integer","format":"int64"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"MarketResolutionSummary":{"type":"object","description":"Resolution lifecycle snapshot. Omitted while no resolution proposal is visible for the market (and for categorical parents). Full lifecycle detail is on the Resolution endpoints.","properties":{"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Current resolution phase"},"proposedTokenId":{"type":"string","description":"Token ID the proposal resolves as the winner (\"draw\" for a tie proposal)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Unix seconds; end of the dispute window for the proposal. Null when not applicable (e.g. auto-resolved markets)"}}},"CollectionDataOpenAPI":{"type":"object","description":"Collection market data (for recurring/time-series markets)","properties":{"title":{"type":"string","description":"Collection title"},"symbol":{"type":"string","description":"Collection symbol"},"frequency":{"type":"string","description":"Collection frequency (e.g., daily, weekly)"},"current":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI","description":"Current period market data"},"next":{"type":"array","items":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI"},"description":"Upcoming period markets"}}},"CollectionMarketDataOpenAPI":{"type":"object","description":"Collection market period data","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"period":{"type":"string","description":"Period identifier"},"startTime":{"type":"integer","format":"int64","description":"Period start timestamp"},"endTime":{"type":"integer","format":"int64","description":"Period end timestamp"},"startPrice":{"type":"string","description":"Starting price for this period"},"endPrice":{"type":"string","description":"Ending price for this period"}}}}}}
```

## The MarketDetailResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"MarketDetailResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketData"}}},"MarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"status":{"type":"integer","description":"Market status: 1=Created, 2=Activated, 3=Resolving, 4=Resolved, 5=Failed, 6=Deleted","enum":[1,2,3,4,5,6]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Created","Activated","Resolving","Resolved","Failed","Deleted"]},"marketType":{"type":"integer","description":"Market type: 0=Binary, 1=Categorical","enum":[0,1]},"childMarkets":{"type":"array","items":{"$ref":"#/components/schemas/ChildMarketData"},"description":"Child markets (for categorical markets)"},"yesLabel":{"type":"string","description":"Yes outcome label"},"noLabel":{"type":"string","description":"No outcome label"},"rules":{"type":"string","description":"Market rules"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"conditionId":{"type":"string","description":"Condition ID"},"resultTokenId":{"type":"string","description":"Result token ID (after resolution)"},"volume":{"type":"string","description":"Total trading volume"},"volume24h":{"type":"string","description":"24-hour trading volume"},"volume7d":{"type":"string","description":"7-day trading volume"},"quoteToken":{"type":"string","description":"Quote token address"},"chainId":{"type":"string","description":"Chain ID"},"questionId":{"type":"string","description":"Question ID"},"incentiveFactor":{"type":"object","description":"Incentive factor (masked as empty object)"},"collection":{"$ref":"#/components/schemas/CollectionDataOpenAPI","description":"Collection market detail if any"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"},"cutoffAt":{"type":"integer","format":"int64","description":"Cutoff timestamp"},"resolvedAt":{"type":"integer","format":"int64","description":"Resolution timestamp"},"labels":{"type":"array","items":{"type":"string"},"description":"Category label names for this market. Aligned by index with labelIds\n(labels[i] corresponds to labelIds[i]). A market may have multiple labels.\n"},"labelIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Category label ids for this market. Aligned by index with labels.\nUse these for stable filtering via GET /market?labelId=<id> — names\nmay be renamed by operators.\n"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"ChildMarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"yesLabel":{"type":"string"},"noLabel":{"type":"string"},"rules":{"type":"string"},"yesTokenId":{"type":"string"},"noTokenId":{"type":"string"},"conditionId":{"type":"string"},"resultTokenId":{"type":"string"},"volume":{"type":"string"},"quoteToken":{"type":"string"},"chainId":{"type":"string"},"questionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"cutoffAt":{"type":"integer","format":"int64"},"resolvedAt":{"type":"integer","format":"int64"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"MarketResolutionSummary":{"type":"object","description":"Resolution lifecycle snapshot. Omitted while no resolution proposal is visible for the market (and for categorical parents). Full lifecycle detail is on the Resolution endpoints.","properties":{"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Current resolution phase"},"proposedTokenId":{"type":"string","description":"Token ID the proposal resolves as the winner (\"draw\" for a tie proposal)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Unix seconds; end of the dispute window for the proposal. Null when not applicable (e.g. auto-resolved markets)"}}},"CollectionDataOpenAPI":{"type":"object","description":"Collection market data (for recurring/time-series markets)","properties":{"title":{"type":"string","description":"Collection title"},"symbol":{"type":"string","description":"Collection symbol"},"frequency":{"type":"string","description":"Collection frequency (e.g., daily, weekly)"},"current":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI","description":"Current period market data"},"next":{"type":"array","items":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI"},"description":"Upcoming period markets"}}},"CollectionMarketDataOpenAPI":{"type":"object","description":"Collection market period data","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"period":{"type":"string","description":"Period identifier"},"startTime":{"type":"integer","format":"int64","description":"Period start timestamp"},"endTime":{"type":"integer","format":"int64","description":"Period end timestamp"},"startPrice":{"type":"string","description":"Starting price for this period"},"endPrice":{"type":"string","description":"Ending price for this period"}}}}}}
```

## The CollectionMarketDataOpenAPI object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"CollectionMarketDataOpenAPI":{"type":"object","description":"Collection market period data","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"period":{"type":"string","description":"Period identifier"},"startTime":{"type":"integer","format":"int64","description":"Period start timestamp"},"endTime":{"type":"integer","format":"int64","description":"Period end timestamp"},"startPrice":{"type":"string","description":"Starting price for this period"},"endPrice":{"type":"string","description":"Ending price for this period"}}}}}}
```

## The CollectionDataOpenAPI object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"CollectionDataOpenAPI":{"type":"object","description":"Collection market data (for recurring/time-series markets)","properties":{"title":{"type":"string","description":"Collection title"},"symbol":{"type":"string","description":"Collection symbol"},"frequency":{"type":"string","description":"Collection frequency (e.g., daily, weekly)"},"current":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI","description":"Current period market data"},"next":{"type":"array","items":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI"},"description":"Upcoming period markets"}}},"CollectionMarketDataOpenAPI":{"type":"object","description":"Collection market period data","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"period":{"type":"string","description":"Period identifier"},"startTime":{"type":"integer","format":"int64","description":"Period start timestamp"},"endTime":{"type":"integer","format":"int64","description":"Period end timestamp"},"startPrice":{"type":"string","description":"Starting price for this period"},"endPrice":{"type":"string","description":"Ending price for this period"}}}}}}
```

## The MarketData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"MarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"status":{"type":"integer","description":"Market status: 1=Created, 2=Activated, 3=Resolving, 4=Resolved, 5=Failed, 6=Deleted","enum":[1,2,3,4,5,6]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Created","Activated","Resolving","Resolved","Failed","Deleted"]},"marketType":{"type":"integer","description":"Market type: 0=Binary, 1=Categorical","enum":[0,1]},"childMarkets":{"type":"array","items":{"$ref":"#/components/schemas/ChildMarketData"},"description":"Child markets (for categorical markets)"},"yesLabel":{"type":"string","description":"Yes outcome label"},"noLabel":{"type":"string","description":"No outcome label"},"rules":{"type":"string","description":"Market rules"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"conditionId":{"type":"string","description":"Condition ID"},"resultTokenId":{"type":"string","description":"Result token ID (after resolution)"},"volume":{"type":"string","description":"Total trading volume"},"volume24h":{"type":"string","description":"24-hour trading volume"},"volume7d":{"type":"string","description":"7-day trading volume"},"quoteToken":{"type":"string","description":"Quote token address"},"chainId":{"type":"string","description":"Chain ID"},"questionId":{"type":"string","description":"Question ID"},"incentiveFactor":{"type":"object","description":"Incentive factor (masked as empty object)"},"collection":{"$ref":"#/components/schemas/CollectionDataOpenAPI","description":"Collection market detail if any"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"},"cutoffAt":{"type":"integer","format":"int64","description":"Cutoff timestamp"},"resolvedAt":{"type":"integer","format":"int64","description":"Resolution timestamp"},"labels":{"type":"array","items":{"type":"string"},"description":"Category label names for this market. Aligned by index with labelIds\n(labels[i] corresponds to labelIds[i]). A market may have multiple labels.\n"},"labelIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Category label ids for this market. Aligned by index with labels.\nUse these for stable filtering via GET /market?labelId=<id> — names\nmay be renamed by operators.\n"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"ChildMarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"yesLabel":{"type":"string"},"noLabel":{"type":"string"},"rules":{"type":"string"},"yesTokenId":{"type":"string"},"noTokenId":{"type":"string"},"conditionId":{"type":"string"},"resultTokenId":{"type":"string"},"volume":{"type":"string"},"quoteToken":{"type":"string"},"chainId":{"type":"string"},"questionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"cutoffAt":{"type":"integer","format":"int64"},"resolvedAt":{"type":"integer","format":"int64"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"MarketResolutionSummary":{"type":"object","description":"Resolution lifecycle snapshot. Omitted while no resolution proposal is visible for the market (and for categorical parents). Full lifecycle detail is on the Resolution endpoints.","properties":{"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Current resolution phase"},"proposedTokenId":{"type":"string","description":"Token ID the proposal resolves as the winner (\"draw\" for a tie proposal)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Unix seconds; end of the dispute window for the proposal. Null when not applicable (e.g. auto-resolved markets)"}}},"CollectionDataOpenAPI":{"type":"object","description":"Collection market data (for recurring/time-series markets)","properties":{"title":{"type":"string","description":"Collection title"},"symbol":{"type":"string","description":"Collection symbol"},"frequency":{"type":"string","description":"Collection frequency (e.g., daily, weekly)"},"current":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI","description":"Current period market data"},"next":{"type":"array","items":{"$ref":"#/components/schemas/CollectionMarketDataOpenAPI"},"description":"Upcoming period markets"}}},"CollectionMarketDataOpenAPI":{"type":"object","description":"Collection market period data","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"period":{"type":"string","description":"Period identifier"},"startTime":{"type":"integer","format":"int64","description":"Period start timestamp"},"endTime":{"type":"integer","format":"int64","description":"Period end timestamp"},"startPrice":{"type":"string","description":"Starting price for this period"},"endPrice":{"type":"string","description":"Ending price for this period"}}}}}}
```

## The ChildMarketData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ChildMarketData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"yesLabel":{"type":"string"},"noLabel":{"type":"string"},"rules":{"type":"string"},"yesTokenId":{"type":"string"},"noTokenId":{"type":"string"},"conditionId":{"type":"string"},"resultTokenId":{"type":"string"},"volume":{"type":"string"},"quoteToken":{"type":"string"},"chainId":{"type":"string"},"questionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"cutoffAt":{"type":"integer","format":"int64"},"resolvedAt":{"type":"integer","format":"int64"},"resolution":{"$ref":"#/components/schemas/MarketResolutionSummary"}}},"MarketResolutionSummary":{"type":"object","description":"Resolution lifecycle snapshot. Omitted while no resolution proposal is visible for the market (and for categorical parents). Full lifecycle detail is on the Resolution endpoints.","properties":{"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Current resolution phase"},"proposedTokenId":{"type":"string","description":"Token ID the proposal resolves as the winner (\"draw\" for a tie proposal)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Unix seconds; end of the dispute window for the proposal. Null when not applicable (e.g. auto-resolved markets)"}}}}}}
```

## The LabelData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"LabelData":{"type":"object","properties":{"labelId":{"type":"integer","format":"int64","description":"Stable label id (use this for filtering)"},"labelName":{"type":"string","description":"Display label name (may be renamed by operators)"},"imageUrl":{"type":"string","description":"Desktop label image URL"},"imageMobileUrl":{"type":"string","description":"Mobile label image URL"}}}}}}
```

## The LabelListResp object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"LabelListResp":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/LabelData"}}}},"LabelData":{"type":"object","properties":{"labelId":{"type":"integer","format":"int64","description":"Stable label id (use this for filtering)"},"labelName":{"type":"string","description":"Display label name (may be renamed by operators)"},"imageUrl":{"type":"string","description":"Desktop label image URL"},"imageMobileUrl":{"type":"string","description":"Mobile label image URL"}}}}}}
```

## The LatestPriceResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"LatestPriceResponse":{"type":"object","properties":{"tokenId":{"type":"string","description":"Token ID"},"price":{"type":"string","description":"Latest trade price"},"side":{"type":"string","description":"Last trade side (BUY/SELL)"},"size":{"type":"string","description":"Last trade size"},"timestamp":{"type":"integer","format":"int64","description":"Trade timestamp in milliseconds"}}}}}}
```

## The OrderbookResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderbookResponse":{"type":"object","properties":{"market":{"type":"string","description":"Condition ID"},"tokenId":{"type":"string","description":"Token ID"},"timestamp":{"type":"integer","format":"int64","description":"Timestamp in milliseconds"},"bids":{"type":"array","items":{"$ref":"#/components/schemas/OrderbookLevel"},"description":"Buy orders, sorted by price descending"},"asks":{"type":"array","items":{"$ref":"#/components/schemas/OrderbookLevel"},"description":"Sell orders, sorted by price ascending"}}},"OrderbookLevel":{"type":"object","properties":{"price":{"type":"string","description":"Price level"},"size":{"type":"string","description":"Total size at this price level"}}}}}}
```

## The OrderbookLevel object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderbookLevel":{"type":"object","properties":{"price":{"type":"string","description":"Price level"},"size":{"type":"string","description":"Total size at this price level"}}}}}}
```

## The PriceHistoryResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"PriceHistoryResponse":{"type":"object","properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/PricePoint"},"description":"Historical price data points"}}},"PricePoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"UTC timestamp in seconds"},"p":{"type":"string","description":"Price"}}}}}}
```

## The PricePoint object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"PricePoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"UTC timestamp in seconds"},"p":{"type":"string","description":"Price"}}}}}}
```

## The QuoteTokenListResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"QuoteTokenListResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of quote tokens"},"list":{"type":"array","items":{"$ref":"#/components/schemas/QuoteTokenData"}}}},"QuoteTokenData":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Quote token ID"},"quoteTokenName":{"type":"string","description":"Quote token name"},"quoteTokenAddress":{"type":"string","description":"Quote token contract address"},"ctfExchangeAddress":{"type":"string","description":"CTF Exchange contract address"},"decimal":{"type":"integer","description":"Token decimals"},"symbol":{"type":"string","description":"Token symbol"},"chainId":{"type":"string","description":"Chain ID"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"}}}}}}
```

## The QuoteTokenData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"QuoteTokenData":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Quote token ID"},"quoteTokenName":{"type":"string","description":"Quote token name"},"quoteTokenAddress":{"type":"string","description":"Quote token contract address"},"ctfExchangeAddress":{"type":"string","description":"CTF Exchange contract address"},"decimal":{"type":"integer","description":"Token decimals"},"symbol":{"type":"string","description":"Token symbol"},"chainId":{"type":"string","description":"Chain ID"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"}}}}}}
```

## The PositionsResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"PositionsResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of positions"},"list":{"type":"array","items":{"$ref":"#/components/schemas/PositionData"}}}},"PositionData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"marketStatus":{"type":"integer","description":"Market status: 1=Created, 2=Activated, 3=Resolving, 4=Resolved, 5=Failed, 6=Deleted"},"marketStatusEnum":{"type":"string","description":"Human-readable market status"},"marketCutoffAt":{"type":"integer","format":"int64","description":"Market cutoff timestamp"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID (for categorical markets)"},"rootMarketTitle":{"type":"string","description":"Root market title"},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=Yes, 2=No","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"sharesOwned":{"type":"string","description":"Number of shares owned"},"sharesFrozen":{"type":"string","description":"Number of shares frozen (in pending orders)"},"unrealizedPnl":{"type":"string","description":"Unrealized profit/loss"},"unrealizedPnlPercent":{"type":"string","description":"Unrealized profit/loss percentage"},"dailyPnlChange":{"type":"string","description":"Daily PnL change"},"dailyPnlChangePercent":{"type":"string","description":"Daily PnL change percentage"},"conditionId":{"type":"string","description":"Condition ID"},"tokenId":{"type":"string","description":"Token ID"},"currentValueInQuoteToken":{"type":"string","description":"Current value in quote token (shares × current price)"},"avgEntryPrice":{"type":"string","description":"Average entry price"},"claimStatus":{"type":"integer","description":"Claim status: 0=CanNotClaim, 1=WaitClaim, 2=Claiming, 3=ClaimFailed, 4=Claimed"},"claimStatusEnum":{"type":"string","description":"Human-readable claim status","enum":["CanNotClaim","WaitClaim","Claiming","ClaimFailed","Claimed"]},"quoteToken":{"type":"string","description":"Quote token address"}}}}}}
```

## The PositionData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"PositionData":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"marketStatus":{"type":"integer","description":"Market status: 1=Created, 2=Activated, 3=Resolving, 4=Resolved, 5=Failed, 6=Deleted"},"marketStatusEnum":{"type":"string","description":"Human-readable market status"},"marketCutoffAt":{"type":"integer","format":"int64","description":"Market cutoff timestamp"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID (for categorical markets)"},"rootMarketTitle":{"type":"string","description":"Root market title"},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=Yes, 2=No","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"sharesOwned":{"type":"string","description":"Number of shares owned"},"sharesFrozen":{"type":"string","description":"Number of shares frozen (in pending orders)"},"unrealizedPnl":{"type":"string","description":"Unrealized profit/loss"},"unrealizedPnlPercent":{"type":"string","description":"Unrealized profit/loss percentage"},"dailyPnlChange":{"type":"string","description":"Daily PnL change"},"dailyPnlChangePercent":{"type":"string","description":"Daily PnL change percentage"},"conditionId":{"type":"string","description":"Condition ID"},"tokenId":{"type":"string","description":"Token ID"},"currentValueInQuoteToken":{"type":"string","description":"Current value in quote token (shares × current price)"},"avgEntryPrice":{"type":"string","description":"Average entry price"},"claimStatus":{"type":"integer","description":"Claim status: 0=CanNotClaim, 1=WaitClaim, 2=Claiming, 3=ClaimFailed, 4=Claimed"},"claimStatusEnum":{"type":"string","description":"Human-readable claim status","enum":["CanNotClaim","WaitClaim","Claiming","ClaimFailed","Claimed"]},"quoteToken":{"type":"string","description":"Quote token address"}}}}}}
```

## The UserTradeListResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"UserTradeListResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of trades"},"list":{"type":"array","items":{"$ref":"#/components/schemas/UserTradeData"}}}},"UserTradeData":{"type":"object","description":"Trade data for querying other users' trades (orderNo and tradeNo are hidden for privacy)","properties":{"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID (for categorical markets)"},"rootMarketTitle":{"type":"string","description":"Root market title"},"side":{"type":"string","description":"Trade side (BUY/SELL)"},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=Yes, 2=No","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"price":{"type":"string","description":"Trade price"},"shares":{"type":"string","description":"Number of shares traded"},"amount":{"type":"string","description":"Trade amount in quote token"},"fee":{"type":"string","description":"Fee amount (human-readable format)"},"profit":{"type":"string","description":"Profit/loss"},"quoteToken":{"type":"string","description":"Quote token address"},"quoteTokenUsdPrice":{"type":"string","description":"USD price of quote token"},"usdAmount":{"type":"string","description":"Total USD value of this trade"},"status":{"type":"integer","description":"Trade status: 1=Pending, 2=Filled, 3=Canceled, 4=Expired, 5=Failed"},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Pending","Filled","Canceled","Expired","Failed"]},"chainId":{"type":"string","description":"Chain ID"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"}}}}}}
```

## The UserTradeData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"UserTradeData":{"type":"object","description":"Trade data for querying other users' trades (orderNo and tradeNo are hidden for privacy)","properties":{"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID (for categorical markets)"},"rootMarketTitle":{"type":"string","description":"Root market title"},"side":{"type":"string","description":"Trade side (BUY/SELL)"},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=Yes, 2=No","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"price":{"type":"string","description":"Trade price"},"shares":{"type":"string","description":"Number of shares traded"},"amount":{"type":"string","description":"Trade amount in quote token"},"fee":{"type":"string","description":"Fee amount (human-readable format)"},"profit":{"type":"string","description":"Profit/loss"},"quoteToken":{"type":"string","description":"Quote token address"},"quoteTokenUsdPrice":{"type":"string","description":"USD price of quote token"},"usdAmount":{"type":"string","description":"Total USD value of this trade"},"status":{"type":"integer","description":"Trade status: 1=Pending, 2=Filled, 3=Canceled, 4=Expired, 5=Failed"},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Pending","Filled","Canceled","Expired","Failed"]},"chainId":{"type":"string","description":"Chain ID"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp"}}}}}}
```

## The OrderListResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderListResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of orders"},"list":{"type":"array","items":{"$ref":"#/components/schemas/OrderData"},"description":"List of orders"}}},"OrderData":{"type":"object","description":"Order record (list item or detail; detail includes trades)","properties":{"orderId":{"type":"string","description":"Order ID (transaction number)"},"transNo":{"type":"string","description":"Deprecated; use orderId instead"},"status":{"type":"integer","description":"Order status: 1=pending, 2=filled, 3=canceled, 4=expired, 5=failed","enum":[1,2,3,4,5]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Pending","Finished","Canceled","Expired","Failed"]},"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID"},"rootMarketTitle":{"type":"string","description":"Root market title"},"side":{"type":"integer","description":"Side: 1=buy, 2=sell","enum":[1,2]},"sideEnum":{"type":"string","description":"Human-readable side","enum":["Buy","Sell"]},"tradingMethod":{"type":"integer","description":"Trading method: 1=market, 2=limit"},"tradingMethodEnum":{"type":"string","description":"Human-readable trading method","enum":["Market","Limit"]},"tradingUnit":{"type":"integer","description":"Trading unit: 1=quote, 2=shares. Indicates which side was user-specified when the order was placed.","enum":[1,2]},"tradingUnitEnum":{"type":"string","description":"Human-readable trading unit. `quote` means the user specified quote-token amount; `shares` means the user specified shares quantity.","enum":["quote","shares"]},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=yes, 2=no","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"price":{"type":"string","description":"Price per share (for limit orders)"},"orderShares":{"type":"string","description":"Total shares in order (base token). Always expressed in shares regardless of tradingUnit."},"orderAmount":{"type":"string","description":"Total amount in order (quote token). Always expressed in quote-token amount regardless of tradingUnit."},"filledShares":{"type":"string","description":"Filled shares (base token)"},"filledAmount":{"type":"string","description":"Filled amount (quote token)"},"profit":{"type":"string","description":"Profit/loss"},"quoteToken":{"type":"string","description":"Quote token address"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp (milliseconds)"},"expiresAt":{"type":"integer","format":"int64","description":"Expiration timestamp (milliseconds)"},"postOnly":{"type":"boolean","description":"Optional. Post-only mode for limit orders (default false). When true on place-order, the order must rest as maker; if it would cross the spread it is cancelled (comment: post-only order would cross the spread). Market orders with postOnly=true are rejected with code 10610."},"trades":{"type":"array","items":{"$ref":"#/components/schemas/OrderTradeData"},"description":"Related trades (only present in order detail response)"}}},"OrderTradeData":{"type":"object","description":"Trade record within an order detail","properties":{"orderNo":{"type":"string","description":"Order number"},"tradeNo":{"type":"string","description":"Trade number"},"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"rootMarketId":{"type":"integer","format":"int64"},"rootMarketTitle":{"type":"string"},"side":{"type":"string"},"outcome":{"type":"string"},"outcomeSide":{"type":"integer","enum":[1,2]},"outcomeSideEnum":{"type":"string","enum":[true,false]},"price":{"type":"string"},"shares":{"type":"string"},"amount":{"type":"string"},"fee":{"type":"integer","format":"int64","description":"Fee in wei"},"feeFormatted":{"type":"string","description":"Human-readable fee"},"profit":{"type":"string"},"quoteToken":{"type":"string"},"quoteTokenUsdPrice":{"type":"string"},"usdAmount":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"chainId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}
```

## The OrderData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderData":{"type":"object","description":"Order record (list item or detail; detail includes trades)","properties":{"orderId":{"type":"string","description":"Order ID (transaction number)"},"transNo":{"type":"string","description":"Deprecated; use orderId instead"},"status":{"type":"integer","description":"Order status: 1=pending, 2=filled, 3=canceled, 4=expired, 5=failed","enum":[1,2,3,4,5]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Pending","Finished","Canceled","Expired","Failed"]},"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID"},"rootMarketTitle":{"type":"string","description":"Root market title"},"side":{"type":"integer","description":"Side: 1=buy, 2=sell","enum":[1,2]},"sideEnum":{"type":"string","description":"Human-readable side","enum":["Buy","Sell"]},"tradingMethod":{"type":"integer","description":"Trading method: 1=market, 2=limit"},"tradingMethodEnum":{"type":"string","description":"Human-readable trading method","enum":["Market","Limit"]},"tradingUnit":{"type":"integer","description":"Trading unit: 1=quote, 2=shares. Indicates which side was user-specified when the order was placed.","enum":[1,2]},"tradingUnitEnum":{"type":"string","description":"Human-readable trading unit. `quote` means the user specified quote-token amount; `shares` means the user specified shares quantity.","enum":["quote","shares"]},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=yes, 2=no","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"price":{"type":"string","description":"Price per share (for limit orders)"},"orderShares":{"type":"string","description":"Total shares in order (base token). Always expressed in shares regardless of tradingUnit."},"orderAmount":{"type":"string","description":"Total amount in order (quote token). Always expressed in quote-token amount regardless of tradingUnit."},"filledShares":{"type":"string","description":"Filled shares (base token)"},"filledAmount":{"type":"string","description":"Filled amount (quote token)"},"profit":{"type":"string","description":"Profit/loss"},"quoteToken":{"type":"string","description":"Quote token address"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp (milliseconds)"},"expiresAt":{"type":"integer","format":"int64","description":"Expiration timestamp (milliseconds)"},"postOnly":{"type":"boolean","description":"Optional. Post-only mode for limit orders (default false). When true on place-order, the order must rest as maker; if it would cross the spread it is cancelled (comment: post-only order would cross the spread). Market orders with postOnly=true are rejected with code 10610."},"trades":{"type":"array","items":{"$ref":"#/components/schemas/OrderTradeData"},"description":"Related trades (only present in order detail response)"}}},"OrderTradeData":{"type":"object","description":"Trade record within an order detail","properties":{"orderNo":{"type":"string","description":"Order number"},"tradeNo":{"type":"string","description":"Trade number"},"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"rootMarketId":{"type":"integer","format":"int64"},"rootMarketTitle":{"type":"string"},"side":{"type":"string"},"outcome":{"type":"string"},"outcomeSide":{"type":"integer","enum":[1,2]},"outcomeSideEnum":{"type":"string","enum":[true,false]},"price":{"type":"string"},"shares":{"type":"string"},"amount":{"type":"string"},"fee":{"type":"integer","format":"int64","description":"Fee in wei"},"feeFormatted":{"type":"string","description":"Human-readable fee"},"profit":{"type":"string"},"quoteToken":{"type":"string"},"quoteTokenUsdPrice":{"type":"string"},"usdAmount":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"chainId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}
```

## The OrderDetailResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderDetailResponse":{"type":"object","description":"Order detail response (includes orderData with trades)","properties":{"orderData":{"$ref":"#/components/schemas/OrderData"}}},"OrderData":{"type":"object","description":"Order record (list item or detail; detail includes trades)","properties":{"orderId":{"type":"string","description":"Order ID (transaction number)"},"transNo":{"type":"string","description":"Deprecated; use orderId instead"},"status":{"type":"integer","description":"Order status: 1=pending, 2=filled, 3=canceled, 4=expired, 5=failed","enum":[1,2,3,4,5]},"statusEnum":{"type":"string","description":"Human-readable status","enum":["Pending","Finished","Canceled","Expired","Failed"]},"marketId":{"type":"integer","format":"int64","description":"Market ID"},"marketTitle":{"type":"string","description":"Market title"},"rootMarketId":{"type":"integer","format":"int64","description":"Root market ID"},"rootMarketTitle":{"type":"string","description":"Root market title"},"side":{"type":"integer","description":"Side: 1=buy, 2=sell","enum":[1,2]},"sideEnum":{"type":"string","description":"Human-readable side","enum":["Buy","Sell"]},"tradingMethod":{"type":"integer","description":"Trading method: 1=market, 2=limit"},"tradingMethodEnum":{"type":"string","description":"Human-readable trading method","enum":["Market","Limit"]},"tradingUnit":{"type":"integer","description":"Trading unit: 1=quote, 2=shares. Indicates which side was user-specified when the order was placed.","enum":[1,2]},"tradingUnitEnum":{"type":"string","description":"Human-readable trading unit. `quote` means the user specified quote-token amount; `shares` means the user specified shares quantity.","enum":["quote","shares"]},"outcome":{"type":"string","description":"Outcome label"},"outcomeSide":{"type":"integer","description":"Outcome side: 1=yes, 2=no","enum":[1,2]},"outcomeSideEnum":{"type":"string","description":"Human-readable outcome side","enum":[true,false]},"price":{"type":"string","description":"Price per share (for limit orders)"},"orderShares":{"type":"string","description":"Total shares in order (base token). Always expressed in shares regardless of tradingUnit."},"orderAmount":{"type":"string","description":"Total amount in order (quote token). Always expressed in quote-token amount regardless of tradingUnit."},"filledShares":{"type":"string","description":"Filled shares (base token)"},"filledAmount":{"type":"string","description":"Filled amount (quote token)"},"profit":{"type":"string","description":"Profit/loss"},"quoteToken":{"type":"string","description":"Quote token address"},"createdAt":{"type":"integer","format":"int64","description":"Creation timestamp (milliseconds)"},"expiresAt":{"type":"integer","format":"int64","description":"Expiration timestamp (milliseconds)"},"postOnly":{"type":"boolean","description":"Optional. Post-only mode for limit orders (default false). When true on place-order, the order must rest as maker; if it would cross the spread it is cancelled (comment: post-only order would cross the spread). Market orders with postOnly=true are rejected with code 10610."},"trades":{"type":"array","items":{"$ref":"#/components/schemas/OrderTradeData"},"description":"Related trades (only present in order detail response)"}}},"OrderTradeData":{"type":"object","description":"Trade record within an order detail","properties":{"orderNo":{"type":"string","description":"Order number"},"tradeNo":{"type":"string","description":"Trade number"},"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"rootMarketId":{"type":"integer","format":"int64"},"rootMarketTitle":{"type":"string"},"side":{"type":"string"},"outcome":{"type":"string"},"outcomeSide":{"type":"integer","enum":[1,2]},"outcomeSideEnum":{"type":"string","enum":[true,false]},"price":{"type":"string"},"shares":{"type":"string"},"amount":{"type":"string"},"fee":{"type":"integer","format":"int64","description":"Fee in wei"},"feeFormatted":{"type":"string","description":"Human-readable fee"},"profit":{"type":"string"},"quoteToken":{"type":"string"},"quoteTokenUsdPrice":{"type":"string"},"usdAmount":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"chainId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}
```

## The OrderTradeData object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"OrderTradeData":{"type":"object","description":"Trade record within an order detail","properties":{"orderNo":{"type":"string","description":"Order number"},"tradeNo":{"type":"string","description":"Trade number"},"txHash":{"type":"string","description":"Transaction hash"},"marketId":{"type":"integer","format":"int64"},"marketTitle":{"type":"string"},"rootMarketId":{"type":"integer","format":"int64"},"rootMarketTitle":{"type":"string"},"side":{"type":"string"},"outcome":{"type":"string"},"outcomeSide":{"type":"integer","enum":[1,2]},"outcomeSideEnum":{"type":"string","enum":[true,false]},"price":{"type":"string"},"shares":{"type":"string"},"amount":{"type":"string"},"fee":{"type":"integer","format":"int64","description":"Fee in wei"},"feeFormatted":{"type":"string","description":"Human-readable fee"},"profit":{"type":"string"},"quoteToken":{"type":"string"},"quoteTokenUsdPrice":{"type":"string"},"usdAmount":{"type":"string"},"status":{"type":"integer"},"statusEnum":{"type":"string"},"chainId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}
```

## The ResolutionAPIBaseResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionAPIBaseResponse":{"type":"object","description":"Envelope used by the Resolution endpoints. The outcome is reported in `errno` / `errmsg` with HTTP 200; see the Resolution section for the error-code list.","properties":{"errno":{"type":"integer","description":"Business result code (0 for success)"},"errmsg":{"type":"string","description":"Error message (empty on success)"},"result":{"type":"object","description":"Response data"}}}}}}
```

## The ResolutionMarketRow object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionMarketRow":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market id — same id space as `GET /market/{marketId}` (binary markets and categorical child markets)"},"questionId":{"type":"string","description":"0x-prefixed on-chain question id — the key for all DisputeResolver contract calls"},"conditionId":{"type":"string","description":"Conditional-tokens condition id"},"parentMarketId":{"type":"integer","format":"int64","nullable":true,"description":"Parent market id for categorical child markets; null for binary"},"marketTitle":{"type":"string","description":"Market title"},"slug":{"type":"string","description":"Market slug"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"yesLabel":{"type":"string","description":"Yes outcome label (team names for sports markets)"},"noLabel":{"type":"string","description":"No outcome label"},"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Resolution phase (see the Resolution section)"},"proposedPayouts":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Proposed outcome as the on-chain payout vector `[yes, no]`: `[\"1\",\"0\"]` Yes wins, `[\"0\",\"1\"]` No wins, `[\"1\",\"1\"]` tie. Null on price-oracle records"},"proposedTokenId":{"type":"string","description":"Proposed winning token id (= `yesTokenId` or `noTokenId`); the literal string `\"draw\"` for a tie — check before using it as a token id"},"resultTokenId":{"type":"string","description":"Final outcome after finalization, same encoding as `proposedTokenId`; `\"\"` until finalized"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Set only on finalized markets that were disputed; null otherwise (including during review)"},"requiredStake":{"type":"string","nullable":true,"description":"OPN stake required to dispute, fixed for the whole window (display units)"},"stakeTokenSymbol":{"type":"string","description":"Stake token symbol"},"lastTradePrice":{"type":"string","nullable":true,"description":"Latest trade price of the proposed winning token; null for tie proposals"},"proposedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of the proposal transaction (Unix seconds)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"End of the dispute window (Unix seconds); null only on price-oracle records"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Set once disputed. After it passes, an undecided dispute becomes eligible for a `timeout` ruling (applied by the operator, not automatic) — rely on `phase` / `disputeOutcome`, not this deadline alone"},"finalizedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of finalization (Unix seconds)"}}}}}}
```

## The ResolutionMarketsResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionMarketsResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of markets for the filter"},"list":{"type":"array","items":{"$ref":"#/components/schemas/ResolutionMarketRow"}}}},"ResolutionMarketRow":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market id — same id space as `GET /market/{marketId}` (binary markets and categorical child markets)"},"questionId":{"type":"string","description":"0x-prefixed on-chain question id — the key for all DisputeResolver contract calls"},"conditionId":{"type":"string","description":"Conditional-tokens condition id"},"parentMarketId":{"type":"integer","format":"int64","nullable":true,"description":"Parent market id for categorical child markets; null for binary"},"marketTitle":{"type":"string","description":"Market title"},"slug":{"type":"string","description":"Market slug"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"yesLabel":{"type":"string","description":"Yes outcome label (team names for sports markets)"},"noLabel":{"type":"string","description":"No outcome label"},"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Resolution phase (see the Resolution section)"},"proposedPayouts":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Proposed outcome as the on-chain payout vector `[yes, no]`: `[\"1\",\"0\"]` Yes wins, `[\"0\",\"1\"]` No wins, `[\"1\",\"1\"]` tie. Null on price-oracle records"},"proposedTokenId":{"type":"string","description":"Proposed winning token id (= `yesTokenId` or `noTokenId`); the literal string `\"draw\"` for a tie — check before using it as a token id"},"resultTokenId":{"type":"string","description":"Final outcome after finalization, same encoding as `proposedTokenId`; `\"\"` until finalized"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Set only on finalized markets that were disputed; null otherwise (including during review)"},"requiredStake":{"type":"string","nullable":true,"description":"OPN stake required to dispute, fixed for the whole window (display units)"},"stakeTokenSymbol":{"type":"string","description":"Stake token symbol"},"lastTradePrice":{"type":"string","nullable":true,"description":"Latest trade price of the proposed winning token; null for tie proposals"},"proposedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of the proposal transaction (Unix seconds)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"End of the dispute window (Unix seconds); null only on price-oracle records"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Set once disputed. After it passes, an undecided dispute becomes eligible for a `timeout` ruling (applied by the operator, not automatic) — rely on `phase` / `disputeOutcome`, not this deadline alone"},"finalizedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of finalization (Unix seconds)"}}}}}}
```

## The ResolutionDisputeParams object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionDisputeParams":{"type":"object","nullable":true,"description":"Everything needed to send dispute/claim transactions, plus the state of the current dispute. Null for price-oracle records (nothing to dispute).","properties":{"chainId":{"type":"string","description":"Chain id"},"disputeResolver":{"type":"string","description":"Contract to call `dispute` / `claim` / `isDisputable` on for this market — always take the address from here"},"requiredStake":{"type":"string","nullable":true,"description":"Stake required to dispute (display units)"},"stakeToken":{"type":"string","description":"ERC-20 address of the stake token — `approve` it to `disputeResolver` before disputing"},"stakeTokenSymbol":{"type":"string"},"stakeTokenDecimals":{"type":"integer","description":"Stake token decimals — use with `requiredStake` to build the raw approve amount"},"disputor":{"type":"string","nullable":true,"description":"Wallet that filed the dispute; null if none"},"reason":{"type":"integer","nullable":true,"description":"Dispute reason as filed: `0` WrongResult / `1` TooEarly"},"reasonEnum":{"type":"string","description":"Human-readable reason (`WrongResult` / `TooEarly`); `\"\"` if never disputed"},"rationale":{"type":"string","nullable":true,"description":"Public statement submitted by the disputor; null if none"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Set once finalized"},"claimStatus":{"type":"string","enum":["not_applicable","claimable","claimed"],"description":"Claim state of the disputor's stake — `not_applicable` (no dispute, dispute rejected, or not yet finalized) / `claimable` (dispute won, unclaimed) / `claimed`"},"claimableAmount":{"type":"string","nullable":true,"description":"Stake + reward claimable by the winning disputor (display units)"},"disputeTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the dispute"},"finalizeTxHash":{"type":"string","nullable":true,"description":"Transaction hash of finalization"},"claimTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the stake claim"},"disputedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the dispute was filed (Unix seconds)"},"claimedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the stake was claimed (Unix seconds)"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Review deadline. After it passes, an undecided dispute becomes eligible for a `timeout` ruling (applied by the operator, not automatic) — rely on `disputeOutcome`, not the deadline"}}}}}}
```

## The ResolutionTimelineStage object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionTimelineStage":{"type":"object","description":"One tx-anchored stage of the resolution timeline","properties":{"stage":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Stage name, always in this order"},"at":{"type":"integer","format":"int64","nullable":true,"description":"Unix time of the stage's transaction; null if not reached"},"txHash":{"type":"string","nullable":true,"description":"Transaction hash anchoring the stage; null if not reached"}}}}}}
```

## The ResolutionMarketDetail object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionMarketDetail":{"allOf":[{"$ref":"#/components/schemas/ResolutionMarketRow"},{"type":"object","properties":{"rules":{"type":"string","description":"This market's resolution rules — the criteria the outcome is judged against"},"parentRules":{"type":"string","nullable":true,"description":"Parent event's rules for categorical child markets (read both when evaluating a proposal); null for binary markets"},"dispute":{"$ref":"#/components/schemas/ResolutionDisputeParams"},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ResolutionTimelineStage"},"description":"Fixed three stages (`proposed` / `disputed` / `finalized`), each anchored to its on-chain transaction; stages not reached are null. Records indexed before tx tracking was introduced may show null `at` / `txHash` for stages that did occur"}}}]},"ResolutionMarketRow":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market id — same id space as `GET /market/{marketId}` (binary markets and categorical child markets)"},"questionId":{"type":"string","description":"0x-prefixed on-chain question id — the key for all DisputeResolver contract calls"},"conditionId":{"type":"string","description":"Conditional-tokens condition id"},"parentMarketId":{"type":"integer","format":"int64","nullable":true,"description":"Parent market id for categorical child markets; null for binary"},"marketTitle":{"type":"string","description":"Market title"},"slug":{"type":"string","description":"Market slug"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"yesLabel":{"type":"string","description":"Yes outcome label (team names for sports markets)"},"noLabel":{"type":"string","description":"No outcome label"},"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Resolution phase (see the Resolution section)"},"proposedPayouts":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Proposed outcome as the on-chain payout vector `[yes, no]`: `[\"1\",\"0\"]` Yes wins, `[\"0\",\"1\"]` No wins, `[\"1\",\"1\"]` tie. Null on price-oracle records"},"proposedTokenId":{"type":"string","description":"Proposed winning token id (= `yesTokenId` or `noTokenId`); the literal string `\"draw\"` for a tie — check before using it as a token id"},"resultTokenId":{"type":"string","description":"Final outcome after finalization, same encoding as `proposedTokenId`; `\"\"` until finalized"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Set only on finalized markets that were disputed; null otherwise (including during review)"},"requiredStake":{"type":"string","nullable":true,"description":"OPN stake required to dispute, fixed for the whole window (display units)"},"stakeTokenSymbol":{"type":"string","description":"Stake token symbol"},"lastTradePrice":{"type":"string","nullable":true,"description":"Latest trade price of the proposed winning token; null for tie proposals"},"proposedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of the proposal transaction (Unix seconds)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"End of the dispute window (Unix seconds); null only on price-oracle records"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Set once disputed. After it passes, an undecided dispute becomes eligible for a `timeout` ruling (applied by the operator, not automatic) — rely on `phase` / `disputeOutcome`, not this deadline alone"},"finalizedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time of finalization (Unix seconds)"}}},"ResolutionDisputeParams":{"type":"object","nullable":true,"description":"Everything needed to send dispute/claim transactions, plus the state of the current dispute. Null for price-oracle records (nothing to dispute).","properties":{"chainId":{"type":"string","description":"Chain id"},"disputeResolver":{"type":"string","description":"Contract to call `dispute` / `claim` / `isDisputable` on for this market — always take the address from here"},"requiredStake":{"type":"string","nullable":true,"description":"Stake required to dispute (display units)"},"stakeToken":{"type":"string","description":"ERC-20 address of the stake token — `approve` it to `disputeResolver` before disputing"},"stakeTokenSymbol":{"type":"string"},"stakeTokenDecimals":{"type":"integer","description":"Stake token decimals — use with `requiredStake` to build the raw approve amount"},"disputor":{"type":"string","nullable":true,"description":"Wallet that filed the dispute; null if none"},"reason":{"type":"integer","nullable":true,"description":"Dispute reason as filed: `0` WrongResult / `1` TooEarly"},"reasonEnum":{"type":"string","description":"Human-readable reason (`WrongResult` / `TooEarly`); `\"\"` if never disputed"},"rationale":{"type":"string","nullable":true,"description":"Public statement submitted by the disputor; null if none"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Set once finalized"},"claimStatus":{"type":"string","enum":["not_applicable","claimable","claimed"],"description":"Claim state of the disputor's stake — `not_applicable` (no dispute, dispute rejected, or not yet finalized) / `claimable` (dispute won, unclaimed) / `claimed`"},"claimableAmount":{"type":"string","nullable":true,"description":"Stake + reward claimable by the winning disputor (display units)"},"disputeTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the dispute"},"finalizeTxHash":{"type":"string","nullable":true,"description":"Transaction hash of finalization"},"claimTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the stake claim"},"disputedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the dispute was filed (Unix seconds)"},"claimedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the stake was claimed (Unix seconds)"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Review deadline. After it passes, an undecided dispute becomes eligible for a `timeout` ruling (applied by the operator, not automatic) — rely on `disputeOutcome`, not the deadline"}}},"ResolutionTimelineStage":{"type":"object","description":"One tx-anchored stage of the resolution timeline","properties":{"stage":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Stage name, always in this order"},"at":{"type":"integer","format":"int64","nullable":true,"description":"Unix time of the stage's transaction; null if not reached"},"txHash":{"type":"string","nullable":true,"description":"Transaction hash anchoring the stage; null if not reached"}}}}}}
```

## The ResolutionDisputeRow object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionDisputeRow":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market id"},"questionId":{"type":"string","description":"0x-prefixed on-chain question id"},"marketTitle":{"type":"string","description":"Market title"},"slug":{"type":"string","description":"Market slug"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"yesLabel":{"type":"string","description":"Yes outcome label"},"noLabel":{"type":"string","description":"No outcome label"},"disputor":{"type":"string","description":"Wallet that filed this dispute"},"reason":{"type":"integer","description":"Dispute reason: `0` WrongResult / `1` TooEarly"},"reasonEnum":{"type":"string","description":"Human-readable reason"},"rationale":{"type":"string","nullable":true,"description":"Public statement submitted by the disputor; null if none"},"stake":{"type":"string","description":"Amount actually staked for this dispute (display units)"},"stakeTokenSymbol":{"type":"string"},"proposedPayouts":{"type":"array","items":{"type":"string"},"description":"The original proposal that was disputed, as the payout vector `[yes, no]`"},"proposedTokenId":{"type":"string","description":"Proposed winning token id of the disputed proposal (`\"draw\"` for a tie)"},"resultTokenId":{"type":"string","description":"Final outcome; `\"\"` while review is in progress"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Null while review is in progress"},"claimStatus":{"type":"string","enum":["not_applicable","claimable","claimed"],"description":"Claim state of the disputor's stake"},"claimableAmount":{"type":"string","nullable":true,"description":"Stake + reward claimable by the winning disputor (display units)"},"disputeTxHash":{"type":"string","description":"Transaction hash of the dispute"},"finalizeTxHash":{"type":"string","description":"Transaction hash of finalization; `\"\"` while review is in progress"},"claimTxHash":{"type":"string","description":"Transaction hash of the stake claim; `\"\"` if not claimed"},"disputedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the dispute was filed (Unix seconds)"},"claimedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the stake was claimed (Unix seconds)"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Review deadline of this dispute"}}}}}}
```

## The ResolutionDisputesResponse object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"ResolutionDisputesResponse":{"type":"object","properties":{"total":{"type":"integer","format":"int64","description":"Total number of disputes for the filter"},"list":{"type":"array","items":{"$ref":"#/components/schemas/ResolutionDisputeRow"}}}},"ResolutionDisputeRow":{"type":"object","properties":{"marketId":{"type":"integer","format":"int64","description":"Market id"},"questionId":{"type":"string","description":"0x-prefixed on-chain question id"},"marketTitle":{"type":"string","description":"Market title"},"slug":{"type":"string","description":"Market slug"},"yesTokenId":{"type":"string","description":"Yes outcome token ID"},"noTokenId":{"type":"string","description":"No outcome token ID"},"yesLabel":{"type":"string","description":"Yes outcome label"},"noLabel":{"type":"string","description":"No outcome label"},"disputor":{"type":"string","description":"Wallet that filed this dispute"},"reason":{"type":"integer","description":"Dispute reason: `0` WrongResult / `1` TooEarly"},"reasonEnum":{"type":"string","description":"Human-readable reason"},"rationale":{"type":"string","nullable":true,"description":"Public statement submitted by the disputor; null if none"},"stake":{"type":"string","description":"Amount actually staked for this dispute (display units)"},"stakeTokenSymbol":{"type":"string"},"proposedPayouts":{"type":"array","items":{"type":"string"},"description":"The original proposal that was disputed, as the payout vector `[yes, no]`"},"proposedTokenId":{"type":"string","description":"Proposed winning token id of the disputed proposal (`\"draw\"` for a tie)"},"resultTokenId":{"type":"string","description":"Final outcome; `\"\"` while review is in progress"},"disputeOutcome":{"type":"string","enum":["upheld","overturned","timeout"],"nullable":true,"description":"Null while review is in progress"},"claimStatus":{"type":"string","enum":["not_applicable","claimable","claimed"],"description":"Claim state of the disputor's stake"},"claimableAmount":{"type":"string","nullable":true,"description":"Stake + reward claimable by the winning disputor (display units)"},"disputeTxHash":{"type":"string","description":"Transaction hash of the dispute"},"finalizeTxHash":{"type":"string","description":"Transaction hash of finalization; `\"\"` while review is in progress"},"claimTxHash":{"type":"string","description":"Transaction hash of the stake claim; `\"\"` if not claimed"},"disputedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the dispute was filed (Unix seconds)"},"claimedAt":{"type":"integer","format":"int64","nullable":true,"description":"Time the stake was claimed (Unix seconds)"},"arbitrationDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Review deadline of this dispute"}}}}}}
```

## The DisputeRationaleRequest object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"DisputeRationaleRequest":{"type":"object","required":["rationale"],"properties":{"rationale":{"type":"string","description":"Public statement explaining the dispute — must equal the signed `rationale`; at most 2000 bytes (UTF-8). Surrounding whitespace is stripped server-side"}}}}}}
```

## The DisputeRationaleResult object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"DisputeRationaleResult":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}
```

## The MarketResolutionSummary object

```json
{"openapi":"3.0.3","info":{"title":"OPINION Prediction Market OpenAPI","version":"1.0.0"},"components":{"schemas":{"MarketResolutionSummary":{"type":"object","description":"Resolution lifecycle snapshot. Omitted while no resolution proposal is visible for the market (and for categorical parents). Full lifecycle detail is on the Resolution endpoints.","properties":{"phase":{"type":"string","enum":["proposed","disputed","finalized"],"description":"Current resolution phase"},"proposedTokenId":{"type":"string","description":"Token ID the proposal resolves as the winner (\"draw\" for a tie proposal)"},"disputeDeadline":{"type":"integer","format":"int64","nullable":true,"description":"Unix seconds; end of the dispute window for the proposal. Null when not applicable (e.g. auto-resolved markets)"}}}}}}
```


---

# 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.opinion.trade/developer-guide/opinion-open-api/models.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.
