---
title: "Open interest and funding of a perpetual contract on one exchange."
method: POST
path: "/v2/ops/crypto.derivatives.snapshot"
tags: ["crypto"]
---

# Open interest and funding of a perpetual contract on one exchange.

`POST /v2/ops/crypto.derivatives.snapshot`

## Request

- Base URL: `https://api.agentkey.app`
- URL: `https://api.agentkey.app/v2/ops/crypto.derivatives.snapshot`
- Auth: HTTP bearer

Returns the current perpetual-futures snapshot of one base asset (BTC, ETH …) on one exchange: open interest in USD and contracts, funding rate and next settlement, mark and index price. The USDT-quoted perpetual is used.

Fixed price: 3.6 credits per successful call, whichever provider serves it.

## Request body

- object
  - `exchange` 'binance' | 'okx' | 'bybit' | 'bitget' | 'htx' | 'bitfinex' | 'bitmex' | 'hyperliquid': Exchange to read the contract from.
  - `fields` string[]: Projection: keep only these dotted paths of data, e.g. ["items.id", "items.text"].
  - `include_raw` boolean: Attach the raw upstream payload as `raw` (not a stable contract; truncated above 256 KB).
  - `provider` string: Shorthand for routing.only = [provider].
  - `routing` Routing: Provider routing override. order: try these providers first; only: restrict to these (equivalent to pinning); allow_fallbacks: false tries only the first eligible provider.
    - `allow_fallbacks` boolean: false = try only the first eligible provider.
    - `only` string[]: Restrict to these providers.
    - `order` string[]: Providers to try first, in order.
    - `strategy` 'auto': How eligible providers are ordered. auto = the method's curated order. fastest / stable / popular are specified but not implemented yet (400 until then). The price is fixed whatever the strategy; mutually exclusive with order.
  - `symbol` string, required: Base asset ticker, e.g. BTC. Case-insensitive.

## Response `200`

Success envelope

- DerivativesSnapshotEnvelope: Success envelope whose data is a DerivativesSnapshot.
  - `attempts` Attempt[], required
    - `error_type` string: validation | not_found | rate_limit | timeout | upstream_unauthorized | upstream_unavailable | provider_error
    - `provider` string, required: Provider slug.
    - `refunded` boolean: true when the reservation for this attempt was refunded.
    - `status` integer, required: HTTP status AgentKey mapped this attempt to (200 on success).
    - `took_ms` integer, required
    - `tool` string, required: Registry tool name (Provider/operation) that was called.
    - `upstream_status` integer: The provider's real HTTP status; absent when nothing was received.
  - `credits_charged` number, required: Credits charged for this call (the method's fixed price).
  - `data` object, required: Current perpetual-futures state of one symbol on one exchange.
    - `as_of` string, date-time, nullable, required: Time of the open-interest reading, RFC 3339 UTC.
    - `exchange` string, nullable, required: Exchange slug the figures come from.
    - `funding` object, required
      - `index_price` number, nullable, required: Index price.
      - `interval` string, nullable, required: Funding interval (8h).
      - `mark_price` number, nullable, required: Mark price.
      - `next_at` string, date-time, nullable, required: Next funding settlement, RFC 3339 UTC.
      - `rate` number, nullable, required: Current funding rate as a decimal (0.0001 = 0.01%).
    - `liquidations_24h` object, required
      - `long_usd` number, nullable, required: Long liquidations over the last 24 hours in USD.
      - `short_usd` number, nullable, required: Short liquidations over the last 24 hours in USD.
      - `total_usd` number, nullable, required: Liquidations over the last 24 hours in USD.
    - `long_short_ratio` number, nullable, required: Long/short account ratio (1.5 = 60% long) when the provider reports it.
    - `open_interest` object, required
      - `amount` number, nullable, required: Open interest in base-asset units / contracts.
      - `usd` number, nullable, required: Open interest in USD.
    - `pair` string, nullable, required: Contract pair as the exchange names it (BTC/USDT:USDT).
    - `symbol` string, required: Base asset ticker (BTC).
    - `volume_24h` number, nullable, required: 24-hour contract volume in USD when reported.
  - `op` string, required: Method name.
  - `op_version` integer, required: Method version that served the call.
  - `provider` string, required: Provider that actually served the call.
  - `raw` unknown
  - `raw_truncated` boolean
  - `request_id` string, required: Correlation id; quote it in support requests.
  - `took_ms` integer, required
  - `unsupported_fields` string[], required: Output paths this provider structurally does not supply; such fields are null for a different reason than 'missing on this record'.

## Other responses

- `400`: Validation error (unknown field, bad cursor, bad routing)
- `402`: Insufficient credits
- `404`: Not found (method, or upstream object)
- `429`: Rate limited upstream
- `502`: All providers failed
- `504`: Timed out

---

[API](https://skmtc.dev/agentkey/apis/agentkey-scenario-methods.md) - [All operations](https://skmtc.dev/agentkey/apis/agentkey-scenario-methods/llms.txt) - [OpenAPI document](https://skmtc.dev/agentkey/apis/agentkey-scenario-methods/revisions/a7cf5b682fdd?raw)
