IP Whitelisting

IP whitelisting adds an extra layer of security by restricting API key usage to specific IP addresses or ranges.

Configuring IP Whitelisting

  1. Go to API Keys and edit the key
  2. Enable IP Whitelisting
  3. Add one or more IP addresses or CIDR ranges
  4. Save the key

Supported Formats

FormatExampleDescription
Single IPv4203.0.113.50Exact IP match
IPv4 CIDR203.0.113.0/24Range: 203.0.113.0 - 203.0.113.255
Single IPv62001:db8::1Exact IPv6 match
IPv6 CIDR2001:db8::/32IPv6 range

Behavior

  • When IP whitelisting is disabled (default), the key works from any IP address
  • When enabled, only requests from whitelisted IPs are accepted
  • Requests from non-whitelisted IPs receive a 403 error with code ip_not_whitelisted
  • The request IP is logged for security auditing

Finding Your IP

To find the IP address of your server or AI agent service:

# From the server where your agent runs:
curl -s https://api.ipify.org

Cloud Service IPs

If your AI agent runs on a cloud service, you may need to whitelist a range of IPs. Check your provider's documentation for their IP ranges. Note that some cloud functions use dynamic IPs — in those cases, IP whitelisting may not be practical.