APICrypto & DeFi

Uniswap Check swap approvals

Check swap approvals with the Uniswap API. The request takes an amount, a chain ID and a wallet address. Use it in a transaction-routing workflow. Use the response in a DeFi workflow for the selected protocol, and compare the request and response with the provider example.

Selected price
$0 / callPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
—Loading...
Success rate · 30d
—Loading...
USE THIS API

Uniswap Check swap approvals

Prepare your request, then continue with your agent.

Selected price

$0 / call

Provider
Pricing
Connect your agent
On this page

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
body*object

body

Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.
Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.
Optional attribution hint for AI-agent traffic; send it if an AI agent built or operates your integration. The value is a JSON object with up to three fields: `decision_origin` (required, exactly `autonomous` or `human_mediated`, case-sensitive), `integration_name` (optional string naming your integration, e.g. `my-trading-bot`), and `version` (optional string identifying your integration's version). Any other key is dropped, never rejected. The raw value must be at most 1024 bytes of printable US-ASCII (`0x20`-`0x7E`), so send non-ASCII text as JSON `\u` escapes; `integration_name` and `version` are each limited to 256 UTF-16 code units and may not contain control characters, U+2028, U+2029, or U+FFFD. Send the header once: repeated header lines are joined with `, ` and the joined string is what gets parsed, so two complete objects fail as invalid JSON while a single object split across two lines still parses. The header is analytics-only and never affects the request: omitting it, sending it, or sending a value that fails these rules never changes the response status, body, or swap behavior. A value that fails to parse is dropped and reported by the `x-agent-info-status` response header. Never put a user ID, wallet address, email, session token, or API key in these fields.

Sample response

{
  "approval": {
    "chainId": 1,
    "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
    "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "value": "0x00"
  },
  "cancel": null,
  "requestId": "25df056b902224e6064f1d9b2f8056b5"
}

Response result

Response structure

Inferred from examples
  • approvalobject
    • chainIdinteger
    • datastring
    • fromstring
    • tostring
    • valuestring
  • cancelnull
  • requestIdstring

Sellers

SellerPricingRequests · 30dPerformanceAccess
uniswapCurrent
Uniswap Check swap approvals · POST · View API reference
$0 / call—
—successP50—
Loading...
Selected pricing · uniswapUSD / call
Unit price
$0

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 4. Price update time: not supplied.

calls

Total $0

API

Method
POST
Endpoint
https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
  'https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "amount": "1000000000",
  "chainId": 1,
  "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}'

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
x-permit2-disabledRequest headersheadersbooleanNoDisables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.
x-agent-infoRequest headersheadersstringNoOptional attribution hint for AI-agent traffic; send it if an AI agent built or operates your integration. The value is a JSON object with up to three fields: `decision_origin` (required, exactly `autonomous` or `human_mediated`, case-sensitive), `integration_name` (optional string naming your integration, e.g. `my-trading-bot`), and `version` (optional string identifying your integration's version). Any other key is dropped, never rejected. The raw value must be at most 1024 bytes of printable US-ASCII (`0x20`-`0x7E`), so send non-ASCII text as JSON `\u` escapes; `integration_name` and `version` are each limited to 256 UTF-16 code units and may not contain control characters, U+2028, U+2029, or U+FFFD. Send the header once: repeated header lines are joined with `, ` and the joined string is what gets parsed, so two complete objects fail as invalid JSON while a single object split across two lines still parses. The header is analytics-only and never affects the request: omitting it, sending it, or sending a value that fails these rules never changes the response status, body, or swap behavior. A value that fails to parse is dropped and reported by the `x-agent-info-status` response header. Never put a user ID, wallet address, email, session token, or API key in these fields.

maxLength: 1024

amountJSON request bodybodystringYes

pattern: ^[0-9]+$

chainIdJSON request bodybodynumberYes

enum: 1, 10, 56, 130, 137, 143, 196, 324, 480, 1868, 4217, 4326, 4663, 5042, 8453, 10143, 42161, 42220, 43114, 57073, 59144, 81457, 7777777, 1301, 84532, 11155111

includeGasInfoJSON request bodybodybooleanNo
tokenJSON request bodybodystringYes

pattern: ^(0x)?[0-9a-fA-F]{40}$

tokenOutJSON request bodybodystringNo

pattern: ^(0x)?[0-9a-fA-F]{40}$

tokenOutChainIdJSON request bodybodynumberNo

enum: 1, 10, 56, 130, 137, 143, 196, 324, 480, 1868, 4217, 4326, 4663, 5042, 8453, 10143, 42161, 42220, 43114, 57073, 59144, 81457, 7777777, 1301, 84532, 11155111

urgencyJSON request bodybodystring | objectNo
Nested fields and variants

object

Nested fields and variants
body.urgency.level string · Required

Parent object: body.urgency

enum: "normal", "fast", "urgent"

body.urgency.overrides object · Optional

Parent object: body.urgency

Nested fields and variants
body.urgency.overrides.gasLimit string · Optional

Parent object: body.urgency.overrides

body.urgency.overrides.maxFeePerGas string · Optional

Parent object: body.urgency.overrides

body.urgency.overrides.maxPriorityFeePerGas string · Optional

Parent object: body.urgency.overrides

walletAddressJSON request bodybodystringYes

pattern: ^0x[0-9a-fA-F]{40}$

Required markers inside a nested object or variant apply when that object or variant is used.

Sample response

Sample response · Documented HTTP 200 Published documentation example. Verify the actual response after an approved call.

check_approval
{
  "approval": {
    "chainId": 1,
    "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
    "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "value": "0x00"
  },
  "cancel": null,
  "requestId": "25df056b902224e6064f1d9b2f8056b5"
}

Agent integration

Copy the resource contract without sharing an API key.

View API Markdown
API Markdown
# Uniswap Check swap approvals

Check swap approvals with the Uniswap API. The request takes an amount, a chain ID and a wallet address. Use it in a transaction-routing workflow. Use the response in a DeFi workflow for the selected protocol, and compare the request and response with the provider example.
Documentation: https://openany.si/apis/49b15c80-7b97-4628-b980-d6cbd0762a5c
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval
Price: $0 / call
Provider: uniswap
Contract revision: 4
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.

Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.

## Prepared request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "amount": "1000000000",
  "chainId": 1,
  "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}'
```

## API contract
```json
{
  "resource_type": "api",
  "name": "Uniswap Check swap approvals",
  "endpoint": "https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval",
  "method": "POST",
  "content_type": "application/json",
  "execution_mode": "sync",
  "authentication": {
    "type": "bearer",
    "environment_variable": "OPENANY_API_KEY"
  },
  "inputs": [
    {
      "description": "Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.",
      "location": "header",
      "name": "x-permit2-disabled",
      "nullable": false,
      "required": false,
      "type": "boolean"
    },
    {
      "description": "Optional attribution hint for AI-agent traffic; send it if an AI agent built or operates your integration. The value is a JSON object with up to three fields: `decision_origin` (required, exactly `autonomous` or `human_mediated`, case-sensitive), `integration_name` (optional string naming your integration, e.g. `my-trading-bot`), and `version` (optional string identifying your integration's version). Any other key is dropped, never rejected. The raw value must be at most 1024 bytes of printable US-ASCII (`0x20`-`0x7E`), so send non-ASCII text as JSON `\\u` escapes; `integration_name` and `version` are each limited to 256 UTF-16 code units and may not contain control characters, U+2028, U+2029, or U+FFFD. Send the header once: repeated header lines are joined with `, ` and the joined string is what gets parsed, so two complete objects fail as invalid JSON while a single object split across two lines still parses. The header is analytics-only and never affects the request: omitting it, sending it, or sending a value that fails these rules never changes the response status, body, or swap behavior. A value that fails to parse is dropped and reported by the `x-agent-info-status` response header. Never put a user ID, wallet address, email, session token, or API key in these fields.",
      "location": "header",
      "max_length": 1024,
      "name": "x-agent-info",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.",
      "json_schema": {
        "allOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "quote"
                  ]
                }
              ]
            }
          }
        ],
        "description": "Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.",
        "properties": {
          "amount": {
            "pattern": "^[0-9]+$",
            "type": "string"
          },
          "chainId": {
            "enum": [
              1,
              10,
              56,
              130,
              137,
              143,
              196,
              324,
              480,
              1868,
              4217,
              4326,
              4663,
              5042,
              8453,
              10143,
              42161,
              42220,
              43114,
              57073,
              59144,
              81457,
              7777777,
              1301,
              84532,
              11155111
            ],
            "type": "number"
          },
          "includeGasInfo": {
            "type": "boolean"
          },
          "token": {
            "pattern": "^(0x)?[0-9a-fA-F]{40}$",
            "type": "string"
          },
          "tokenOut": {
            "pattern": "^(0x)?[0-9a-fA-F]{40}$",
            "type": "string"
          },
          "tokenOutChainId": {
            "enum": [
              1,
              10,
              56,
              130,
              137,
              143,
              196,
              324,
              480,
              1868,
              4217,
              4326,
              4663,
              5042,
              8453,
              10143,
              42161,
              42220,
              43114,
              57073,
              59144,
              81457,
              7777777,
              1301,
              84532,
              11155111
            ],
            "type": "number"
          },
          "urgency": {
            "oneOf": [
              {
                "enum": [
                  "normal",
                  "fast",
                  "urgent"
                ],
                "type": "string"
              },
              {
                "properties": {
                  "level": {
                    "enum": [
                      "normal",
                      "fast",
                      "urgent"
                    ],
                    "type": "string"
                  },
                  "overrides": {
                    "properties": {
                      "gasLimit": {
                        "type": "string"
                      },
                      "maxFeePerGas": {
                        "type": "string"
                      },
                      "maxPriorityFeePerGas": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "level"
                ],
                "type": "object"
              }
            ]
          },
          "walletAddress": {
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "type": "string"
          }
        },
        "required": [
          "walletAddress",
          "token",
          "amount",
          "chainId"
        ],
        "type": "object"
      },
      "location": "body",
      "name": "body",
      "nullable": false,
      "pointer": "",
      "required": true,
      "type": "object"
    }
  ],
  "billing": {
    "currency": "USD",
    "mode": "fixed",
    "priceMicroUsd": "0",
    "rounding": null,
    "unit": "call",
    "unitQuantity": null
  },
  "examples": [
    {
      "http_status": 200,
      "name": "check_approval",
      "request": {
        "body": {
          "amount": "1000000000",
          "chainId": 1,
          "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
        },
        "headers": {},
        "path": {},
        "query": {}
      },
      "response_body": {
        "approval": {
          "chainId": 1,
          "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
          "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
          "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "value": "0x00"
        },
        "cancel": null,
        "requestId": "25df056b902224e6064f1d9b2f8056b5"
      }
    }
  ]
}
```

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

check_approval

Published documentation example. Verify the actual response after an approved call.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 3

    Review these request fields before running. Keep the published provider and request method unchanged.

    x-permit2-disabled
    Disables the Permit2 approval flow. When set to `true`, `permitData` is returned as `null` and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When `false` or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.
    x-agent-info
    Optional attribution hint for AI-agent traffic; send it if an AI agent built or operates your integration. The value is a JSON object with up to three fields: `decision_origin` (required, exactly `autonomous` or `human_mediated`, case-sensitive), `integration_name` (optional string naming your integration, e.g. `my-trading-bot`), and `version` (optional string identifying your integration's version). Any other key is dropped, never rejected. The raw value must be at most 1024 bytes of printable US-ASCII (`0x20`-`0x7E`), so send non-ASCII text as JSON `\u` escapes; `integration_name` and `version` are each limited to 256 UTF-16 code units and may not contain control characters, U+2028, U+2029, or U+FFFD. Send the header once: repeated header lines are joined with `, ` and the joined string is what gets parsed, so two complete objects fail as invalid JSON while a single object split across two lines still parses. The header is analytics-only and never affects the request: omitting it, sending it, or sending a value that fails these rules never changes the response status, body, or swap behavior. A value that fails to parse is dropped and reported by the `x-agent-info-status` response header. Never put a user ID, wallet address, email, session token, or API key in these fields.
    body
    Complete public Uniswap request body. Internal fields are prohibited. Source-only annotations are kept in the raw OpenAPI snapshot.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/uniswap/v1/check_approval' \
      -X POST \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json' \
      --data-raw '{
      "amount": "1000000000",
      "chainId": 1,
      "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    }'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "approval": {
        "chainId": 1,
        "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
        "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "value": "0x00"
      },
      "cancel": null,
      "requestId": "25df056b902224e6064f1d9b2f8056b5"
    }

Loading related APIs…

Common questions

Do I need a separate key for every provider?

Use your OpenAny API key for standard API access. Read it from OPENANY_API_KEY in your environment and keep it out of prompts, source code and logs.

Are these providers interchangeable?

No. Each offering has its own inputs, pricing and response contract. Selecting a catalog offering does not establish automatic routing or fallback. Confirm the service contract before calling.

How is this API billed?

API-key calls use your shared balance at the selected implementation's published rate. Check the billing unit and request-specific pricing rules before making a paid call. Recorded usage determines the final charge under that contract.

Where do the price and contract come from?

The selected implementation publishes its provider, request contract, revision and billing rules through OpenAny's public API catalog. A revision number identifies a contract version, not a price update date. A price update timestamp is not supplied; do not treat a page date as one.

How do OpenAny Balance and x402 differ?

OpenAny Balance uses an API key and one shared balance. Card, USDC and x402 top-ups, card auto top-up and USDC subscriptions fund that balance; available routes appear on the Credits page. Direct x402 is a separate pay-per-request flow, available only on listings that show it and requiring an authorized payment client.

Does Playground send a paid request?

Yes. After you sign in, Run sends a real API request using an active OpenAny API key. Charges follow the published API contract and use your shared balance. Selecting an implementation, editing inputs and viewing sample responses do not send requests.

Use Uniswap Check swap approvals with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.